Commit efb48903 authored by jfschaefer's avatar jfschaefer
Browse files

more

parent 88c0cb9f
--# -path=.:abstract:english:functors --# -path=.:abstract:english:functors
concrete MainEng of Main = BasicEng, ExampleLexiconEng; concrete MainEng of Main = BasicEng, ExampleLexiconEng;
...@@ -7,9 +7,16 @@ abstract Basic = Core ** { ...@@ -7,9 +7,16 @@ abstract Basic = Core ** {
every : Obj -> Term; every : Obj -> Term;
some : Obj -> Term; some : Obj -> Term;
-- objects
ob2_to_obj : Obj2 -> Term -> Obj;
ob3_to_obj : Obj3 -> Term -> Term -> Obj;
-- statements -- statements
term_is_adj : Term -> PosNegPol -> Adjective -> Statement; term_is_adj : Term -> PosNegPol -> Adjective -> Statement;
-- declarations
let_be : Identifier -> Obj -> Declaration;
-- sentences -- sentences
stmt_to_sentence : Statement -> Sentence; stmt_to_sentence : Statement -> Sentence;
def_to_sentence : Definition -> Sentence; def_to_sentence : Definition -> Sentence;
......
...@@ -13,9 +13,9 @@ abstract Core = { ...@@ -13,9 +13,9 @@ abstract Core = {
Declaration; Declaration;
Sentence; Sentence;
Identifier; Identifier; -- can be plural
PosNegPol; -- polarity of a statement PosNegPol; -- polarity of a statement
fun fun
PosPol : PosNegPol; PosPol : PosNegPol;
......
...@@ -3,4 +3,9 @@ abstract ExampleLexicon = Core ** { ...@@ -3,4 +3,9 @@ abstract ExampleLexicon = Core ** {
integer : Obj; integer : Obj;
even : Adjective; even : Adjective;
divisible_by : Adjective2; divisible_by : Adjective2;
squareroot : Obj2;
function_from_to : Obj3;
x : Identifier;
y : Identifier;
} }
--# -path=.:../functors:../abstract --# -path=.:../functors:../abstract
concrete BasicEng of Basic = CoreEng, BasicI ** open SyntaxEng in { concrete BasicEng of Basic = CoreEng, BasicI ** open SyntaxEng, Prelude, UtilsEng in {
lin
let_be id obj = lin S { s = "let" ++ id.s ++ "be" ++
(getAcc (mkNP (table {False => aSg_Det; True => aPl_Det} ! id.plural) obj)) };
} }
--# -path=.:../functors:../abstract --# -path=.:../functors:../abstract
concrete CoreEng of Core = CoreI ** open SyntaxEng, GrammarEng in { concrete CoreEng of Core = CoreI ** open SyntaxEng, GrammarEng, Prelude in {
-- lin -- lin
-- PosPol = GrammarEng.PPos; -- PosPol = GrammarEng.PPos;
-- NegPol = GrammarEng.PNeg; -- NegPol = GrammarEng.PNeg;
......
--# -path=.:../functors:../abstract --# -path=.:../functors:../abstract
concrete ExampleLexiconEng of ExampleLexicon = CoreEng ** open ParadigmsEng, SyntaxEng in { concrete ExampleLexiconEng of ExampleLexicon = CoreEng ** open ParadigmsEng, Prelude, SyntaxEng in {
oper oper
by_Prep : Prep = mkPrep "by"; by_Prep : Prep = mkPrep "by";
of_Prep : Prep = mkPrep "of";
-- from_Prep : Prep = mkPrep "from";
-- to_Prep : Prep = mkPrep "to";
lin lin
integer = mkCN (mkN "integer"); integer = mkCN (mkN "integer");
even = mkAP (mkA "even"); even = mkAP (mkA "even");
divisible_by = mkA2 (mkA "divisible") by_Prep; divisible_by = mkA2 (mkA "divisible") by_Prep;
squareroot = mkN2 (mkN "square root") of_Prep;
function_from_to = mkN3 (mkN "function") from_Prep to_Prep;
x = lin Identifier { s = "x" ; plural = False};
y = lin Identifier { s = "y" ; plural = False};
} }
resource UtilsEng = open ResEng, SyntaxEng in {
oper
-- is defined here because ResEng and SyntaxEng provide macros with the same names,
-- which would require prefixing a lot of things if imported into e.g. BasicEng.
getAcc : NP -> Str = \np -> np.s!NPAcc;
}
...@@ -7,9 +7,17 @@ incomplete concrete BasicI of Basic = CoreI ** open Syntax in { ...@@ -7,9 +7,17 @@ incomplete concrete BasicI of Basic = CoreI ** open Syntax in {
every obj = mkNP every_Det obj; every obj = mkNP every_Det obj;
some obj = mkNP someSg_Det obj; some obj = mkNP someSg_Det obj;
-- objects
ob2_to_obj obj2 term = mkCN obj2 term;
ob3_to_obj obj3 a b = mkCN obj3 a b;
-- statements -- statements
term_is_adj term pol adj = mkS pol (mkCl term adj); term_is_adj term pol adj = mkS pol (mkCl term adj);
-- declarations
-- let_be : Identifier -> Obj -> Declaration; -- specified in concrete languages
-- sentences -- sentences
stmt_to_sentence stmt = mkUtt stmt; stmt_to_sentence stmt = mkUtt stmt;
def_to_sentence defi = mkUtt defi; def_to_sentence defi = mkUtt defi;
......
incomplete concrete CoreI of Core = open Syntax, Grammar in { incomplete concrete CoreI of Core = open Syntax, Grammar, Prelude in {
lincat lincat
Term = NP; Term = NP;
Obj = CN; Obj = CN;
...@@ -13,7 +13,7 @@ incomplete concrete CoreI of Core = open Syntax, Grammar in { ...@@ -13,7 +13,7 @@ incomplete concrete CoreI of Core = open Syntax, Grammar in {
Declaration = S; Declaration = S;
Sentence = Utt; Sentence = Utt;
Identifier = Str; Identifier = {s : Str; plural : Bool};
PosNegPol = Pol; PosNegPol = Pol;
lin lin
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment