about summary refs log tree commit diff
path: root/tests/examples/nums-minus-three-two.lam
blob: e2fe489bbdb1eca10916d34d282178692ace3075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(\ zero one two three succ plus mult pred minus isZero .

    minus three two
    -- Should evaluate to one, i.e., \ f x . f 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))