1
0
forked from GitHub/gf-core

added example for NLG from logical formula. See examples/nlg

This commit is contained in:
kr.angelov
2011-08-30 14:58:16 +00:00
parent 4215fc31bf
commit c70df9200c
4 changed files with 206 additions and 0 deletions

23
examples/nlg/LogicEng.gf Normal file
View File

@@ -0,0 +1,23 @@
--# -path=present
concrete LogicEng of Logic = open (Eng=GrammarEng), ParadigmsEng, ResEng in {
lincat
Ind = {s : Str};
Prop = {s:Str};
lin
john = {s="john"};
mary = {s="mary"};
boy x = {s="boy"++"("++x.s++")"};
smart x = {s="smart"++"("++x.s++")"};
love x y = {s="love"++"("++x.s++","++y.s++")"};
leave x = {s="leave"++"("++x.s++")"};
and x y = {s=x.s++"&&"++y.s};
or x y = {s=x.s++"||"++y.s};
impl x y = {s=x.s++"=>"++y.s};
forall f = {s="forall"++f.$0++"."++"("++f.s++")"};
exists f = {s="exists"++f.$0++"."++"("++f.s++")"};
not p = {s="not"++"("++p.s++")"};
eq x y = {s=x.s++"="++y.s};
}