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 delaye and a
destructor letdelayu = e1ine2. 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 (delaye) 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
delaye and forcee.
Compare this to the primitives delay and letdelay
used above. Do you see any advantages or disadvantages?