Fall 2001, CSE 520: Assignment 1
Distributed: Published on the web on Sep 7.
Due: Sep 18 (in class).
Total maximum score: 100 points.
The purpose of this assignment is to provide experience
with Lambda Calculus, lambda conversion, and definability of functions
in Lambda Calculus.
Please write your solutions as clearly and concisely as possible.
- (30 pts)
For each of the following pairs of lambda terms,
say whether they are lambda convertible or not.
In the positive case, please indicate which rules
have to be applied for the conversion
(alpha, beta, symmetry, transitivity, congruence 1 and 2, xi).
- \x.xy and \x.xz
- \x.xy and \y.yy
- \x.xy and \z.zy
- (\x.xy)(\z.z) and y
- (\x.xy)(\z.z)y and yy
- (\xz.x)(\w.w)y and \z.y
- (\xz.x)(\w.w)y and \w.w
- (\xz.x^{2}z)(\y.y) and \z.z
- (\xz.x^{2}z)(\y.y) and (\w.w)(\z.z)
- (\xz.x^{2}z)(\y.y) and (\zw.zw)
- (9 pts)
Consider the following definitions:
- S = \xyz.xz(yz)
- K = \xy.x
- B = \xyz.x(yz)
- I = \x.x
Prove that:
- SKK and I are lambda convertible.
- S(KS)K and B
are lambda convertible.
- S(KI) and BI
are lambda convertible.
- (20 pts)
Prove that, if we added the axiom \xy.xy = \xy.yx
to the theory of lambda convertibility,
then all terms would become equal (i.e. lambda convertible).
- (15 pts)
Consider the function exp(m,n) = n^{m}.
Prove that this function is Recursive by showing
that it can be obtained from the Initial functions
by using composition, primitive recursion, and
minimalization. You can use the functions already
defined in class and/or in the lecture notes.
For every new definition, give the details of
the construction (for instance, if you use primitive
recursion, say what exactly are the functions g and h).
- (26 pts)
Define in lambda calculus the function rem2 : N -> N,
which returns 0 if the argument is even, and 1 if the argument is odd
(for instance, rem2(0) = 0, rem2(1) = 1, rem2(2) = 0, rem2(3) = 1,
etc.).
Namely, construct the lambda-term [rem2].
You can use the functions already defined
in class and/or in the lecture notes.