syntax interfaces

This commit is contained in:
aarne
2007-05-31 18:46:29 +00:00
parent 21f2d8a96f
commit b24ecdfcba
9 changed files with 44 additions and 28 deletions

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
interface Syntax = Constructors, Cat, Structural ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxEng of Syntax = ConstructorsEng, CatEng, StructuralEng ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFin of Syntax = ConstructorsFin, CatFin, StructuralFin ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFre of Syntax = ConstructorsFre, CatFre, StructuralFre ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxGer of Syntax = ConstructorsGer, CatGer, StructuralGer ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxSwe of Syntax = ConstructorsSwe, CatSwe, StructuralSwe ** {} ;

View File

@@ -127,10 +127,6 @@ oper
nounPN : N -> PN ; nounPN : N -> PN ;
-- To form a noun phrase that can also be plural and have an irregular
-- genitive, you can use the worst-case function.
mkNP : Str -> Str -> Number -> Gender -> NP ;
--2 Adjectives --2 Adjectives
@@ -271,12 +267,12 @@ oper
mkAV : A -> AV ; mkAV : A -> AV ;
mkA2V : A -> Prep -> A2V ; mkA2V : A -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated -- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given -- just as synonyms of $V2$, and the second argument is given
-- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$. -- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$.
-- $V0$ is just $V$. -- $V0$ is just $V$.
V0, V2S, V2V, V2A, V2Q : Type ; V0, V2S, V2V, V2Q : Type ;
AS, A2S, AV, A2V : Type ; AS, A2S, AV, A2V : Type ;
--. --.
@@ -354,8 +350,6 @@ oper
regPN n = regGenPN n human ; regPN n = regGenPN n human ;
regGenPN n g = nameReg n g ** {lock_PN = <>} ; regGenPN n g = nameReg n g ** {lock_PN = <>} ;
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ; nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ;
lock_NP = <>} ;
mk2A a b = mkAdjective a a a b ** {lock_A = <>} ; mk2A a b = mkAdjective a a a b ** {lock_A = <>} ;
regA a = regAdjective a ** {lock_A = <>} ; regA a = regAdjective a ** {lock_A = <>} ;
@@ -462,7 +456,7 @@ oper
mkVQ v = v ** {lock_VQ = <>} ; mkVQ v = v ** {lock_VQ = <>} ;
V0 : Type = V ; V0 : Type = V ;
V2S, V2V, V2Q, V2A : Type = V2 ; V2S, V2V, V2Q : Type = V2 ;
AS, A2S, AV : Type = A ; AS, A2S, AV : Type = A ;
A2V : Type = A2 ; A2V : Type = A2 ;

View File

@@ -49,13 +49,11 @@ rebuildModule ms mo@(i,mi) = do
--- to avoid double inclusions, in instance I of I0 = J0 ** ... --- to avoid double inclusions, in instance I of I0 = J0 ** ...
case extends m of case extends m of
[] -> return $ replaceJudgements m js' [] -> return $ replaceJudgements m js'
j0:jj -> do j0s -> do
m0 <- lookupModMod gr j0 m0s <- mapM (lookupModMod gr) j0s
let notInM0 c _ = not $ isInBinTree c $ jments m0 let notInM0 c _ = all (not . isInBinTree c . jments) m0s
let js2 = filterBinTree notInM0 js' let js2 = filterBinTree notInM0 js'
if null jj return $ replaceJudgements m js2
then return $ replaceJudgements m js2
else Bad "FIXME: handle multiple inheritance in instance"
return $ ModMod m' return $ ModMod m'
_ -> return mi _ -> return mi