1
0
forked from GitHub/gf-core

fix in example/tutorial/smart/SmartFre.gf to make the dependent types work nicely

This commit is contained in:
krasimir
2010-07-07 10:12:08 +00:00
parent 2cd3523d04
commit c066721dd1
2 changed files with 21 additions and 15 deletions

View File

@@ -18,6 +18,9 @@ lincat
Action = {s : VForm => Str ; part : Str} ;
Device = {s : Str ; n : Number} ;
Location = SS ;
Switchable = SS ;
Dimmable = SS ;
Statelike = SS ;
lin
UCommand c = c ;
@@ -42,10 +45,10 @@ lin
light = mkNoun "light" ;
fan = mkNoun "fan" ;
switchOn _ _ = mkVerb "switch" "swithced" "on" ;
switchOff _ _ = mkVerb "switch" "swithced" "off" ;
switchOn _ proof = mkVerb proof.s "switch" "switched" "on" ;
switchOff _ proof = mkVerb proof.s "switch" "switched" "off" ;
dim _ _ = mkVerb "dim" "dimmed" [] ;
dim _ proof = mkVerb proof.s "dim" "dimmed" [] ;
kitchen = ss "kitchen" ;
livingRoom = ss ["living room"] ;
@@ -58,10 +61,10 @@ oper
}
} ;
mkVerb : (_,_,_ : Str) -> {s : VForm => Str ; part : Str} = \go,gone,away -> {
mkVerb : (_,_,_,_ : Str) -> {s : VForm => Str ; part : Str} = \proof,go,gone,away -> {
s = table {
VImp => go ;
VPart => gone
VImp => proof++go ;
VPart => proof++gone
} ;
part = away
} ;

View File

@@ -19,6 +19,9 @@ lincat
Action = {s : VForm => Str} ;
Device = {s : Str ; g : Gender ; n : Number} ;
Location = {s : Number => Str ; g : Gender} ;
Switchable = SS ;
Dimmable = SS ;
Statelike = SS ;
lin
UCommand c = c ;
@@ -47,10 +50,10 @@ lin
light = mkNoun "lampe" Fem ;
fan = mkNoun "ventilateur" Masc ;
switchOn _ _ = mkVerb "allumer" "allumé" ;
switchOff _ _ = mkVerb "éteindre" "éteint" ;
switchOn _ proof = mkVerb proof.s "allumer" "allumé" ;
switchOff _ proof = mkVerb proof.s "éteindre" "éteint" ;
dim _ _ = mkVerb "baisser" "baissé" ;
dim _ proof = mkVerb proof.s "baisser" "baissé" ;
kitchen = mkNoun "cuisine" Fem ;
livingRoom = mkNoun "salon" Masc ;
@@ -64,13 +67,13 @@ oper
g = g
} ;
mkVerb : (_,_ : Str) -> {s : VForm => Str} = \venir,venu -> {
mkVerb : (_,_,_ : Str) -> {s : VForm => Str} = \proof,venir,venu -> {
s = table {
VInf => venir ;
VPart Masc Sg => venu ;
VPart Masc Pl => venu + "s" ;
VPart Fem Sg => venu + "e" ;
VPart Fem Pl => venu + "es"
VInf => proof++venir ;
VPart Masc Sg => proof++venu ;
VPart Masc Pl => proof++venu + "s" ;
VPart Fem Sg => proof++venu + "e" ;
VPart Fem Pl => proof++venu + "es"
}
} ;