

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


1.0 Initial Release.
Your answers to the following questions are to be hand-written neatly or printed on one or more sheets of paper, each with your name in the upper right corner. The homework is to be turned in in class at the start of class. Alternately, you may hand it to Prof. Elsa Gunter in person before the deadline.
The purpose of this HW is to test your understanding of:
Another purpose of HW3 is to provide you with experience answering non-programming written questions of the kind you may experience on the final.
(λx.λy.xxy)((λx.λz.λy.xz)(λz.z))
reduce this term as much as possible using each of
a. eager evaluation
b. lazy evaluation c. unrestricted αβ-reduction (i.e. by αβ conversion that can be applied anywhere)
Label each step of reduction with the rule justifying it. You do not need to label uses of congruence, or break them out as separate steps, in this problem.
{x = a&a < 3 } if y > 3 then x := x + y else x := x + 3 {x > 2 ∗ a}
You may either give a proof tree, or write out you proof in English, but you must cite each Floyd-Hoare Logic Rule used.
type ’a option = None | Some of ’a
let case x a f = match x with None -> a | Some y -> f y