X-Git-Url: http://git.tomasm.cz/fp.git/blobdiff_plain/e0da0730ff4b328909789806b1d65b89eeb3b84b..7b1d09697fa612b0ccdf30062dce7c6f0d5f4eeb:/Arithmetic.lc diff --git a/Arithmetic.lc b/Arithmetic.lc index 5a30a17..f3cd19a 100644 --- a/Arithmetic.lc +++ b/Arithmetic.lc @@ -1,13 +1,13 @@ import Logic -Succ=\n.\f.\x.(f ((n 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))) +Succ=\n f x.f (n 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))