summaryrefslogtreecommitdiff
path: root/examples/attempto
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-11-15 20:08:09 +0000
committeraarne <aarne@cs.chalmers.se>2008-11-15 20:08:09 +0000
commitf30560efcc5acb39f8b9a4a5d0ea0482224a5fc1 (patch)
tree91f1e3b2a3044ee3531dcf4a799db427681c81b4 /examples/attempto
parent373b4d6828e0eba56e11cd5851591d303f369b43 (diff)
Attempto complete up to spec
Diffstat (limited to 'examples/attempto')
-rw-r--r--examples/attempto/Attempto.gf6
-rw-r--r--examples/attempto/AttemptoI.gf11
-rw-r--r--examples/attempto/LexAttempto.gf1
-rw-r--r--examples/attempto/LexAttemptoEng.gf1
-rw-r--r--examples/attempto/LexAttemptoFre.gf1
-rw-r--r--examples/attempto/LexAttemptoGer.gf1
-rw-r--r--examples/attempto/LexAttemptoSwe.gf1
-rw-r--r--examples/attempto/Symbols.gf17
-rw-r--r--examples/attempto/SymbolsC.gf19
9 files changed, 47 insertions, 11 deletions
diff --git a/examples/attempto/Attempto.gf b/examples/attempto/Attempto.gf
index 744652775..e8e0f46b9 100644
--- a/examples/attempto/Attempto.gf
+++ b/examples/attempto/Attempto.gf
@@ -62,7 +62,6 @@ fun ten_Card : Card ;
fun pnNP : PN -> NP ;
fun intNP : Int -> NP ;
-fun intNegNP : Int -> NP ;
fun floatNP : Float -> NP ;
@@ -112,7 +111,7 @@ fun unit_ofNP : Card -> Unit -> CN -> NP ; -- 3 kg of apples
fun unit_ofMassNP : Card -> Unit -> MCN -> NP ; -- 3 l of water
fun apposVarCN : CN -> Var -> CN ; -- a man X
-fun varNP : Var -> NP ;
+fun termNP : Term -> NP ;
fun conjNP : NP -> NP -> NP ;
@@ -189,7 +188,8 @@ fun modVP : VP -> Adv -> VP ;
fun thereNP : NP -> S ; -- there is/are
-- 3.3
--- Boolean formulas = \= < > <= >=
+
+fun formulaS : Formula -> S ;
-- 3.4.1
diff --git a/examples/attempto/AttemptoI.gf b/examples/attempto/AttemptoI.gf
index 1dbdc448d..bad6dd342 100644
--- a/examples/attempto/AttemptoI.gf
+++ b/examples/attempto/AttemptoI.gf
@@ -1,6 +1,7 @@
incomplete concrete AttemptoI of Attempto = SymbolsC ** open
Syntax,
Symbolic,
+ Prelude,
LexAttempto
in {
@@ -64,7 +65,6 @@ lin ten_Card = mkCard n10_Numeral ;
lin pnNP = mkNP ;
lin intNP = symb ;
lin floatNP = symb ;
---lin intNegNP : Int -> NP ;
lin it_NP = mkNP it_Pron ;
lin he_NP = mkNP he_Pron ;
@@ -105,7 +105,7 @@ lin unit_ofMassNP ca u cn = mkNP (mkNP ca u) (mkAdv part_Prep (mkNP cn)) ;
lin apposVarCN cn v = mkCN cn (symb v) ;
-lin varNP x = symb x ;
+lin termNP x = symb (ss x.s) ;
-- 2.2.1
@@ -186,8 +186,8 @@ lin thereNP np = mkS (mkCl np) ;
-- 3.3
--- Boolean formulas = \= < > <= >=
+lin formulaS f = symb (ss f.s) ;
-- 3.4.1
@@ -233,9 +233,8 @@ lin when_IAdv = Syntax.when_IAdv ;
lin whoSg_IP = Syntax.whoSg_IP ;
lin whoPl_IP = Syntax.whoPl_IP ;
-
---lin there_ipQS : IP -> QS ; -- there is who
---lin whoseIP : CN -> IP ; -- whose dog
+lin there_ipQS ip = mkQS (mkQCl ip) ; ---- who is there, not there is who
+lin whoseIP = mkIP whose_IDet ;
-- 3.6
diff --git a/examples/attempto/LexAttempto.gf b/examples/attempto/LexAttempto.gf
index 7bfa593d3..3d18d3ca4 100644
--- a/examples/attempto/LexAttempto.gf
+++ b/examples/attempto/LexAttempto.gf
@@ -22,4 +22,5 @@ oper
comma_and_Conj : Conj ;
comma_or_Conj : Conj ;
+ whose_IDet : IDet ;
}
diff --git a/examples/attempto/LexAttemptoEng.gf b/examples/attempto/LexAttemptoEng.gf
index 395e00c35..ad54d6de9 100644
--- a/examples/attempto/LexAttemptoEng.gf
+++ b/examples/attempto/LexAttemptoEng.gf
@@ -29,5 +29,6 @@ oper
comma_or_Conj = M.mkConj [] ", or" singular ;
slash_Conj = M.mkConj [] "/" singular ;
+ whose_IDet = M.mkIDet "whose" singular ;
}
diff --git a/examples/attempto/LexAttemptoFre.gf b/examples/attempto/LexAttemptoFre.gf
index 91cd2eadf..b6f983c24 100644
--- a/examples/attempto/LexAttemptoFre.gf
+++ b/examples/attempto/LexAttemptoFre.gf
@@ -23,5 +23,6 @@ oper
comma_or_Conj = mkConj [] ", ou" singular ;
slash_Conj = mkConj [] "/" singular ;
+ whose_IDet = mkIDet (mkIQuant "de qui") ; ----
}
diff --git a/examples/attempto/LexAttemptoGer.gf b/examples/attempto/LexAttemptoGer.gf
index 38bc4935d..05a4e59ff 100644
--- a/examples/attempto/LexAttemptoGer.gf
+++ b/examples/attempto/LexAttemptoGer.gf
@@ -23,5 +23,6 @@ oper
comma_or_Conj = mkConj [] ", oder" singular ;
slash_Conj = mkConj [] "/" singular ;
+ whose_IDet = mkIDet (mkIQuant "wessen") ;
}
diff --git a/examples/attempto/LexAttemptoSwe.gf b/examples/attempto/LexAttemptoSwe.gf
index 31d145f19..c95ce035e 100644
--- a/examples/attempto/LexAttemptoSwe.gf
+++ b/examples/attempto/LexAttemptoSwe.gf
@@ -21,6 +21,7 @@ oper
comma_and_Conj = mkConj [] ", och" plural ;
comma_or_Conj = mkConj [] ", eller" singular ;
slash_Conj = mkConj [] "/" singular ;
+ whose_IDet = mkIDet (mkIQuant "vems" "vems" "vems" dDefIndef) ;
}
diff --git a/examples/attempto/Symbols.gf b/examples/attempto/Symbols.gf
index 3744ecd4a..3f92d3b21 100644
--- a/examples/attempto/Symbols.gf
+++ b/examples/attempto/Symbols.gf
@@ -1,6 +1,21 @@
abstract Symbols = {
-cat Var ;
+cat Var ; Formula ; Term ;
+
+fun plus_Term : Term -> Term -> Term ;
+fun minus_Term : Term -> Term -> Term ;
+fun div_Term : Term -> Term -> Term ;
+fun times_Term : Term -> Term -> Term ;
+fun neg_Term : Term -> Term ;
+fun int_Term : Int -> Term ;
+fun var_Term : Var -> Term ;
+
+fun eq_Formula : Term -> Term -> Formula ;
+fun lt_Formula : Term -> Term -> Formula ;
+fun gt_Formula : Term -> Term -> Formula ;
+fun le_Formula : Term -> Term -> Formula ;
+fun ge_Formula : Term -> Term -> Formula ;
+fun ne_Formula : Term -> Term -> Formula ;
fun X_Var : Var ;
fun Y_Var : Var ;
diff --git a/examples/attempto/SymbolsC.gf b/examples/attempto/SymbolsC.gf
index 9949912ca..b92885bb9 100644
--- a/examples/attempto/SymbolsC.gf
+++ b/examples/attempto/SymbolsC.gf
@@ -1,7 +1,24 @@
-concrete SymbolsC of Symbols = open Prelude in {
+concrete SymbolsC of Symbols = open Precedence, Prelude in {
+lincat Term = TermWithPrec ;
+lincat Formula = SS ;
lincat Var = SS ;
+lin plus_Term = mkpInfixL "+" p1 ;
+lin minus_Term = mkpInfixL "-" p1 ;
+lin div_Term = mkpInfixL "/" p2 ;
+lin times_Term = mkpInfixL "*" p2 ;
+lin neg_Term = mkpFun1 "-" ;
+lin int_Term i = mkpConst i.s ;
+lin var_Term i = mkpConst i.s ;
+
+lin eq_Formula = infixSS "=" ;
+lin lt_Formula = infixSS "<" ;
+lin gt_Formula = infixSS ">" ;
+lin le_Formula = infixSS "=<" ;
+lin ge_Formula = infixSS ">=" ;
+lin ne_Formula = infixSS "\\=" ;
+
lin X_Var = ss "X" ;
lin Y_Var = ss "Y" ;