Mlsem_app.Configinclude module type of struct include Mlsem_system.Config endWhen true, the type of applications is not generalized as their evaluation may be effectful (cf. Checker.generalize). Disabling it makes inference more permissive but unsound in the presence of mutable state.
Whether the reconstruction should try to infer intersection (overloaded) types for functions, by exploring the branches of a typecase separately even when the scrutinee's type does not decide between them. Disabling it makes inference cheaper and the inferred types simpler.
Whether a branch of an intersection whose exploration failed should be explored again in the other branches' domains. Disabling it makes reconstruction cheaper at the cost of precision.
val normalization_fun : (Mlsem_types.Ty.t -> Mlsem_types.Ty.t) Stdlib.refNormalization applied to a type before its emptiness is tested. It must return a type that is empty if and only if the argument is "empty enough" to be considered uninhabited (cf. Heuristics.normalize_empty_abstracts). Use Fun.id for no normalization.
val subst_normalization_fun :
(Mlsem_system.Heuristics.tally_context ->
Mlsem_types.Subst.t list ->
Mlsem_types.Subst.t list)
Stdlib.refNormalization applied to the set of solutions of a tallying instance. It may split, reorder or drop solutions, but every returned substitution must be a solution of the instance: the reconstruction relies on them being sound, not on them being complete. Use fun _ x -> x for no normalization (the default).
Whether, when the (partially inferred) type of a parameter or of a let-binding is added to the environment, its inference variables that occur at the same positions and with the same variance should be identified (cf. Heuristics.assimilate_vars). This loses generality, but only for types that are inferred: annotated parameters are not affected.
Whether, when the (partially inferred) type of a parameter or of a let-binding is added to the environment, its inference variables intersected with abstract types should be substituted by the type they are intersected with (cf. Heuristics.factorize_abstracts). This prevents the inference of intersections of abstract types such as array(int) & array(bool).
val var_simplification_fun :
(is_lambda:bool ->
Mlsem_types.MVarSet.t ->
Mlsem_types.GTy.t ->
Mlsem_types.Subst.t)
Stdlib.refCustom simplification applied, after the ones above, to the (partially inferred) type of a parameter or of a let-binding when it is added to the environment. It is given whether the type is the one of a parameter (~is_lambda:true) or of a let-binding (~is_lambda:false), the variables that may be substituted (the inference variables of the type that are neither generalized nor bound by the environment) and the type, and returns a substitution, Subst.identity meaning that there is nothing to simplify. Any such substitution yields a valid derivation, but it may lose generality. When the substitution is not the identity, it is applied and the binding is typed again, so the function must eventually return Subst.identity. For instance, fun ~is_lambda:_ -> Heuristics.assimilate_vars reimplements assimilate_vars. Use fun ~is_lambda:_ _ _ -> Subst.identity for no simplification (the default).
include module type of struct include Mlsem_lang.Config endtype eval_order = Mlsem_lang.Config.eval_order = | LeftToRightEvaluates arguments left-to-right.
*)| RightToLeftEvaluates arguments right-to-left.
*)| UnknownOrderDefault. Evaluation order is unknown (and/or optional). Once started, evaluation cannot be aborted (e.g. Ternary, Join, Meet).
*)| AbortableEvaluation order is unknown (and/or optional). Evaluation can be aborted (e.g. Voidify, Try).
*)val void_ty : Mlsem_types.Ty.t Stdlib.refType given to expressions evaluated only for their effects (statements, loops, assignments).
val app_eval_order : eval_order Stdlib.refOrder in which a function and its argument are evaluated.
val tuple_eval_order : eval_order Stdlib.refval record_eval_order : eval_order Stdlib.refval cons_eval_order : eval_order Stdlib.refval ccustom_eval_order : (string, eval_order) Stdlib.Hashtbl.tEvaluation order of the arguments of a user-defined (gradual) constructor, by name. Constructors absent from the table default to UnknownOrder.
val type_narrowing : narrowing Stdlib.refval errors_style : Mlsem_system.Error.style Stdlib.ref