X-Git-Url: http://git.tomasm.cz/fp.git/blobdiff_plain/2df2a815f76afa2daee4c7c5494e15795876003e..e0da0730ff4b328909789806b1d65b89eeb3b84b:/Arithmetic.lc?ds=inline diff --git a/Arithmetic.lc b/Arithmetic.lc index 115a869..5a30a17 100644 --- a/Arithmetic.lc +++ b/Arithmetic.lc @@ -1,4 +1,13 @@ -Nula=\f.\x.x +import Logic 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)))