Commit d4bf5740 authored by jfschaefer's avatar jfschaefer
Browse files

more

parent efb48903
......@@ -5,7 +5,8 @@ abstract Basic = Core ** {
-- terms
every : Obj -> Term;
some : Obj -> Term;
some : Obj -> Term; -- the most common way ("a")
some_var : Obj -> Term; -- an alternative way, if it exists ("some") - or should we use variants?
-- objects
ob2_to_obj : Obj2 -> Term -> Obj;
......@@ -13,6 +14,12 @@ abstract Basic = Core ** {
-- statements
term_is_adj : Term -> PosNegPol -> Adjective -> Statement;
term_is_obj : Term -> PosNegPol -> Obj -> Statement;
-- definitions
term_is_obj_def : Term -> Obj -> Definition;
term_is_called_obj_def : Term -> Obj -> Definition;
term_is_called_adj_def : Term -> Adjective -> Definition;
-- declarations
let_be : Identifier -> Obj -> Declaration;
......
......@@ -13,11 +13,15 @@ abstract Core = {
Declaration;
Sentence;
Identifier; -- can be plural
Identifier; -- can be plural
OptionalIdentifier;
PosNegPol; -- polarity of a statement
fun
PosPol : PosNegPol;
NegPol : PosNegPol;
someIdentifier : Identifier -> OptionalIdentifier;
noIdentifier : OptionalIdentifier;
}
......@@ -2,6 +2,11 @@
concrete BasicEng of Basic = CoreEng, BasicI ** open SyntaxEng, Prelude, UtilsEng in {
lin
-- definitions
term_is_called_obj_def term obj = mkS (mkCl term (is_called_NP (mkNP aSg_Det obj)));
term_is_called_adj_def term adj = mkS (mkCl term (is_called_AP adj));
-- declarations
let_be id obj = lin S { s = "let" ++ id.s ++ "be" ++
(getAcc (mkNP (table {False => aSg_Det; True => aPl_Det} ! id.plural) obj)) };
}
resource UtilsEng = open ResEng, SyntaxEng in {
resource UtilsEng = open ResEng, SyntaxEng, ParadigmsEng, CatEng, ConstructorsEng in {
oper
call_V = mkV "call" "calls" "called" "called" "calling";
is_called_Adv : Adv -> CatEng.VP = \adv -> mkVP (passiveVP (mkV2 call_V)) adv; -- inspired by `passiveVP`
is_called_NP : NP -> CatEng.VP = \np -> is_called_Adv (ConstructorsEng.mkAdv noPrep np);
is_called_AP : AP -> CatEng.VP = \ap -> is_called_Adv (ParadigmsEng.mkAdv (ap.s!(AgP1 Sg)));
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.
......
......@@ -5,7 +5,8 @@ incomplete concrete BasicI of Basic = CoreI ** open Syntax in {
-- terms
every obj = mkNP every_Det obj;
some obj = mkNP someSg_Det obj;
some obj = mkNP aSg_Det obj;
some_var obj = mkNP someSg_Det obj;
-- objects
ob2_to_obj obj2 term = mkCN obj2 term;
......@@ -13,6 +14,12 @@ incomplete concrete BasicI of Basic = CoreI ** open Syntax in {
-- statements
term_is_adj term pol adj = mkS pol (mkCl term adj);
term_is_obj term pol obj = mkS pol (mkCl term obj);
-- definitions
term_is_obj_def term obj = mkS (mkCl term obj);
-- term_is_called_obj_def : Term -> MObj -> Definition;
-- term_is_called_adj_def : Term -> Adjective -> Definition;
-- declarations
-- let_be : Identifier -> Obj -> Declaration; -- specified in concrete languages
......
......@@ -14,9 +14,13 @@ incomplete concrete CoreI of Core = open Syntax, Grammar, Prelude in {
Sentence = Utt;
Identifier = {s : Str; plural : Bool};
OptionalIdentifier = {s : Str; plural : Bool};
PosNegPol = Pol;
lin
PosPol = PPos;
NegPol = PNeg;
someIdentifier id = id;
noIdentifier = {s = ""; plural = False};
}
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