UMass logo
CMPSCI 630 (691F)
Programming Languages
Spring 2009

Homework Assignment 2


  1. Do Exercise 1 in Section 9.3 (p. 78) of Harper's book.

  2. Do Exercise 1 in Section 10.4 (p. 87) of Harper's book.

  3. Do Exercise 2 in Section 10.4 (p. 87) of Harper's book.

  4. Consider the evaluation sequence near the middle of page 81 in Harper's book. Use the static semantics from Chapter 9 in Harper's book to derive a type for the initial expression (the first line of the sequence) and a type for the final expression (the last line of the sequence). How do your results relate to type safety?

  5. Consider the evaluation sequence near the middle of page 81 in Harper's book.
    1. Give the corresponding evaluation sequence resulting from using the contextual semantics variant of structural semantics to justify each transition step.
    2. Give the corresponding evaluation sequence resulting from using evaluation semantics to justify each transition step.
    3. Give the corresponding evaluation sequence resulting from using environment semantics, starting with an empty environment, to justify each transition step.

  6. Give the parts of the proof of Theorem 10.2 (page 83 in Harper's book) related to the let operation (let(e1;x.e2)).

  7. Give the parts of the proof of Theorem 11.2 (page 90 in Harper's book) related to the length of string operation (len(e)).

  8. Give the parts of the proof of Theorem 11.4 (page 91 in Harper's book) related to the let operation (let(e1;x.e2)).

  9. Give the parts of the proofs of Lemmas 12.3 and 12.4 (page 97 in Harper's book) related to the let operation (let(e1;x.e2)).

  10. Give all the rules necessary to define the "goes wrong" judgement for the the let operation (let(e1;x.e2)).

  11. State and prove the canonical forms lemma for unit and product types as they are defined in Chapter 16 in Harper's book.

  12. Do Exercise 1 from Section 17.4 (p. 146) of Harper's book.

  13. Consider the expression (18.1) on page 148 in Harper's book. Use the static semantics from Chapters 16, 17 and 18 in Harper's book to derive a type for this expression.


E-mail the instructor

Last modified: Weds Feb 24 19:15 EST 2009