projekty
/
fp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
494e6af
)
remove unnecessary brackets
author
Tomas Musil
<tomik.musil@gmail.com>
Wed, 3 Dec 2014 15:21:10 +0000
(16:21 +0100)
committer
Tomas Musil
<tomik.musil@gmail.com>
Wed, 3 Dec 2014 15:21:10 +0000
(16:21 +0100)
Arithmetic.lc
patch
|
blob
|
history
Logic.lc
patch
|
blob
|
history
diff --git
a/Arithmetic.lc
b/Arithmetic.lc
index
6851970
..
f3cd19a
100644
(file)
--- a/
Arithmetic.lc
+++ b/
Arithmetic.lc
@@
-1,13
+1,13
@@
import Logic
import Logic
-Succ=\n f x.
(f ((n f) x)
)
+Succ=\n f x.
f (n f x
)
Zero=\f x.x
Zero=\f x.x
-One=
(Succ Zero)
-Two=
(Succ One)
-Three=
(Succ Two)
-Add=\n m f x.
((n f) ((m f) x)
)
-Mult=\n m f.
(n (m f)
)
-IsZero=\n x y.
((n \z.y) x)
-((Add Two) Three)
-((Mult Two) Three)
-
(PrintBool (IsZero Zero)
)
-
(PrintBool (IsZero ((Add One) Two)
))
+One=
Succ Zero
+Two=
Succ One
+Three=
Succ Two
+Add=\n m f x.
n f (m f x
)
+Mult=\n m f.
n (m f
)
+IsZero=\n x y.
n (\z.y) x
+Add Two Three
+Mult Two Three
+
PrintBool (IsZero Zero
)
+
PrintBool (IsZero (Add One Two
))
diff --git
a/Logic.lc
b/Logic.lc
index
8193a34
..
7ed9ed5
100644
(file)
--- a/
Logic.lc
+++ b/
Logic.lc
@@
-1,5
+1,5
@@
True=\x y.x
False=\x y.y
True=\x y.x
False=\x y.y
-And=\a b.
((a b) False)
+And=\a b.
a b False
If=\x.x
If=\x.x
-PrintBool=\x.
(((If x) TRUE) FALSE)
+PrintBool=\x.
If x TRUE FALSE