1
0
forked from GitHub/gf-core
Files
gf-core/examples/tutorial/old/semantics/Base.gf
2008-11-11 10:28:32 +00:00

61 lines
896 B
Plaintext

-- abstract syntax of a query language
abstract Base = {
cat
S ;
NP ;
PN ;
CN ;
AP ;
A2 ;
Conj ;
fun
-- sentence syntax
PredAP : NP -> AP -> S ;
ComplA2 : A2 -> NP -> AP ;
ModCN : AP -> CN -> CN ;
ConjAP : Conj -> AP -> AP -> AP ;
ConjNP : Conj -> NP -> NP -> NP ;
UsePN : PN -> NP ;
Every : CN -> NP ;
Some : CN -> NP ;
And, Or : Conj ;
-- lexicon
UseInt : Int -> PN ;
Number : CN ;
Even, Odd, Prime : AP ;
Equal, Greater, Smaller, Divisible : A2 ;
Sum, Product, GCD : ListPN -> PN ;
-- adding questions
cat
Question ;
Answer ;
ListPN ;
fun
WhatIs : PN -> Question ;
WhichAre : CN -> AP -> Question ;
QuestS : S -> Question ;
Yes : Answer ;
No : Answer ;
Value : NP -> Answer ;
None : NP ;
Many : ListPN -> NP ;
BasePN : PN -> PN -> ListPN ;
ConsPN : PN -> ListPN -> ListPN ;
}