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

Homework Assignment 1

  • Your are strongly urged to follow the guidelines for structuring proofs that were given by the staff of the Princeton Programming Languages course.
    1. Do Exercise 1 in Section 1.9 (p. 15) of Harper's book.

    2. Do Exercise 3 in Section 1.9 (p. 15) of Harper's book.

    3. Refer to slide 16 from Inductive-PDF. Using the rule set for variadic trees given there, give and justify an example of:
      1. A derivability judgement that is valid given this rule set.
      2. An admissibility judgement that is valid given this rule set.
      3. A change to the rule set that would make the admissibility judgement you gave in your answer to the previous question invalid.

    4. Do Exercise 1 in Section 4.4 (p. 36) of Harper's book.

    5. Using rules (5.2a) and (5.2b) on page 40 of Harper's book (or the rules on slide 6 from Syntax1-PDF), give a derivation for the judgement "ab^cd = abcd str".

    6. Give an inductive definition of the judgement | s | = n str, where s str and n nat, stating that a string s has length n, namely the number of symbols occurring within it. Use the principle of string induction to show that this judgement defines a function.

    7. Do Exercise 1 in Section 6.3 (p. 51) of Harper's book.

    8. Do Exercise 2 in Section 6.3 (p. 51) of Harper's book.

    9. Use the inductive definition of lexing (pages 55 and 56 in Harper's book) to derive the lexical analysis of "1+2*3" to "NUM[1] ADD NUM[2] MUL NUM[3]".

    10. Use the inductive definition of parsing (page 58 in Harper's book) to produce two different derivations for "NUM[1] ADD NUM[2] MUL NUM[3]".

    11. Give the (unique) derivation "NUM[1] ADD NUM[2] MUL NUM[3]" that can be produced using the layered grammer on page 60 in Harper's book.


    E-mail the instructor

    Last modified: Tues Feb 24 17:45 EST 2009