15-851
Computation & Deduction
Spring 1997
Frank Pfenning
Assignment 2
Due: Tu Feb 4
- Exercise 3.17
- Consider a language extension to support lazy evaluation in
Mini-ML. For this we introduce a new type constructor #,
where #t is the type of suspensions of type t.
There should be a new constructor delay e and a
destructor let delay u = e1
in e2. The intent is that we substitute an
expression for u which need not be a value.
- Extend the typing, value, and evaluation judgments.
- Define a function force which has type
(#a) -> a for a type variable a.
- Prove that force (delay e) evaluates to v
if and only if e evaluates to v according
to your operational semantics.
- Represent the new expression constructors in LF.
- Represent the new value rules in LF.
- Represent the new evaluation rules in LF.
- Extend the proof of type preservation (Theorem 2.5).
- Extend the proof of value soundness (Theorem 2.1).
- Extend the definition of the value soundness judgment (Section
3.7) and give a representation of the new cases in LF.
- Another choice of primitives for suspensions are
delay e and force e.
Compare this to the primitives delay and let delay
used above. Do you see any advantages or disadvantages?
©
Frank Pfenning 1992-1997
fp@cs