Commit ee21cca3 authored by jfschaefer's avatar jfschaefer
Browse files

fix 'such that'

parent 7fc5e4c5
......@@ -20,7 +20,7 @@ incomplete concrete MCatsI of MCats = open Syntax, ParamX in {
Statement = Cl;
-- statement as sentence or relative sentence ("such that ...")
StatementFin = { s : S ; rs : RS };
StatementFin = S;
Definition = S;
Declaration = S;
Utterance = Utt;
......
......@@ -7,13 +7,15 @@ abstract NGrammar = MCats, Grammar, Extra, ExtraEngAbs ** {
no_identifier : Identifier;
restrict_mobj : MObjProp -> MObj -> MObj; -- "even" -> "integer" -> "even integer"
mobj_such_that : MObj -> StatementFin -> MObj; -- "integer such that ..."
-- mobj_such_that : MObj -> StatementFin -> MObj; -- "integer such that ..."
-- def_descr_mobj : MObj -> DefMObj; -- "cube" -> "the cube"
-- appo_mobj : MObj -> MathCN -> MObj; -- "an integer $ mi ( n ) $
-- it_pron_defmobj : DefMObj; -- "it"
--
exists_statement : MObj -> Identifier -> Statement; -- "integer" -> "there is an integer"
exists_statement : MObj -> Identifier -> Statement; -- "integer" -> x -> "there is an integer x"
exists_statement_sth : PosNegPol -> MObj -> Identifier -> StatementFin -> StatementFin; -- "integer" -> x -> ... -> "there is an integer x such that ..."
not_exists_statement : MObj -> Identifier -> Statement; -- "integer" -> "there is no integer"
not_exists_statement_sth : PosNegPol -> MObj -> Identifier -> StatementFin -> StatementFin;
-- eq_defmobj_defmobj : DefMObj -> DefMObj -> Statement; -- "the largest element is the maximum"
--
state : Statement -> PosNegPol -> StatementFin;
......
......@@ -3,6 +3,8 @@ concrete NGrammarEng of NGrammar = MCatsEng, GrammarEng, ExtraEng ** open Syntax
call_V2A : V2A = mkV2A (mkV "call" "calls" "called" "called" "calling") noPrep;
call_V3 : V3 = mkV3 (mkV "call" "calls" "called" "called" "calling");
such_that : S -> S -> S = \a,b -> lin S { s = a.s ++ "such" ++ "that" ++ b.s };
lin
PosPol = GrammarEng.PPos;
NegPol = GrammarEng.PNeg;
......@@ -10,7 +12,7 @@ concrete NGrammarEng of NGrammar = MCatsEng, GrammarEng, ExtraEng ** open Syntax
no_identifier = { s = ""; m = one | many };
restrict_mobj prop obj = mobjPrepMObjProp obj prop;
mobj_such_that obj restr = mobjAddSuffix obj restr.rs;
-- mobj_such_that obj restr = mobjAddSuffix obj restr.rs;
-- def_descr_mobj obj = mkNP the_Art obj;
-- appo_mobj obj mcn = lin CN { s = \\number,case_ => obj.s ! number ! case_ ++ mcn.s ! number ! case_; g = obj.g };
......@@ -18,11 +20,15 @@ concrete NGrammarEng of NGrammar = MCatsEng, GrammarEng, ExtraEng ** open Syntax
-- it_pron_defmobj = mkNP it_Pron;
--
exists_statement obj id = mkCl (DetCN aSg_Det (mobjToCN obj id)) | ExistsNP (DetCN aSg_Det (mobjToCN obj id)); -- ExistsNP (mkNP aSg_Det obj);
exists_statement_sth pol obj id stmt = such_that (mkS pol (mkCl (DetCN aSg_Det (mobjToCN obj id)))) stmt
| such_that (mkS pol (ExistsNP (DetCN aSg_Det (mobjToCN obj id)))) stmt; -- ExistsNP (mkNP aSg_Det obj);
not_exists_statement obj id = mkCl (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)) |
ExistsNP (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id));
not_exists_statement_sth pol obj id stmt = such_that (mkS pol (mkCl (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)))) stmt
| such_that (mkS pol (ExistsNP (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)))) stmt; -- ExistsNP (mkNP aSg_Det obj);
-- eq_defmobj_defmobj a b = mkCl a b;
--
state stmt pol = { s = mkS pol stmt; rs = mkRS pol (mkRCl stmt) };
state stmt pol = mkS pol stmt;
-- iff_statementfin a b = { s = mkS (mkConj "iff") a.s b.s; rs = mkRS (mkConj "iff") a.rs b.rs };
-- and_statementfin a b = { s = mkS (mkConj "and") a.s b.s; rs = mkRS (mkConj "and") a.rs b.rs };
-- or_statementfin a b = { s = mkS (mkConj "or") a.s b.s; rs = mkRS (mkConj "or") a.rs b.rs };
......@@ -31,7 +37,7 @@ concrete NGrammarEng of NGrammar = MCatsEng, GrammarEng, ExtraEng ** open Syntax
(DetCN aSg_Det (mobjToCN obj id)) -- (mkNP aSg_Det (mobjToCN obj))
(PastPartAP (mkVPSlash call_V2A prop)));
-- -- iff_definition defi condition = lin S { s = "iff" }; -- better solution for this?
iff_definition defi condition = lin S { s = defi.s ++ "iff" ++ condition.s.s }; -- better solution for this?
iff_definition defi condition = lin S { s = defi.s ++ "iff" ++ condition.s }; -- better solution for this?
-- def_defmobj_defmobj a b = mkCl a b;
def_mobj_is_mobj definiendum id definiens =
mkS (mkCl (DetCN aSg_Det (mobjToCN definiens id)) (mobjToCN definiendum)) -- a unitary quasigroup is a loop
......@@ -47,7 +53,7 @@ concrete NGrammarEng of NGrammar = MCatsEng, GrammarEng, ExtraEng ** open Syntax
-- rs = mkRS (mkConj "then") { s = (ImpP3 (identifierToNP id) (mkVP (mobjToCN obj))).s } stmt.rs;
-- };
utter_statement s = mkUtt s.s;
utter_statement s = mkUtt s;
utter_declaration s = mkUtt s;
utter_definition s = mkUtt s;
--
......
......@@ -4,6 +4,7 @@ concrete NGrammarGer of NGrammar = MCatsGer, GrammarGer** open SyntaxGer, Paradi
call_V3 : V3 = mkV3 (ParadigmsGer.mkV "heißen");
exist_V2 : V2 = mkV2 (ParadigmsGer.mkV ("geben" | "existieren"));
such_that : S -> S -> S = \a,b -> lin S { s = table { r => a.s!r ++ "," ++ "sodass" ++ b.s!r } } ;
lin
PosPol = GrammarGer.PPos;
NegPol = GrammarGer.PNeg;
......@@ -11,44 +12,29 @@ concrete NGrammarGer of NGrammar = MCatsGer, GrammarGer** open SyntaxGer, Paradi
no_identifier = { s = ""; m = one | many };
restrict_mobj prop obj = mobjPrepMObjProp obj prop;
mobj_such_that obj restr = mobjAddSuffix obj restr.rs;
-- mobj_such_that obj restr = mobjAddSuffix obj restr.rs;
-- def_descr_mobj obj = mkNP the_Art obj;
-- appo_mobj obj mcn = lin CN { s = \\number,case_ => obj.s ! number ! case_ ++ mcn.s ! number ! case_; g = obj.g };
-- it_pron_defmobj = mkNP it_Pron;
--
exists_statement obj id = mkCl (DetCN aSg_Det (mobjToCN obj id)) | mkCl (mkVP exist_V2 (DetCN aSg_Det (mobjToCN obj id)));
exists_statement_sth pol obj id stmt = such_that (mkS pol (mkCl (DetCN aSg_Det (mobjToCN obj id)))) stmt
| such_that (mkS pol ( mkCl (mkVP exist_V2 (DetCN aSg_Det (mobjToCN obj id))))) stmt; -- ExistsNP (mkNP aSg_Det obj);
not_exists_statement obj id = mkCl (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)) |
mkCl (mkVP exist_V2 (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)));
-- eq_defmobj_defmobj a b = mkCl a b;
--
state stmt pol = { s = mkS pol stmt; rs = mkRS pol (mkRCl stmt) };
-- iff_statementfin a b = { s = mkS (mkConj "iff") a.s b.s; rs = mkRS (mkConj "iff") a.rs b.rs };
-- and_statementfin a b = { s = mkS (mkConj "and") a.s b.s; rs = mkRS (mkConj "and") a.rs b.rs };
-- or_statementfin a b = { s = mkS (mkConj "or") a.s b.s; rs = mkRS (mkConj "or") a.rs b.rs };
--
not_exists_statement_sth pol obj id stmt = such_that (mkS pol (mkCl (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)))) stmt
| such_that (mkS pol ( mkCl (mkVP exist_V2 (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id))))) stmt; -- ExistsNP (mkNP aSg_Det obj);
state stmt pol = mkS pol stmt;
def_mobj_mobjprop obj id prop = mkS (mkCl
(DetCN aSg_Det (mobjToCN obj id)) -- (mkNP aSg_Det (mobjToCN obj))
(PastPartAP (mkVPSlash call_V2A prop)));
-- iff_definition defi condition = lin S { s = "iff" }; -- better solution for this?
iff_definition defi condition = lin S { s = \\order => (defi.s!order) ++ "genau dann wenn" ++ condition.s.s!Sub }; -- better solution for this?
-- def_defmobj_defmobj a b = mkCl a b;
(DetCN aSg_Det (mobjToCN obj id))
prop);
-- (mkVP (mkVPSlash call_V2A prop))); -- TODO: FIX THIS!!!
iff_definition defi condition = lin S { s = \\order => (defi.s!order) ++ "genau dann , wenn" ++ condition.s!Sub }; -- better solution for this?
def_mobj_is_mobj definiendum id definiens =
mkS (mkCl (DetCN aSg_Det (mobjToCN definiens id)) (mobjToCN definiendum)) -- a unitary quasigroup is a loop
| mkS (mkCl (DetCN aSg_Det (mobjToCN definiens id)) -- a unitary quasigroup is called a loop
(PastPartAP (mkVPSlash call_V3 (DetCN aSg_Det (mobjToCN definiendum)))));
-- mkS (mkCl (DetCN {- mkNP is for some reason ambiguous -}
-- aSg_Det (appo_mobj definiendum representative)) definiens);
-- let_id_be_a_mobj id obj = ImpP3 (identifierToNP id) (mkVP (mobjToCN obj));
-- let_then_stmt id obj stmt = {
-- s = mkS (mkConj "then") { s = (ImpP3 (identifierToNP id) (mkVP (mobjToCN obj))).s } stmt.s;
-- rs = mkRS (mkConj "then") { s = (ImpP3 (identifierToNP id) (mkVP (mobjToCN obj))).s } stmt.rs;
-- };
utter_statement s = mkUtt s.s;
utter_statement s = mkUtt s;
utter_declaration s = mkUtt s;
utter_definition s = mkUtt s;
......
......@@ -4,6 +4,7 @@ concrete NGrammarLog of NGrammar = MCatsLog ** {
lwrap : Str -> Str = \f -> "(" ++ "λx." ++ f ++ ")";
inp : Str -> Str = \s -> "(" ++ s ++ ")";
and_formula : Identifier -> Str = \id -> table {true => "∧" ++ id.formula; false => ""} ! id.hasFormula;
lin
PosPol = true;
......@@ -12,10 +13,12 @@ concrete NGrammarLog of NGrammar = MCatsLog ** {
no_identifier = { formula = ""; core = "x0"; hasFormula = false };
restrict_mobj prop obj = prop ++ "∧" ++ obj;
mobj_such_that obj restr = obj ++ "∧" ++ restr;
-- mobj_such_that obj restr = obj ++ "∧" ++ restr;
exists_statement obj id = inp("∃" ++ id.core ++ "." ++ lwrap(obj) ++ id.core ++ and_formula(id));
exists_statement_sth pol obj id stmt = inp(table { true => ""; false => "¬" } ! pol ++ "∃" ++ id.core ++ "." ++ lwrap(obj) ++ id.core ++ and_formula(id) ++ "∧" ++ inp(stmt));
not_exists_statement obj id = inp("¬" ++ "∃" ++ id.core ++ "." ++ lwrap(obj) ++ id.core ++ and_formula(id));
not_exists_statement_sth pol obj id stmt = inp(table { true => "¬"; false => "" } ! pol ++ "∃" ++ id.core ++ "." ++ lwrap(obj) ++ id.core ++ and_formula(id) ++ "∧" ++ inp(stmt));
state stmt pol = table { true => stmt; false => "¬" ++ stmt } ! pol;
def_mobj_mobjprop obj id prop = {
......
concrete NLexiconGer of NLexicon = MCatsGer ** open SyntaxGer, ParadigmsGer, UtilsGer in {
concrete NLexiconGer of NLexicon = MCatsGer ** open SyntaxGer, ParadigmsGer, ResGer, UtilsGer in {
lin
-- integer_MObj = mkCN (mkN "integer");
-- set_MObj = mkCN (mkN "set");
-- alphabet_MObj = mkCN (mkN "alphabet");
quasigroup_MObj = mkMObj (mkN "Quasigruppe");
loop_MObj = mkMObj (mkN "Loop");
integer_MObj = mkMObj (mkN "ganze Zahl");
quasigroup_MObj = mkMObj (ParadigmsGer.mkN "Quasigruppe");
loop_MObj = mkMObj (ParadigmsGer.mkN "Loop");
integer_MObj = mkMObj (ParadigmsGer.mkN "ganze Zahl" Fem);
finite_MObjProp = mkAP (mkA "endlich");
empty_MObjProp = mkAP (mkA "leer");
even_MObjProp = mkAP (mkA "gerade");
positive_MObjProp = mkAP (mkA "positiv");
prime_MObjProp = mkAP (mkA "primzahlig");
unital_MObjProp = mkAP (mkA "unitär");
finite_MObjProp = mkAP (ParadigmsGer.mkA "endlich");
empty_MObjProp = mkAP (ParadigmsGer.mkA "leer");
even_MObjProp = mkAP (ParadigmsGer.mkA "gerade");
positive_MObjProp = mkAP (ParadigmsGer.mkA "positiv");
prime_MObjProp = mkAP (ParadigmsGer.mkA "primzahlig");
unital_MObjProp = mkAP (ParadigmsGer.mkA "unitär");
}
......@@ -9,7 +9,7 @@ concrete NLexiconLog of NLexicon = MCatsLog, NLexiconMObjLog ** {
finite_MObjProp = "finite" ++ "(" ++ "x" ++ ")";
empty_MObjProp = "empty" ++ "(" ++ "x" ++ ")";
even_MObjProp = "even" ++ "(" ++ "x" ++ ")";
positive_MObjProp = "positive" ++ "(" ++ "x" ++ ")";
positive_MObjProp = "pos" ++ "(" ++ "x" ++ ")";
prime_MObjProp = "prime" ++ "(" ++ "x" ++ ")";
unital_MObjProp = "unital" ++ "(" ++ "x" ++ ")";
}
......@@ -43,5 +43,5 @@ concrete NLexiconMObjLog of NLexiconMObj = MCatsLog ** {
vertex_MObj = "vertex" ++ "(" ++ "x" ++ ")";
process_MObj = "process" ++ "(" ++ "x" ++ ")";
norm_MObj = "norm" ++ "(" ++ "x" ++ ")";
integer_MObj = "integer" ++ "(" ++ "x" ++ ")";
integer_MObj = "int" ++ "(" ++ "x" ++ ")";
}
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