Part 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.

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

The OCaml reference manual is available in HTML from the OCaml home page.

Part 2 - OPTIONAL

Extend your typed lambda calculus implementation with type abstractions, as in Chapter 14 of the course notes.

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 xpr datatype, TyApp is a good name for the new constructor.

Hand-in procedure

Send a mail message containing your code to mflatt@cs.utah.edu. Your message should encapsulate two files, tlc.ml (required) and tlc-ta.ml (optional).

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