prac5-fall09

# prac5-fall09 - & y.y& y.y n& x& y(x y& y.y w...

This preview shows page 1. Sign up to view the full content.

CMSC330 Fall 2009 Practice Problems 5 1. Lambda calculus Make all parentheses explicit in the following & -expressions a. x.xz y.xy b. ( x.xz) y.w w.wyzx c. x.xy x.yx Find all free (unbound) variables in the following & -expressions d. x.x z y.x y e. ( x. x z) y. w w. w y z x f. x. x y x. y x Apply ± -reduction to the following & -expressions as much as possible g. ( z.z) ( y.y y) ( x.x a) h. ( z.z) ( z.z z) ( z.z y) i. ( x. y.x y y) ( a.a) b j. ( x. y.x y y) ( y.y) y k. ( x.x x) ( y.y x) z l. ( x. ( y. (x y)) y) z m. (( x.x x) (
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: & y.y)) ( & y.y) n. ((( & x. & y.(x y))( & y.y)) w) Show that the following expression has multiple reduction sequences o. ( & x.y) (( & y.y y y) ( & x.x x x)) 2. Lambda calculus encodings Prove the following using the appropriate &-calculus encodings a. not (not true) = true b. or false true = true c. if false then x else y = y d. succ 2 = 3 e. (* 1 3) = 3 f. (+ 2 1) = 3 g. (Y fact) 2 = 2 // you do not need to expand any operators except fact & Y...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online