PLDA Homework 3: Type inference

Implement type inference for expressions with the following (abstract) syntax:

Expr ::= num | var | Expr '+' Expr | if Expr then Expr else Expr | fun var -> Expr | Expr Expr
i.e., integers, variables, addition, multiplication, conditional, lambda abstraction and application. The type of a free variable should be a type variable. Report invalid typing using exceptions.
Marius Minea
Last modified: Fri Oct 29 12:00:00 EET 2010