3 ms·
The only problem then is, how do you do pred the inverse of succ? ;)
by jules 16y ago
The only problem then is, how do you do pred the inverse of succ? ;)
- mathgladiator 16y agoThe same way you build the integers. Built it out of pairs. a --> (a,0) -a --> (0,a) succ((a,0)) = (a+1,0) pred((a,0)) = (a,0+1)
- mathgladiator 16y agovia something like: http://news.ycombinator.com/item?id=2030649 http://news.ycombinator.com/item?id=2030649
- freyrs3 16y agoYou need to construct integers with a tuple type, in lambda calculus its: pair = λ x. λ y. λ z. x. y. z Or if you are willing to let pred(0) = 0 then you can use: pred = λ x. λy. λ z. x . (λ i. λ j. j. i. y (λ k. z) (λ k. k)