

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Extensions of simple types
Due: Monday, October 30, 2006, by noon
Submit your solutions as hw7, for example using the command:
~cis500/bin/cis500submit hw7 hw7.pdf
1 Exercise For each new extension to the simply-typed lambda calculus (λ→) with error (see Figure 14-1), we must add new rules to propagate the error. For example, in the language λ→ + error + booleans, we need the rule:
if error then t 2 else t 3 −→ error
What new rules do we need for λ→ + error + unit + references, i.e., the language of Figure 13- extended with error?
2 Exercise Suppose we extend the language λ→ + unit + references (Figure 13-1) with the following new syntax, typing rules, and evaluation rules: t ::=... terms: free t deallocation Γ | Σ t : Ref T T-Free Γ | Σ free t : Unit l ∈ dom(μ) E-FreeRef free l | μ −→ unit | (μ \ {l})
t | μ −→ t′^ | μ′ E-Free free t | μ −→ free t′^ | μ′ where we use the notation μ \ {l} to indicate the store μ without any binding for the location l. Some questions about this language:
3 Exercise Exercise 13.3.1 from TAPL. (Again, this exercise has a solution in the back of the book. To get full value out of the assignment, don’t peek until after you have written out a complete solution of your own.)
4 Debriefing