CS 6520 Homework 15

Exercise 15.1

Complete a typed lambda calculus implementation by implementing a type checker, staring with tlc-almost.ml. (The evaluator is complete. You need only write a type checker.)

The top of tlc-almost.ml provides details about the language to implement. This variant of the typed lambda calculus provides only numbers as primitive constants, doesn't provide extensions like pairs, and doesn't even provide an addition primitive. You do not need to implement the missing features; the given features are enough to write interesting examples.

Exercise 15.2

Extend your typed lambda calculus implementation with type abstractions, as in Pierce, Chapter 18.

When you extend the xval datatype, TyLam is a good name for the new constructor.

When you extend the xtype datatype, TyVar and ForAll are good names for the new constructors.

When you extend the xprdatatype, TyApp is a good name for the new constructor.

For your convenience, OCaml is installed on the cs filesystem for Sparc Solaris at
  /home/mflatt/packages/ocaml/bin/ocaml
For other platforms, you can download and install OCaml from
  http://pauillac.inria.fr/ocaml/

The OCaml reference manual is available in PDF format locally, and in other formats from the OCaml home page.

Hand-in procedure for exercises 15.1 and 15.2: Send a mail message containing your code to mflatt@cs.utah.edu. Your message should encapsulate two files, tlc.ml and tlc-ta.ml.

Mime-encoded enclosures are preferred, but any reasonable encoding/enclosing mechanism is fine, including plain text with a clear separator between the files.


Last update: Thursday, March 16th, 2000
mflatt@cs.utah.edu