diff options
author | tzlil <tzlils@protonmail.com> | 2023-04-14 23:46:53 +0300 |
---|---|---|
committer | tzlil <tzlils@protonmail.com> | 2023-04-14 23:46:53 +0300 |
commit | fdf35536b66499884dd5b4e1740ac67e5cebb1a2 (patch) | |
tree | b907edf782ebb58780d7fbfed084560626b94c74 /tests/examples/nums-pred-one.lam |
add homework material
Diffstat (limited to 'tests/examples/nums-pred-one.lam')
-rw-r--r-- | tests/examples/nums-pred-one.lam | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/examples/nums-pred-one.lam b/tests/examples/nums-pred-one.lam new file mode 100644 index 0000000..413046d --- /dev/null +++ b/tests/examples/nums-pred-one.lam @@ -0,0 +1,27 @@ +(\ zero one two three succ plus mult pred minus isZero . + + pred one + -- Should evaluate to zero, i.e., \ f x . x +) + +-- zero +(\ f x . x) +-- one +(\ f x . f x) +-- two +(\ f x . f (f x)) +-- three +(\ f x . f (f (f x))) + +-- succ +(\n f x . f (n f x)) +-- plus +(\m n f x . m f (n f x)) +-- mult +(\m n f . m (n f)) +-- pred +(\n f x . n (\ g h . h (g f)) (\ u . x) (\ u . u)) +-- minus +(\ m n . n (\n f x . n (\ g h . h (g f)) (\ u . x) (\ u . u)) m) +-- isZero +(\ n . n (\ x . (\ x y . y)) (\ x y . x)) |