Question: Just as numbers can be represented in Church encoding, so too can booleans. truefalse=a.b.a=a.b.b We can see that the boolean values take two parameters and

Just as numbers can be represented in Church encoding, so too can booleans. truefalse=a.b.a=a.b.b We can see that the boolean values take two parameters and simply return one of them, ignoring the other. Think of this like an if/else branch. Furthermore, we can define useful operations on booleans: not=pabpbaif=pabpab You can see that not simply reverses the order of the arguments to its argument, while if does not. Write a function even in lambda calculus that will return true when its argument is an even Church numeral, and false otherwise. Your solution may use only n,Z, true, false, not, if, and parentheses. Your solution must not be recursive. Complete the template: even=n. When writing your answer, you can use the backslash character ( ) instead of the symbol. Hint: keep in mind that Church booleans are function, and can be used as such. Hint: Consider that even Z= true and that even S(n)=not( even n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
