functor (Root : SCHEME_ROOT) -> sig end
The functor scheme allows to build an implementation of functions
dealing which each considered form schemes.
val copy :
?subst:Dalton.Make.subst -> Root.t -> Root.t
copy ?subst sh returns a fresh copy of the type scheme sh.
No particular assumption is made about the type scheme
for efficiency, it is more than a good idea to solve it previously.
val fprint :
Format.formatter -> Root.t -> unit
fprint ppf sh pretty-prints the scheme
sh on the formatter
sh is assumed to be solved.
val draw :
Draw.window -> Root.t -> int -> int -> int * int
draw window sh x y draws the scheme
sh on the window
The bottom left corner of the drawing has coordinates
and the function returns the coordinates of the upper right
A solve report records an explanation of why the resolution
of a scheme fails.
val report_solve :
Format.formatter -> solve_report -> unit
report_solve ppf r pretty prints an error message on the
ppf corresponding to the comparison report
val solve :
Root.t -> solve_report option
solve sh solves the scheme
sh. If this function
None then the scheme
sh has some instances.
Moreover, it is stored in a "solved" form which is preserved
as long as no term or constraint is added to its constraint
A comparison report records an explanation of the failure of
the comparison of two schemes.
val report_comparison :
Format.formatter -> comparison_report -> unit
report_comparison ppf r pretty prints an error message on the
ppf describing the comparison report
val compare :
Root.t -> Root.t -> comparison_report option
compare sh1 sh2 test wether
sh2 is more general than
sh2 is a correct implementation of
sh1). It returns
sh2 is effectively so. Otherwise, it returns
r is a report "explaining" why
sh2 is not more general
sh1. The current implementation assumes that
val equivalent :
Root.t -> Root.t -> bool
equivalent sh1 sh2 returns a boolean indicating wether the
type schemes sh1 and sh2 are equivalent. The current implementation
sh2 are in solved form.
A comparison report records an explanation of why a scheme
has no minimal instance.
val report_minimal :
Format.formatter -> minimal_report -> unit
report_minimal ppf r pretty prints an error message on the
ppf describing the report
val has_minimal_instance :
Root.t -> minimal_report option
has_minimal_instance sh tests wether the scheme
sh has a minimal
instance. If so, the function returns
None. Otherwise, it
Some r where
r is a value of type
sh has no minimal instance. The current
implementation assumes that
sh is in solved form.