MiniML Type Inferencer

Due Tuesday, February 1, at the start of class

In this assignment, you will build a type inferencer for MiniML. Your type inferencer should handle the full MiniML language, including self-recursive functions, polymorphic functions, nested polymorphic functions, and equality types, except for the following restrictions:

You can start the assignment from the version of MiniML in /cse/courses/cse505/05wi/hw2. This is the same initial version of the interpreter as used in the previous assignment, with the following extensions:

You should make your own local copy of these files, copy over your changes from the first project to make the evaluator fully functional, and then provide implementations of the stubbed-out functions in typecheck.sml and unify.sml that are marked by ImplementMe exceptions.  You should carefully read the unify.sml and typecheck.sml files to understand how the unification data structures work and how to use them in the typecheck functions.  Of course, feel free to ask questions, the earlier the better.

MiniML.x86-linux is a sample solution for this homework -- a complete MiniML evaluator and type inferencer. You can play around with this version to get a feel for how your evaluator and type inferencer should behave and to compare with your solution. To use it, invoke SML from a Linux machine as follows:

sml @SMLload=MiniML.x86-linux
This will automatically start up the read-eval-print loop.

How and what to turn in

Each student should complete the assignment independently.

You should develop some test cases, as a single file of MiniML code that can be directly fed into the evaluator, to exercise your solution and demonstrate that it works on the features that you had to implement.  I suggest developing this set of test cases early, perhaps before you begin implementing.  You can use the sample executable to see what behavior is expected on your test cases.

Turn in your assignment as follows:

Code formatting guidelines