Attention: Maintenance on monday 19.04.2021 from 07:00 - 13:00 (Gitlab and Mattermost are offline!)

Commit 0c370d94 authored by jfschaefer's avatar jfschaefer

improved GF for prime definition

parent 859c860f
abstract MathLex = Cat ** {
cat MathNP;
cat
MathNP;
MathExpr;
MathBinRel; -- binary relation
fun
positive_A : A ;
prime_A : A ;
integer_N : N ;
call_V2 : V2;
call_V2A : V2A;
iff_Subj : Subj;
three_PN : PN;
-- for the Math Grammar
appo : N -> MathNP -> N;
n_MathNP : MathNP;
applyRel : MathBinRel -> MathExpr -> MathExpr -> MathExpr;
exprToMathNP : MathExpr -> MathNP;
exprToCl : MathExpr -> Cl;
divides_MathBinRel : MathBinRel;
lessThan_MathBinRel : MathBinRel;
n_MathExpr : MathExpr;
m_MathExpr : MathExpr;
one_MathExpr : MathExpr;
}
......@@ -6,16 +6,28 @@ concrete MathLexEng of MathLex = CatEng **
flags
optimize=values ;
lincat MathNP = Str;
lincat
MathNP = Str;
MathExpr = Str;
MathBinRel = Str;
lin
positive_A = regA "positive" ;
prime_A = regA "prime" ;
integer_N = regN "integer" ;
call_V2 = dirV2 (regV "call") ;
call_V2A = mkV2A (mkV "call" "calls" "called" "called" "calling") noPrep ;
iff_Subj = mkSubj "iff";
three_PN = mkPN (mkN nonhuman (mkN "three")) ;
-- for the Math Grammar
appo n a = lin N {s = \\x,y => n.s ! x ! y ++ a; g=n.g};
n_MathNP = "$n$";
applyRel rel a b = a ++ rel ++ b; -- e.g. "m < n"
exprToMathNP expr = "$" ++ expr ++ "$";
exprToCl expr = { s = table { _ => table { _ => table { _ => table { _=> "$" ++ expr ++ "$" } } } } };
divides_MathBinRel = "\\divides";
lessThan_MathBinRel = "<";
n_MathExpr = "n";
m_MathExpr = "m";
one_MathExpr = "1";
}
import MathEng.gf
parse -cat=MathNP "$ n $"
parse "we call a positive integer $ n $ prime , iff there is no integer $ 1 < m < n $ such that $ m \\divides n $"
Markdown is supported
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