module MiniInfer: sig
.. end
This module expresses the problem of type inference for MiniML
programs to the problem of constraint solving by a transformation
of program into typing constraints.
type
context = Constraint.tconstraint -> Constraint.tconstraint
Constraint contexts.
val infer_program : MiniTypingEnvironment.environment ->
MiniAst.program -> MiniTypingEnvironment.environment * context
infer_program p
generates a constraint context that describes
program p
.
val generate_constraint : MiniAst.program -> Constraint.tconstraint
generate_constraint p
generates a closed constraint that describes
the typing of p
.
val init_env : unit -> context * MiniTypingEnvironment.environment
init_env ()
returns a constraint context that defines the builtins
of the source language.
val remove_init_context : Constraint.tconstraint -> Constraint.tconstraint
remove_init_context
returns the context part that concerns the
initial environment.