Commit efb48903 authored by jfschaefer's avatar jfschaefer
Browse files

more

parent 88c0cb9f
--# -path=.:abstract:english:functors
concrete MainEng of Main = BasicEng, ExampleLexiconEng;
......@@ -7,9 +7,16 @@ abstract Basic = Core ** {
every : Obj -> Term;
some : Obj -> Term;
-- objects
ob2_to_obj : Obj2 -> Term -> Obj;
ob3_to_obj : Obj3 -> Term -> Term -> Obj;
-- statements
term_is_adj : Term -> PosNegPol -> Adjective -> Statement;
-- declarations
let_be : Identifier -> Obj -> Declaration;
-- sentences
stmt_to_sentence : Statement -> Sentence;
def_to_sentence : Definition -> Sentence;
......
......@@ -13,9 +13,9 @@ abstract Core = {
Declaration;
Sentence;
Identifier;
Identifier; -- can be plural
PosNegPol; -- polarity of a statement
PosNegPol; -- polarity of a statement
fun
PosPol : PosNegPol;
......
......@@ -3,4 +3,9 @@ abstract ExampleLexicon = Core ** {
integer : Obj;
even : Adjective;
divisible_by : Adjective2;
squareroot : Obj2;
function_from_to : Obj3;
x : Identifier;
y : Identifier;
}
--# -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
concrete CoreEng of Core = CoreI ** open SyntaxEng, GrammarEng in {
concrete CoreEng of Core = CoreI ** open SyntaxEng, GrammarEng, Prelude in {
-- lin
-- PosPol = GrammarEng.PPos;
-- NegPol = GrammarEng.PNeg;
......
--# -path=.:../functors:../abstract
concrete ExampleLexiconEng of ExampleLexicon = CoreEng ** open ParadigmsEng, SyntaxEng in {
concrete ExampleLexiconEng of ExampleLexicon = CoreEng ** open ParadigmsEng, Prelude, SyntaxEng in {
oper
by_Prep : Prep = mkPrep "by";
of_Prep : Prep = mkPrep "of";
-- from_Prep : Prep = mkPrep "from";
-- to_Prep : Prep = mkPrep "to";
lin
integer = mkCN (mkN "integer");
even = mkAP (mkA "even");
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 {
every obj = mkNP every_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
term_is_adj term pol adj = mkS pol (mkCl term adj);
-- declarations
-- let_be : Identifier -> Obj -> Declaration; -- specified in concrete languages
-- sentences
stmt_to_sentence stmt = mkUtt stmt;
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
Term = NP;
Obj = CN;
......@@ -13,7 +13,7 @@ incomplete concrete CoreI of Core = open Syntax, Grammar in {
Declaration = S;
Sentence = Utt;
Identifier = Str;
Identifier = {s : Str; plural : Bool};
PosNegPol = Pol;
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