Exercise 2.12
Explore an alternative operational semantics in which
expressions that are known to be values (since the have been
evaluated) are not evaluated again. State and prove in which way the
new semantics is equivalent to the one given in Section 2.3.
Hint: It may be necessary to extend the language of expressions ore
explicitly separate the language of values from the language of
expressions.
Extend and modify the implementation of the Mini-ML interpreter to
implement the alternative operational semantics.
Exercise 4.5
Write declarations to represent natural numbers in unary and
binary notation.
1. Implement a translation between binary and unary representations in Elf.
2. Formulate an appropriate representation theorem and prove it.
3. Implement the proof of the representation theorem in Elf.
Exercise 5.9
Consider the call-by-name version of Mini-ML with lazy
constructors as sketched in Exercise 2.12. Recall that neither the
arguments to functions, nor the arguments to constructors should be
evaluated.
1. Implement an interpreter for the language and show a few
expressions that highlight the differences in the operational
semantics.
2. [ignore]
3. Implement a suitable notion of value.
4. Implement the value soundness proof, i.e. call-by-name
evaluation always returns a lazy value.
5. [ignore]