15-851
Computation & Deduction
Spring 1997
Frank Pfenning

Assignment 5

Due: Thursday, February 27

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.
  1. 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.
  2. Implement the judgments above in Elf.

Exercise 6.15
  1. Define typing judgments for expressions, values, instructions, continuations, and machine states for the continuation machine.
  2. Implement the judgments above in Elf.
  3. Extend the typing judgment, proofs, and implementations to include letcc k in e.

Exercise 6.16
  1. Define a typing judgment for evaluation contexts. It should only hold for valid evaluation contexts.
  2. Implement the judgments above in Elf. Evaluation contexts should be represented as functions from expressions to expressions satisfying an additional judgment.

  • next assignment
  • previous assignment

  • [ C&D Home | Schedule | Code | Assignments | Notes | Projects | Elf ]

    © Frank Pfenning 1992-1997
    fp@cs