mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 09:02:50 -06:00
additional tests for linearizations
This commit is contained in:
@@ -1,9 +1,16 @@
|
|||||||
abstract Test = {
|
abstract Test = {
|
||||||
|
|
||||||
cat P ;
|
cat S ;
|
||||||
cat E ;
|
cat E ;
|
||||||
|
|
||||||
fun Exist : (E -> P) -> P ;
|
fun Exist : (E -> S) -> S ;
|
||||||
Even : E -> P ;
|
Even : E -> S ;
|
||||||
|
|
||||||
|
fun a : E ;
|
||||||
|
f,fa,fb : E -> S ;
|
||||||
|
|
||||||
|
fun IsString : String -> S ;
|
||||||
|
IsInteger : Int -> S ;
|
||||||
|
IsFloat : Float -> S ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,9 +4,18 @@ param Number = Pl | Sg;
|
|||||||
lincat E = {s:Str; n : Number} ;
|
lincat E = {s:Str; n : Number} ;
|
||||||
lindef E = \s -> {s=s; n=Sg} ;
|
lindef E = \s -> {s=s; n=Sg} ;
|
||||||
|
|
||||||
lincat P = {s:Str} ;
|
lincat S = {s:Str} ;
|
||||||
|
|
||||||
lin Exist f = {s = "exists" ++ f.$0 ++ "such that" ++ f.s};
|
lin Exist f = {s = "exists" ++ f.$0 ++ "such that" ++ f.s};
|
||||||
lin Even x = {s = x.s ++ case x.n of {Sg => "is"; Pl => "are"} ++ "even"};
|
lin Even x = {s = x.s ++ case x.n of {Sg => "is"; Pl => "are"} ++ "even"};
|
||||||
|
|
||||||
|
lin a = {s = pre {"a"; "aa" / strs {"a"}}; n = Pl} ;
|
||||||
|
lin f a = {s = a.s};
|
||||||
|
lin fa a = {s = a.s ++ "a"};
|
||||||
|
lin fb a = {s = a.s ++ "b"};
|
||||||
|
|
||||||
|
lin IsString x = {s = x.s ++ "is string"} ;
|
||||||
|
lin IsInteger x = {s = x.s ++ "is integer"} ;
|
||||||
|
lin IsFloat x = {s = x.s ++ "is float"} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
i -src testsuite/runtime/linearize/TestCnc.gf
|
i -src testsuite/runtime/linearize/TestCnc.gf
|
||||||
|
|
||||||
l Exist (\x -> Even x)
|
l Even ?
|
||||||
|
l Exist (\x -> <Even : E -> S> x)
|
||||||
|
l f a
|
||||||
|
l fa a
|
||||||
|
l fb a
|
||||||
|
l IsString "abcd"
|
||||||
|
l IsInteger 100
|
||||||
|
l IsFloat 12.4
|
||||||
|
l <IsString "xyz" : S>
|
||||||
|
l <\x -> x : S -> S>
|
||||||
@@ -1,3 +1,30 @@
|
|||||||
|
?1 is even
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
exists x such that x is even
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
a
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
aa a
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
a b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user