prac5-fall09

prac5-fall09 - & y.y)) ( & y.y) n. ((( & x....

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

View Full Document Right Arrow Icon
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) (
Background image of page 1
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

This note was uploaded on 01/13/2012 for the course CMSC 330 taught by Professor Staff during the Fall '08 term at Maryland.

Ask a homework question - tutors are online