Module Mlsem_app.Main

module MVariable = Mlsem_lang.MVariable
module NameMap : Stdlib.Map.S with type key = string

Severity, location, title, description, and the analyzer's diagnostic it comes from, if any.

type derivation = {
  1. sig_index : int option;
  2. part : int option;
  3. env : Mlsem_common.Env.t;
  4. expr : Mlsem_system.Ast.t;
  5. annot : Mlsem_system.Annot.Annot.t;
  6. resolved : Signature.t;
}

One checking pass of a definition: sig_index is the index of the val declaration it was checked against, if any. expr is the expression checked in the environment env, and annot its derivation, with every typed node's type cached in it. resolved is the type this pass gave, as overloads: several when the body is overloaded.

The definitions of a recursive group are checked together: each one has the derivation of the whole group (the same expr and annot), and part is the index of the definition in the group.

type inferred = {
  1. var : Mlsem_common.Variable.t;
  2. ty : Mlsem_types.TyScheme.t;
  3. sigs : Signature.t;
  4. declared : bool;
  5. derivations : derivation list;
    (*

    Definitions checked together (without val) share one derivation, carried by the first of them.

    *)
}
type result =
  1. | TSuccess of inferred list * float
  2. | TDone
  3. | TFailure of Mlsem_common.Variable.t option * Mlsem_common.Position.t * string * string option * float * Mlsem_lang.Error.t option
    (*

    The defined variable, if any, where it failed, the title and description, the time, and the type error when it is one.

    *)
type output = {
  1. res : result;
  2. msg : message list;
}
val treat_all_sigs : envs -> ('a Mlsem_common.Position.located * PAst.element) list -> envs * output
val initial_envs : envs
val initial_senv : Signature.t Mlsem_common.VarMap.t
val initial_benv : Mlsem_types.Builder.benv
val initial_penv : Mlsem_types.PEnv.t
val display : envs -> Mlsem_types.TyScheme.t -> string
val display_gty : ?names:Mlsem_types.Subst.t -> envs -> Mlsem_types.GTy.t -> string

names renames type variables, e.g. to match how display names the variables of a scheme.

val signature : envs -> Signature.t -> string list

names renames type variables, e.g. to match how display names the variables of a scheme.

val build_type : envs -> string -> Mlsem_types.Ty.t
val user_type_names : envs -> string list
val user_alias_arity : envs -> string -> int option
val user_type_arity : envs -> string -> int option
type parsing_result =
  1. | PSuccess of PAst.program
  2. | PFailure of Mlsem_common.Position.t * string
val parse : [< `File of string | `String of string ] -> parsing_result