Assignment 3



Due on Oct 9 before lecture.

Please bring a hardcopy of your solutions to lecture. Or submit a hardcopy of your solutions to Paul Darga before lecture.


Problem 1

Recall Church numerals from Chapter 5 of the Pierce book. They use unary representation for natural numbers. Suppose we want to use binary representation instead. One way to encode natural numbers is as follows: Intuitively, a natural number n is a function that takes three parameters, i as the bit 1, o as the bit 0, and t as the sequence terminator, and returns the sequence of applications representing the binary encoding of n.


Problem 1a (4 Points)

Write a combinator double n that multiplies a natural number n by 2. (A combinator is a lambda term without free variables.)


Problem 1b (4 Points)

Recall the definition of Church booleans from Chapter 5 of the Pierce book: Write a combinator iszero n that returns the Church boolean true if n is zero, and returns the Church boolean false otherwise.


[Mail] [bchandra at umich dot edu]