projekty
/
fp.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
multiple applications
[fp.git]
/
Arithmetic.lc
1
import Logic
2
Succ=\n f x.(f ((n f) x))
3
Zero=\f x.x
4
One=(Succ Zero)
5
Two=(Succ One)
6
Three=(Succ Two)
7
Add=\n m f x.((n f) ((m f) x))
8
Mult=\n m f.(n (m f))
9
IsZero=\n x y.((n \z.y) x)
10
((Add Two) Three)
11
((Mult Two) Three)
12
(PrintBool (IsZero Zero))
13
(PrintBool (IsZero ((Add One) Two)))