mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
started a subdir for the book
This commit is contained in:
12
book/examples/chapter7/Query.gf
Normal file
12
book/examples/chapter7/Query.gf
Normal file
@@ -0,0 +1,12 @@
|
||||
abstract Query = {
|
||||
flags startcat=Question ;
|
||||
cat
|
||||
Answer ; Question ; Object ;
|
||||
fun
|
||||
Even : Object -> Question ;
|
||||
Odd : Object -> Question ;
|
||||
Prime : Object -> Question ;
|
||||
Number : Int -> Object ;
|
||||
Yes : Answer ;
|
||||
No : Answer ;
|
||||
}
|
||||
13
book/examples/chapter7/QueryEng.gf
Normal file
13
book/examples/chapter7/QueryEng.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
concrete QueryEng of Query = {
|
||||
lincat
|
||||
Answer, Question, Object = Str ;
|
||||
lin
|
||||
Even = pred "even" ;
|
||||
Odd = pred "odd" ;
|
||||
Prime = pred "prime" ;
|
||||
Number i = i.s ;
|
||||
Yes = "yes" ;
|
||||
No = "no" ;
|
||||
oper
|
||||
pred : Str -> Str -> Str = \f,x -> "is" ++ x ++ f ;
|
||||
}
|
||||
13
book/examples/chapter7/QueryFin.gf
Normal file
13
book/examples/chapter7/QueryFin.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
concrete QueryFin of Query = {
|
||||
lincat
|
||||
Answer, Question, Object = Str ;
|
||||
lin
|
||||
Even = pred "parillinen" ;
|
||||
Odd = pred "pariton" ;
|
||||
Prime = pred "alkuluku" ;
|
||||
Number i = i.s ;
|
||||
Yes = "kyllä" ;
|
||||
No = "ei" ;
|
||||
oper
|
||||
pred : Str -> Str -> Str = \f,x -> "onko" ++ x ++ f ;
|
||||
}
|
||||
Reference in New Issue
Block a user