diff options
| author | krasimir <krasimir@chalmers.se> | 2010-02-07 22:22:30 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-02-07 22:22:30 +0000 |
| commit | a1c70841c1b18e8dec1826478c670891d14f413d (patch) | |
| tree | 215845a161a0e664ea53768e677fa04fe5071b17 /testsuite | |
| parent | f0f9c0acfa193969bce80d803478fe8b46e03386 (diff) | |
test case for lazy evaluation in the abstract syntax
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/runtime/eval/lazy.gf | 15 | ||||
| -rw-r--r-- | testsuite/runtime/eval/lazy.gfs | 2 | ||||
| -rw-r--r-- | testsuite/runtime/eval/lazy.gfs.gold | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/runtime/eval/lazy.gf b/testsuite/runtime/eval/lazy.gf new file mode 100644 index 000000000..51e230b3c --- /dev/null +++ b/testsuite/runtime/eval/lazy.gf @@ -0,0 +1,15 @@ +abstract lazy = { + +cat Nat ; +data zero : Nat ; + succ : Nat -> Nat ; + +fun infinity : Nat ; +def infinity = succ infinity ; + +fun min : Nat -> Nat -> Nat ; +def min zero _ = zero ; + min _ zero = zero ; + min (succ x) (succ y) = succ (min x y) ; + +}
\ No newline at end of file diff --git a/testsuite/runtime/eval/lazy.gfs b/testsuite/runtime/eval/lazy.gfs new file mode 100644 index 000000000..b05e3a4b0 --- /dev/null +++ b/testsuite/runtime/eval/lazy.gfs @@ -0,0 +1,2 @@ +i -src testsuite/runtime/eval/lazy.gf +pt -compute min infinity (succ (succ (succ zero)))
\ No newline at end of file diff --git a/testsuite/runtime/eval/lazy.gfs.gold b/testsuite/runtime/eval/lazy.gfs.gold new file mode 100644 index 000000000..6b97546b4 --- /dev/null +++ b/testsuite/runtime/eval/lazy.gfs.gold @@ -0,0 +1,2 @@ +succ (succ (succ zero))
+
|
