In this assignment we implement a simple bottom-up interactive theorem
prover for intuitionistic linear logic.  Source can be found here, in
/afs/cs/user/fp/courses/linear/www/assignments/hw3/, or in
http://www.cs.cmu.edu/~fp/courses/linear/assignments/hw3.tar.gz.  The
files are

ctx.sig
ctx.fun       --- Contexts / provided
term.sig
term.fun      --- Terms / provided
prop.sig
prop.fun      --- Propositions / provided
seq.sig
seq.fun       --- Sequents and goals / provided
rules.sig     --- Interface to rules / provided
rules.fun     --- Inference rules / TO BE WRITTEN
top.sig
top.fun	      --- Simple top-level interface / provided

top.sml       --- File which creates top-level structures / provided

sources.cm    --- Source file index for SML of NJ Compilation Manager,
	          compile and load with  CM.make ();
load.sml      --- Load file for MLWorks or plain SML of NJ,
	          compile and load with  use "load.sml";

examples.sml  --- Some test cases

SOME NOTES.

The representation of terms and propositions is a so-called "named
representation".  We distinguish between variables bound by quantifiers
and parameters introduced in the forallR and existsL rules.  Many
functions require that the term be closed, that is, not contain any free
variables.  Other functions require that the term be closed with respect
to a parameter context P, which in addition restricts all parameters to
be listed in P.  When we descend through quantifier we therefore
generally need to substitute a fresh parameter for the bound variable.
In order to simplify this, a corresponding generator is supplied in the
Term structure.  Equality between propositions is taken to be equality
modulo the renaming of bound variables.  At the level of propositions we
presently do not explicitly introduce parameters.

Sequents localize the legal parameters, unrestricted hypotheses, and
linear hypotheses, all of which are collected in contexts.  Contexts
are like lists, except that they are built up from left-to-right,
as in the mathematical notation.  We represent the context
  ., un:An, ..., u1:A1
by
  Null $ An $ ... $ A1
where Null is the empty context and $ is a left-associative infix
operator.  We omit labels, since we identify hypotheses by their
number, counting from right to left, starting with 1.

Inference rules all work bottom up, taking a sequent and returning
subgoals as a member of the goal datatype.  Each premiss of a rule
becomes a subgoal.  There are currently no validations which construct a
proof object for the conclusion, given proof objects for the premisses.
Thus everything relies on the correctness of the Rules structure and no
further precautions are taken to guarantee validity.

The status of the current goals is maintained in the Top structure,
which contains a global reference.  There are no undo or similar
niceties, only two ways to start proving a new judgment.  The current
goal is always displayed, and rules are applied in the backward
direction using the apply function which has global effect (if
successful).  Failure of a rule is indicated by an appropriate error
message.
