summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-21 10:01:14 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-21 10:01:14 +0000
commita9472f91e571d0215c7db408c98b7514b3644ca9 (patch)
tree4f9339aa950a02847ebbb851ba9ecfb4e08ae9b8 /examples
parentbc2cac719b7fc4a4a4242b903c31d8e8bfcb258f (diff)
the lincat of Int simplified to SS again (Linear,Lookup,CheckGrammar by commenting out)
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorial/semantics/BaseI.gf56
1 files changed, 30 insertions, 26 deletions
diff --git a/examples/tutorial/semantics/BaseI.gf b/examples/tutorial/semantics/BaseI.gf
index 23b4fbcb8..04fb0018c 100644
--- a/examples/tutorial/semantics/BaseI.gf
+++ b/examples/tutorial/semantics/BaseI.gf
@@ -1,20 +1,20 @@
---# -path=.:prelude:present
-
-concrete BaseEng of Base = open Syntax, (G = Grammar), Symbolic, LexBase in {
+incomplete concrete BaseI of Base =
+ open Syntax, (G = Grammar), Symbolic, LexBase in {
flags lexer=literals ; unlexer=text ;
lincat
- Question = Phr ;
- Answer = Phr ;
+ Question = G.Phr ;
+ Answer = G.Phr ;
S = Cl ;
- NP = NP ;
- PN = NP ;
- CN = CN ;
- AP = AP ;
- A2 = A2 ;
- Conj = Conj ;
- ListPN = ListNP ;
+ NP = G.NP ;
+ PN = G.NP ;
+ CN = G.CN ;
+ AP = G.AP ;
+ A2 = G.A2 ;
+ Conj = G.Conj ;
+ ListPN = G.ListNP ;
+
lin
PredAP = mkCl ;
@@ -34,33 +34,37 @@ lin
And = and_Conj ;
Or = or_Conj ;
- UseInt = symb ;
+ UseInt i = symb i ;
Number = mkCN number_N ;
- Even = mkAP even_A ;
- Odd = mkAP odd_A ;
- Prime = mkAP prime_A ;
- Equal = mkA2 equal_A2 ;
- Greater = mkA2 greater_A2 ;
- Smaller = mkA2 smaller_A2 ;
- Divisible = mkA2 divisible_A2 ;
+ Even = mkAP even_A ;
+ Odd = mkAP odd_A ;
+ Prime = mkAP prime_A ;
+ Equal = equal_A2 ;
+ Greater = greater_A2 ;
+ Smaller = smaller_A2 ;
+ Divisible = divisible_A2 ;
- Sum pns = mkNP defSgDet (mkCN sum_N2 (mkNP and_Conj pns)) ;
---- Product = prefixSS ["the product of"] ;
+ Sum = prefix sum_N2 ;
+ Product = prefix product_N2 ;
--- GCD = prefixSS ["the greatest common divisor of"] ;
---- WhatIs = prefixSS ["what is"] ;
---- WhichAre cn ap = ss ("which" ++ cn.s ++ "is" ++ ap.s) ; ---- are
- QuestS s = mkPhr (mkQCl s) ;
+ WhatIs np = mkPhr (mkQS (mkQCl whatSg_IP (mkVP np))) ;
+ WhichAre cn ap = mkPhr (mkQS (mkQCl (mkIP whichPl_IDet cn) (mkVP ap))) ;
+ QuestS s = mkPhr (mkQS (mkQCl s)) ;
Yes = yes_Phr ;
No = no_Phr ;
Value np = mkPhr (mkUtt np) ;
- Many list = list ;
+ Many list = mkNP and_Conj list ;
BasePN = G.BaseNP ;
ConsPN = G.ConsNP ;
+
+oper
+ prefix : G.N2 -> G.ListNP -> G.NP = \n2,nps ->
+ mkNP defSgDet (mkCN n2 (mkNP and_Conj nps)) ;
}