summaryrefslogtreecommitdiff
path: root/examples/tutorial/semantics/AnswerBase.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-21 10:45:51 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-21 10:45:51 +0000
commit3b878f85d85f1fa7f7ff724dfa161d7ac2b619b8 (patch)
treef3bdc6ac612772df0c7d17b485b20b90e1d251eb /examples/tutorial/semantics/AnswerBase.hs
parent087fddc1746e585bf4f7055e67c0f396ec58ebde (diff)
Swedish functor implementation of Base
Diffstat (limited to 'examples/tutorial/semantics/AnswerBase.hs')
-rw-r--r--examples/tutorial/semantics/AnswerBase.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/tutorial/semantics/AnswerBase.hs b/examples/tutorial/semantics/AnswerBase.hs
index 28c73a384..56e2b5451 100644
--- a/examples/tutorial/semantics/AnswerBase.hs
+++ b/examples/tutorial/semantics/AnswerBase.hs
@@ -11,13 +11,12 @@ domain = [0 .. 100]
iS :: GS -> Prop
iS s = case s of
GPredAP np ap -> iNP np (iAP ap)
- GConjS c s t -> iConj c (iS s) (iS t)
iNP :: GNP -> (Ent -> Prop) -> Prop
iNP np p = case np of
GEvery cn -> all (\x -> not (iCN cn x) || p x) domain
GSome cn -> any (\x -> iCN cn x && p x) domain
- GNone cn -> not (any (\x -> iCN cn x && p x) domain)
+ GNone -> not (any (\x -> p x) domain)
GMany pns -> and (map p (iListPN pns))
GConjNP c np1 np2 -> iConj c (iNP np1 p) (iNP np2 p)
GUsePN a -> p (iPN a)
@@ -74,7 +73,7 @@ question2answer :: GQuestion -> GAnswer
question2answer q = case iQuestion q of
Left True -> GYes
Left False -> GNo
- Right [] -> GValue (GNone GNumber)
+ Right [] -> GValue GNone
Right [v] -> GValue (GUsePN (ent2pn v))
Right vs -> GValue (GMany (GListPN (map ent2pn vs)))