
CMSC 631, Spring 2009
Homework 5 Sample Solution (partial)
1. (a) (λx.x(xy))(λu.u)→(λu.u)((λu.u)y)→((λu.u)y)→y
(b) (λxyz.z yx)aa(λpq.q)→(λpq.q)aa →a
(c) (λxyz.xz (yz))(λxy .x)(λxy.x)→λz.(λxy.x)z((λxy.x)z)→λz.z
2. (a) λxy.y
(b) λxyz.xz y
(c) No term has the type α→β
(d) λxy.(λf wz.((λv .fw)(f z)))(λu.u)xy
3. No, the simply typed lambda calculus with integers does not have the subject expansion property.
For example, the term 3 has a valid type, but the term (λxy.x)3(λz.∆ ∆) →∗3 yet it does not
have a valid type. (Recall that ∆ = λx.xx.) Note that we must put ∆ ∆ under a λbecause we’re
using call-by-value semantics. In particular, (λxy.x) 3 (∆ ∆) does not reduce to 3 under call-by-value
semantics because the evaluation of ∆ ∆ never terminates.
1