definitions, imports, logic
[fp.git] / Arithmetic.lc
index 115a869..5a30a17 100644 (file)
@@ -1,4 +1,13 @@
-Nula=\f.\x.x
+import Logic
 Succ=\n.\f.\x.(f ((n f) x))
 Succ=\n.\f.\x.(f ((n f) x))
-\f.\x.(f x)
-(\n.\f.\x.(f ((n f) x)) \f.\x.(f 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)))