This is a continuation of my previous post.
In order for -Calculus to be useful, we have to be able to encode data. In our previous post we used integers and booleans without any explanation as to how they may be encoded. This picks up and fills out those details.
Booleans
It is useful to encode boolean values as functions that take 2 parameters and then evalute the correct argument.
Assuming we have a boolean we can encode an if-then-else function as
where
is the result if
and
is the result if
ie..
Church Numerals
…
And now to show the basic operations on numerals
Increment
Example :
Decrement
Example:
Addition
Example:
We can show that
Multiplication
Example: