Module TypeInference.Ctx
val create : ?def_as_rewrite:bool -> ?default:type_ -> ?on_var:[ `Default | `Infer ] -> ?on_undef:[ `Warn | `Fail | `Guess ] -> ?on_shadow:[ `Warn | `Ignore ] -> implicit_ty_args:bool -> unit -> t
New context with a signature and default types.
- parameter default
which types are inferred by default (if not provided then
type_erm
will be used)
- parameter def_as_rewrite
if true, definitions will be treated like rewrite rules
- parameter on_undef
behavior when an undefined identifier is met
- parameter on_var
behavior when a variable without type annotation is met
val exit_scope : t -> unit
Exit the current scope (formula, clause), meaning that all free variables' types are forgotten. Some free variables are bound to the
default
type provided at creation of the context. Some ree variables will be generalized, i.e., kept as (free) variables