This assignment consists of Exercises 6.14.1, 6.14.5, 6.15.1, 6.15.4, 6.15.6,
6.16.1, 6.16.5, available in in DVI, PostScript, or PDF formats.
Exercise 6.14
Types play an important role in compilation, which is not reflected
in the development of this chapter. Ideally, we would like to take
advantage of type information as much as possible in order to
produce more compact and more efficient code. This is most easily
achieved if the type information is embedded directly in
expressions, but at the very least, we would expect that types can
be assigned to intermediate expressions in the compiler.
Define typing judgments for de Bruijn expressions,
environments, and values for the language of Section 6.2. You may
assume that values are always closed.
Implement the judgments above in Elf.
Exercise 6.15
Define typing judgments for expressions, values,
instructions, continuations, and machine states for the continuation
machine.
Implement the judgments above in Elf.
Extend the typing judgment, proofs, and implementations to
include letcckine.
Exercise 6.16
Define a typing judgment for evaluation contexts.
It should only hold for valid evaluation contexts.
Implement the judgments above in Elf. Evaluation contexts
should be represented as functions from expressions to expressions
satisfying an additional judgment.