Part 1

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

The top of 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
For other platforms, you can download and install OCaml from

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


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 Your message should encapsulate two files, (required) and (optional).

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