mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
added testcase for linearization with HOAS
This commit is contained in:
9
testsuite/runtime/linearize/Test.gf
Normal file
9
testsuite/runtime/linearize/Test.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
abstract Test = {
|
||||
|
||||
cat P ;
|
||||
cat E ;
|
||||
|
||||
fun Exist : (E -> P) -> P ;
|
||||
Even : E -> P ;
|
||||
|
||||
}
|
||||
7
testsuite/runtime/linearize/TestCnc.gf
Normal file
7
testsuite/runtime/linearize/TestCnc.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
concrete TestCnc of Test = {
|
||||
|
||||
lincat E,P = {s:Str} ;
|
||||
|
||||
lin Exist f = {s = "exists" ++ f.$0 ++ "such that" ++ f.s};
|
||||
lin Even x = {s = x.s ++ "is even"};
|
||||
}
|
||||
3
testsuite/runtime/linearize/linearize.gfs
Normal file
3
testsuite/runtime/linearize/linearize.gfs
Normal file
@@ -0,0 +1,3 @@
|
||||
i testsuite/runtime/linearize/TestCnc.gf
|
||||
|
||||
l Exist (\x -> Even x)
|
||||
3
testsuite/runtime/linearize/linearize.gfs.gold
Normal file
3
testsuite/runtime/linearize/linearize.gfs.gold
Normal file
@@ -0,0 +1,3 @@
|
||||
exists x such that x is even
|
||||
|
||||
|
||||
Reference in New Issue
Block a user