X-Git-Url: http://git.tomasm.cz/fp.git/blobdiff_plain/2df2a815f76afa2daee4c7c5494e15795876003e..0d7d9b4184cd881452d854cc571595f518fb1afe:/Arithmetic.lc diff --git a/Arithmetic.lc b/Arithmetic.lc index 115a869..f3cd19a 100644 --- a/Arithmetic.lc +++ b/Arithmetic.lc @@ -1,4 +1,13 @@ -Nula=\f.\x.x -Succ=\n.\f.\x.(f ((n f) x)) -\f.\x.(f x) -(\n.\f.\x.(f ((n f) x)) \f.\x.(f x)) +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))