-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstd.lam
More file actions
33 lines (27 loc) · 709 Bytes
/
std.lam
File metadata and controls
33 lines (27 loc) · 709 Bytes
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
28
29
30
31
32
33
Id = \x.x
True = \x.\y.x
False = \x.\y.y
And = \x.\y.x y False
Or = \x.\y.x True y
Not = \x.x False True
Zero = \f.\x.x
One = \f.\x.f x
Two = \f.\x.f (f x)
Three = \f.\x.f (f (f x))
Four = \f.\x.f (f (f (f x)))
Five = \f.\x.f (f (f (f (f x))))
Six = \f.\x.f (f (f (f (f (f x)))))
Seven = \f.\x.f (f (f (f (f (f (f x))))))
Eight = \f.\x.f (f (f (f (f (f (f (f x)))))))
Nine = \f.\x.f (f (f (f (f (f (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)
Pow = \m.\n.n m
Pred = \n.\f.\x.n (\g.\h.h (g f)) (\u.x) (\u.u)
IsZero = \n.n (\_.False) True
Pair = \x.\y.\f.f x y
First = \p.p True
Second = \p.p False
Nil = \x.True
Null = \p.p (\x.\y.False)