From a982c72d1457935890acd7d094af2575744890a6 Mon Sep 17 00:00:00 2001 From: Gbury Date: Sat, 14 Oct 2023 10:52:14 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Gbury/do?= =?UTF-8?q?lmen@65af0979a2084afcb363f9d5c6007985fd1c9925=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/dolmen_loop/Dolmen_loop/Typer/T/index.html | 9 +++------ .../Dolmen_type/Arith/Ae/Tff/argument-1-Type/index.html | 9 +++------ .../Arith/Smtlib2/Int/Tff/argument-1-Type/index.html | 9 +++------ .../Arith/Smtlib2/Real/Tff/argument-1-Type/index.html | 9 +++------ .../Smtlib2/Real_Int/Tff/argument-1-Type/index.html | 9 +++------ .../Arith/Tptp/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Arith/Zf/Thf/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Arrays/Ae/Tff/argument-1-Type/index.html | 9 +++------ .../Arrays/Smtlib2/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Bitv/Ae/Tff/argument-1-Type/index.html | 9 +++------ .../Bitv/Smtlib2/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Core/Ae/Tff/argument-1-Type/index.html | 9 +++------ .../Core/Dimacs/Tff/argument-1-Type/index.html | 9 +++------ .../Core/Smtlib2/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Core/Tptp/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Core/Tptp/Thf/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Core/Zf/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Def/Declare/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Def/Subst/argument-1-Type/index.html | 9 +++------ .../Float/Smtlib2/Tff/argument-1-Type/index.html | 9 +++------ .../Dolmen_type/Intf/module-type-Formulas/index.html | 8 +++----- .../Strings/Smtlib2/Tff/argument-1-Type/index.html | 9 +++------ dev/dolmen_type/Dolmen_type/Tff/Make/index.html | 9 +++------ .../Dolmen_type/Tff_intf/module-type-S/index.html | 9 +++------ dev/dolmen_type/Dolmen_type/Thf/Make/index.html | 9 +++------ .../Dolmen_type/Thf_intf/module-type-S/index.html | 9 +++------ 26 files changed, 78 insertions(+), 155 deletions(-) diff --git a/dev/dolmen_loop/Dolmen_loop/Typer/T/index.html b/dev/dolmen_loop/Dolmen_loop/Typer/T/index.html index ec6517a4b..2e9607c7e 100644 --- a/dev/dolmen_loop/Dolmen_loop/Typer/T/index.html +++ b/dev/dolmen_loop/Dolmen_loop/Typer/T/index.html @@ -26,17 +26,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

Type definitions

type order =
  1. | First_order
    (*

    First-oreder typechecking

    *)
  2. | Higher_order
    (*

    Higher-order typechecking

    *)

Control whether the typechecker should type

type poly =
  1. | Explicit
    (*

    Type arguments must be explicitly given in funciton applications

    *)
  2. | Implicit
    (*

    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

    *)
  3. | Flexible
    (*

    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

    *)

The various polymorphism mode for the typechecker

type sym_inference_source = {
  1. symbol : Dolmen.Std.Id.t;
  2. symbol_loc : Dolmen.Std.Loc.t;
  3. mutable inferred_ty : Ty.t;
}
type var_inference_source = {
  1. variable : Dolmen.Std.Id.t;
  2. variable_loc : Dolmen.Std.Loc.t;
  3. mutable inferred_ty : Ty.t;
}
type wildcard_source =
  1. | Arg_of of wildcard_source
  2. | Ret_of of wildcard_source
  3. | From_source of Dolmen.Std.Term.t
  4. | Added_type_argument of Dolmen.Std.Term.t
  5. | Symbol_inference of sym_inference_source
  6. | Variable_inference of var_inference_source
type wildcard_shape =
  1. | Forbidden
  2. | Any_in_scope
  3. | Any_base of {
    1. allowed : Ty.t list;
    2. preferred : Ty.t;
    }
  4. | Arrow of {
    1. arg_shape : wildcard_shape;
    2. ret_shape : wildcard_shape;
    }
type infer_unbound_var_scheme =
  1. | No_inference
  2. | Unification_type_variable
type infer_term_scheme =
  1. | No_inference
  2. | Wildcard of wildcard_shape
type var_infer = {
  1. infer_unbound_vars : infer_unbound_var_scheme;
  2. infer_type_vars_in_binding_pos : bool;
  3. infer_term_vars_in_binding_pos : infer_term_scheme;
  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
}

Specification of how to infer variables.

type sym_infer = {
  1. infer_type_csts : bool;
  2. infer_term_csts : infer_term_scheme;
  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
}

Specification of how to infer symbols.

type free_wildcards =
  1. | Forbidden
  2. | Implicitly_universally_quantified
type expect =
  1. | Type
  2. | Term
  3. | Anything
type tag =
  1. | Set : 'a Tag.t * 'a -> tag
  2. | Add : 'a list Tag.t * 'a -> tag
    (*

    Existencial wrapper around tags

    *)
type res =
  1. | Ttype
  2. | Ty of Ty.t
  3. | Term of T.t
  4. | Tags of tag list

The results of parsing an untyped term.

type builtin_meta_ttype = unit
type builtin_meta_ty = unit
type builtin_meta_tags = unit

Some type aliases

type term_semantics = [
  1. | `Total
  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
]

Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

type builtin_meta_term = term_semantics

Meta data for term builtins.

type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

Small record to hold the results of builtin parsing by theories.

type builtin_res = [
  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
  6. | `Infer of string * var_infer * sym_infer
]

The result of parsing a symbol by the theory

type not_found = [
  1. | `Not_found
]

Not bound bindings

type reason =
  1. | Builtin
  2. | Reserved of string
  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
    (*

    The type of reasons for constant typing

    *)
type binding = [
  1. | `Not_found
  2. | `Reserved of string
  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

    Type definitions

    type order =
    1. | First_order
      (*

      First-oreder typechecking

      *)
    2. | Higher_order
      (*

      Higher-order typechecking

      *)

    Control whether the typechecker should type

    type poly =
    1. | Explicit
      (*

      Type arguments must be explicitly given in funciton applications

      *)
    2. | Implicit
      (*

      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

      *)
    3. | Flexible
      (*

      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

      *)

    The various polymorphism mode for the typechecker

    type sym_inference_source = {
    1. symbol : Dolmen.Std.Id.t;
    2. symbol_loc : Dolmen.Std.Loc.t;
    3. mutable inferred_ty : Ty.t;
    }
    type var_inference_source = {
    1. variable : Dolmen.Std.Id.t;
    2. variable_loc : Dolmen.Std.Loc.t;
    3. mutable inferred_ty : Ty.t;
    }
    type wildcard_source =
    1. | Arg_of of wildcard_source
    2. | Ret_of of wildcard_source
    3. | From_source of Dolmen.Std.Term.t
    4. | Added_type_argument of Dolmen.Std.Term.t
    5. | Symbol_inference of sym_inference_source
    6. | Variable_inference of var_inference_source
    type wildcard_shape =
    1. | Forbidden
    2. | Any_in_scope
    3. | Any_base of {
      1. allowed : Ty.t list;
      2. preferred : Ty.t;
      }
    4. | Arrow of {
      1. arg_shape : wildcard_shape;
      2. ret_shape : wildcard_shape;
      }
    type infer_unbound_var_scheme =
    1. | No_inference
    2. | Unification_type_variable
    type infer_term_scheme =
    1. | No_inference
    2. | Wildcard of wildcard_shape
    type var_infer = {
    1. infer_unbound_vars : infer_unbound_var_scheme;
    2. infer_type_vars_in_binding_pos : bool;
    3. infer_term_vars_in_binding_pos : infer_term_scheme;
    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
    }

    Specification of how to infer variables.

    type sym_infer = {
    1. infer_type_csts : bool;
    2. infer_term_csts : infer_term_scheme;
    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
    }

    Specification of how to infer symbols.

    type free_wildcards =
    1. | Forbidden
    2. | Implicitly_universally_quantified
    type expect =
    1. | Type
    2. | Term
    3. | Anything
    type tag =
    1. | Set : 'a Tag.t * 'a -> tag
    2. | Add : 'a list Tag.t * 'a -> tag
      (*

      Existencial wrapper around tags

      *)
    type res =
    1. | Ttype
    2. | Ty of Ty.t
    3. | Term of T.t
    4. | Tags of tag list

    The results of parsing an untyped term.

    type reservation =
    1. | Strict
      (*

      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

      *)
    2. | Model_completion
      (*

      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

      *)

    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

    type reason =
    1. | Builtin
    2. | Reserved of reservation * string
    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
      (*

      The type of reasons for constant typing

      *)
    type binding = [
    1. | `Not_found
    2. | `Reserved of [ `Model of string | `Solver of string ]
    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
    ]

    The bindings that can occur.

    type var_kind = [
    1. | `Let_bound
    2. | `Quantified
    3. | `Function_param
    4. | `Type_alias_param
    ]

    The type of kinds of variables

    type nonrec symbol = Dolmen_type.Intf.symbol =
    1. | Id of Dolmen.Std.Id.t
    2. | Builtin of Dolmen.Std.Term.builtin

    Wrapper around potential function symbols from the Dolmen AST.

    Errors and warnings

    type _ warn = ..

    The type of warnings, parameterized by the type of fragment they can trigger on

    type warn +=
    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
      (*

      Unused quantified type variable

      *)
    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
      (*

      Unused quantified term variable

      *)
    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
      (*

      An error occurred wile parsing an attribute

      *)
    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
    ]
    type builtin_meta_ttype = unit

    The bindings that can occur.

    type builtin_meta_ty = unit
    type builtin_meta_tags = unit

    Some type aliases

    type partial_semantics = [
    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
    ]
    type term_semantics = [
    1. | partial_semantics
    2. | `Total
    ]

    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

    type builtin_meta_term = term_semantics

    Meta data for term builtins.

    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

    Small record to hold the results of builtin parsing by theories.

    type builtin_res = [
    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
    6. | `Infer of binding * var_infer * sym_infer
    ]

    The result of parsing a symbol by the theory

    type not_found = [
    1. | `Not_found
    ]

    Not bound bindings

    type var_kind = [
    1. | `Let_bound
    2. | `Quantified
    3. | `Function_param
    4. | `Type_alias_param
    ]

    The type of kinds of variables

    type nonrec symbol = Dolmen_type.Intf.symbol =
    1. | Id of Dolmen.Std.Id.t
    2. | Builtin of Dolmen.Std.Term.builtin

    Wrapper around potential function symbols from the Dolmen AST.

    Errors and warnings

    type _ warn = ..

    The type of warnings, parameterized by the type of fragment they can trigger on

    type warn +=
    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
      (*

      Unused quantified type variable

      *)
    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
      (*

      Unused quantified term variable

      *)
    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
      (*

      An error occurred wile parsing an attribute

      *)
    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
      (*

      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

      *)
    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
      (*

      Redundant cases in pattern matching

      *)

    Warnings that cna trigger on regular parsed terms.

    type warn +=
    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
      (*

      Shadowing of the given identifier, together with the old and current binding.

      *)

    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

    type _ err = ..

    The type of errors, parameterized by the type of fragment they can trigger on

    type err +=
    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
      (*

      Not well-dounded datatypes definitions.

      *)

    Errors that occur on declaration(s)

    type err +=
    1. | Expected : string * res option -> Dolmen.Std.Term.t err
      (*

      The parsed term didn't match the expected shape

      *)
    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
      (*

      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

      *)
    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
      (*

      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

      *)
    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
      (*

      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

      *)
    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
      (*

      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

      *)
    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
      (*

      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

      *)
    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
      (*

      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Ae/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Ae/Tff/argument-1-Type/index.html index 028206069..371604cf9 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Ae/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Ae/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

      Type definitions

      type order =
      1. | First_order
        (*

        First-oreder typechecking

        *)
      2. | Higher_order
        (*

        Higher-order typechecking

        *)

      Control whether the typechecker should type

      type poly =
      1. | Explicit
        (*

        Type arguments must be explicitly given in funciton applications

        *)
      2. | Implicit
        (*

        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

        *)
      3. | Flexible
        (*

        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

        *)

      The various polymorphism mode for the typechecker

      type sym_inference_source = {
      1. symbol : Dolmen.Std.Id.t;
      2. symbol_loc : Dolmen.Std.Loc.t;
      3. mutable inferred_ty : Ty.t;
      }
      type var_inference_source = {
      1. variable : Dolmen.Std.Id.t;
      2. variable_loc : Dolmen.Std.Loc.t;
      3. mutable inferred_ty : Ty.t;
      }
      type wildcard_source =
      1. | Arg_of of wildcard_source
      2. | Ret_of of wildcard_source
      3. | From_source of Dolmen.Std.Term.t
      4. | Added_type_argument of Dolmen.Std.Term.t
      5. | Symbol_inference of sym_inference_source
      6. | Variable_inference of var_inference_source
      type wildcard_shape =
      1. | Forbidden
      2. | Any_in_scope
      3. | Any_base of {
        1. allowed : Ty.t list;
        2. preferred : Ty.t;
        }
      4. | Arrow of {
        1. arg_shape : wildcard_shape;
        2. ret_shape : wildcard_shape;
        }
      type infer_unbound_var_scheme =
      1. | No_inference
      2. | Unification_type_variable
      type infer_term_scheme =
      1. | No_inference
      2. | Wildcard of wildcard_shape
      type var_infer = {
      1. infer_unbound_vars : infer_unbound_var_scheme;
      2. infer_type_vars_in_binding_pos : bool;
      3. infer_term_vars_in_binding_pos : infer_term_scheme;
      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
      }

      Specification of how to infer variables.

      type sym_infer = {
      1. infer_type_csts : bool;
      2. infer_term_csts : infer_term_scheme;
      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
      }

      Specification of how to infer symbols.

      type free_wildcards =
      1. | Forbidden
      2. | Implicitly_universally_quantified
      type expect =
      1. | Type
      2. | Term
      3. | Anything
      type tag =
      1. | Set : 'a Tag.t * 'a -> tag
      2. | Add : 'a list Tag.t * 'a -> tag
        (*

        Existencial wrapper around tags

        *)
      type res =
      1. | Ttype
      2. | Ty of Ty.t
      3. | Term of T.t
      4. | Tags of tag list

      The results of parsing an untyped term.

      type builtin_meta_ttype = unit
      type builtin_meta_ty = unit
      type builtin_meta_tags = unit

      Some type aliases

      type term_semantics = [
      1. | `Total
      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
      ]

      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

      type builtin_meta_term = term_semantics

      Meta data for term builtins.

      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

      Small record to hold the results of builtin parsing by theories.

      type builtin_res = [
      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
      6. | `Infer of string * var_infer * sym_infer
      ]

      The result of parsing a symbol by the theory

      type not_found = [
      1. | `Not_found
      ]

      Not bound bindings

      type reason =
      1. | Builtin
      2. | Reserved of string
      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
        (*

        The type of reasons for constant typing

        *)
      type binding = [
      1. | `Not_found
      2. | `Reserved of string
      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

        Type definitions

        type order =
        1. | First_order
          (*

          First-oreder typechecking

          *)
        2. | Higher_order
          (*

          Higher-order typechecking

          *)

        Control whether the typechecker should type

        type poly =
        1. | Explicit
          (*

          Type arguments must be explicitly given in funciton applications

          *)
        2. | Implicit
          (*

          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

          *)
        3. | Flexible
          (*

          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

          *)

        The various polymorphism mode for the typechecker

        type sym_inference_source = {
        1. symbol : Dolmen.Std.Id.t;
        2. symbol_loc : Dolmen.Std.Loc.t;
        3. mutable inferred_ty : Ty.t;
        }
        type var_inference_source = {
        1. variable : Dolmen.Std.Id.t;
        2. variable_loc : Dolmen.Std.Loc.t;
        3. mutable inferred_ty : Ty.t;
        }
        type wildcard_source =
        1. | Arg_of of wildcard_source
        2. | Ret_of of wildcard_source
        3. | From_source of Dolmen.Std.Term.t
        4. | Added_type_argument of Dolmen.Std.Term.t
        5. | Symbol_inference of sym_inference_source
        6. | Variable_inference of var_inference_source
        type wildcard_shape =
        1. | Forbidden
        2. | Any_in_scope
        3. | Any_base of {
          1. allowed : Ty.t list;
          2. preferred : Ty.t;
          }
        4. | Arrow of {
          1. arg_shape : wildcard_shape;
          2. ret_shape : wildcard_shape;
          }
        type infer_unbound_var_scheme =
        1. | No_inference
        2. | Unification_type_variable
        type infer_term_scheme =
        1. | No_inference
        2. | Wildcard of wildcard_shape
        type var_infer = {
        1. infer_unbound_vars : infer_unbound_var_scheme;
        2. infer_type_vars_in_binding_pos : bool;
        3. infer_term_vars_in_binding_pos : infer_term_scheme;
        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
        }

        Specification of how to infer variables.

        type sym_infer = {
        1. infer_type_csts : bool;
        2. infer_term_csts : infer_term_scheme;
        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
        }

        Specification of how to infer symbols.

        type free_wildcards =
        1. | Forbidden
        2. | Implicitly_universally_quantified
        type expect =
        1. | Type
        2. | Term
        3. | Anything
        type tag =
        1. | Set : 'a Tag.t * 'a -> tag
        2. | Add : 'a list Tag.t * 'a -> tag
          (*

          Existencial wrapper around tags

          *)
        type res =
        1. | Ttype
        2. | Ty of Ty.t
        3. | Term of T.t
        4. | Tags of tag list

        The results of parsing an untyped term.

        type reservation =
        1. | Strict
          (*

          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

          *)
        2. | Model_completion
          (*

          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

          *)

        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

        type reason =
        1. | Builtin
        2. | Reserved of reservation * string
        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
          (*

          The type of reasons for constant typing

          *)
        type binding = [
        1. | `Not_found
        2. | `Reserved of [ `Model of string | `Solver of string ]
        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
        ]

        The bindings that can occur.

        type var_kind = [
        1. | `Let_bound
        2. | `Quantified
        3. | `Function_param
        4. | `Type_alias_param
        ]

        The type of kinds of variables

        type nonrec symbol = Intf.symbol =
        1. | Id of Dolmen.Std.Id.t
        2. | Builtin of Dolmen.Std.Term.builtin

        Wrapper around potential function symbols from the Dolmen AST.

        Errors and warnings

        type _ warn = ..

        The type of warnings, parameterized by the type of fragment they can trigger on

        type warn +=
        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
          (*

          Unused quantified type variable

          *)
        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
          (*

          Unused quantified term variable

          *)
        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
          (*

          An error occurred wile parsing an attribute

          *)
        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
        ]
        type builtin_meta_ttype = unit

        The bindings that can occur.

        type builtin_meta_ty = unit
        type builtin_meta_tags = unit

        Some type aliases

        type partial_semantics = [
        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
        ]
        type term_semantics = [
        1. | partial_semantics
        2. | `Total
        ]

        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

        type builtin_meta_term = term_semantics

        Meta data for term builtins.

        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

        Small record to hold the results of builtin parsing by theories.

        type builtin_res = [
        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
        6. | `Infer of binding * var_infer * sym_infer
        ]

        The result of parsing a symbol by the theory

        type not_found = [
        1. | `Not_found
        ]

        Not bound bindings

        type var_kind = [
        1. | `Let_bound
        2. | `Quantified
        3. | `Function_param
        4. | `Type_alias_param
        ]

        The type of kinds of variables

        type nonrec symbol = Intf.symbol =
        1. | Id of Dolmen.Std.Id.t
        2. | Builtin of Dolmen.Std.Term.builtin

        Wrapper around potential function symbols from the Dolmen AST.

        Errors and warnings

        type _ warn = ..

        The type of warnings, parameterized by the type of fragment they can trigger on

        type warn +=
        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
          (*

          Unused quantified type variable

          *)
        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
          (*

          Unused quantified term variable

          *)
        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
          (*

          An error occurred wile parsing an attribute

          *)
        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
          (*

          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

          *)
        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
          (*

          Redundant cases in pattern matching

          *)

        Warnings that cna trigger on regular parsed terms.

        type warn +=
        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
          (*

          Shadowing of the given identifier, together with the old and current binding.

          *)

        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

        type _ err = ..

        The type of errors, parameterized by the type of fragment they can trigger on

        type err +=
        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
          (*

          Not well-dounded datatypes definitions.

          *)

        Errors that occur on declaration(s)

        type err +=
        1. | Expected : string * res option -> Dolmen.Std.Term.t err
          (*

          The parsed term didn't match the expected shape

          *)
        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
          (*

          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

          *)
        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
          (*

          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

          *)
        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
          (*

          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

          *)
        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
          (*

          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

          *)
        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
          (*

          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

          *)
        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
          (*

          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Int/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Int/Tff/argument-1-Type/index.html index 578d6adc4..ccc571c9d 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Int/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Int/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

          Type definitions

          type order =
          1. | First_order
            (*

            First-oreder typechecking

            *)
          2. | Higher_order
            (*

            Higher-order typechecking

            *)

          Control whether the typechecker should type

          type poly =
          1. | Explicit
            (*

            Type arguments must be explicitly given in funciton applications

            *)
          2. | Implicit
            (*

            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

            *)
          3. | Flexible
            (*

            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

            *)

          The various polymorphism mode for the typechecker

          type sym_inference_source = {
          1. symbol : Dolmen.Std.Id.t;
          2. symbol_loc : Dolmen.Std.Loc.t;
          3. mutable inferred_ty : Ty.t;
          }
          type var_inference_source = {
          1. variable : Dolmen.Std.Id.t;
          2. variable_loc : Dolmen.Std.Loc.t;
          3. mutable inferred_ty : Ty.t;
          }
          type wildcard_source =
          1. | Arg_of of wildcard_source
          2. | Ret_of of wildcard_source
          3. | From_source of Dolmen.Std.Term.t
          4. | Added_type_argument of Dolmen.Std.Term.t
          5. | Symbol_inference of sym_inference_source
          6. | Variable_inference of var_inference_source
          type wildcard_shape =
          1. | Forbidden
          2. | Any_in_scope
          3. | Any_base of {
            1. allowed : Ty.t list;
            2. preferred : Ty.t;
            }
          4. | Arrow of {
            1. arg_shape : wildcard_shape;
            2. ret_shape : wildcard_shape;
            }
          type infer_unbound_var_scheme =
          1. | No_inference
          2. | Unification_type_variable
          type infer_term_scheme =
          1. | No_inference
          2. | Wildcard of wildcard_shape
          type var_infer = {
          1. infer_unbound_vars : infer_unbound_var_scheme;
          2. infer_type_vars_in_binding_pos : bool;
          3. infer_term_vars_in_binding_pos : infer_term_scheme;
          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
          }

          Specification of how to infer variables.

          type sym_infer = {
          1. infer_type_csts : bool;
          2. infer_term_csts : infer_term_scheme;
          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
          }

          Specification of how to infer symbols.

          type free_wildcards =
          1. | Forbidden
          2. | Implicitly_universally_quantified
          type expect =
          1. | Type
          2. | Term
          3. | Anything
          type tag =
          1. | Set : 'a Tag.t * 'a -> tag
          2. | Add : 'a list Tag.t * 'a -> tag
            (*

            Existencial wrapper around tags

            *)
          type res =
          1. | Ttype
          2. | Ty of Ty.t
          3. | Term of T.t
          4. | Tags of tag list

          The results of parsing an untyped term.

          type builtin_meta_ttype = unit
          type builtin_meta_ty = unit
          type builtin_meta_tags = unit

          Some type aliases

          type term_semantics = [
          1. | `Total
          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
          ]

          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

          type builtin_meta_term = term_semantics

          Meta data for term builtins.

          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

          Small record to hold the results of builtin parsing by theories.

          type builtin_res = [
          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
          6. | `Infer of string * var_infer * sym_infer
          ]

          The result of parsing a symbol by the theory

          type not_found = [
          1. | `Not_found
          ]

          Not bound bindings

          type reason =
          1. | Builtin
          2. | Reserved of string
          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
            (*

            The type of reasons for constant typing

            *)
          type binding = [
          1. | `Not_found
          2. | `Reserved of string
          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

            Type definitions

            type order =
            1. | First_order
              (*

              First-oreder typechecking

              *)
            2. | Higher_order
              (*

              Higher-order typechecking

              *)

            Control whether the typechecker should type

            type poly =
            1. | Explicit
              (*

              Type arguments must be explicitly given in funciton applications

              *)
            2. | Implicit
              (*

              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

              *)
            3. | Flexible
              (*

              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

              *)

            The various polymorphism mode for the typechecker

            type sym_inference_source = {
            1. symbol : Dolmen.Std.Id.t;
            2. symbol_loc : Dolmen.Std.Loc.t;
            3. mutable inferred_ty : Ty.t;
            }
            type var_inference_source = {
            1. variable : Dolmen.Std.Id.t;
            2. variable_loc : Dolmen.Std.Loc.t;
            3. mutable inferred_ty : Ty.t;
            }
            type wildcard_source =
            1. | Arg_of of wildcard_source
            2. | Ret_of of wildcard_source
            3. | From_source of Dolmen.Std.Term.t
            4. | Added_type_argument of Dolmen.Std.Term.t
            5. | Symbol_inference of sym_inference_source
            6. | Variable_inference of var_inference_source
            type wildcard_shape =
            1. | Forbidden
            2. | Any_in_scope
            3. | Any_base of {
              1. allowed : Ty.t list;
              2. preferred : Ty.t;
              }
            4. | Arrow of {
              1. arg_shape : wildcard_shape;
              2. ret_shape : wildcard_shape;
              }
            type infer_unbound_var_scheme =
            1. | No_inference
            2. | Unification_type_variable
            type infer_term_scheme =
            1. | No_inference
            2. | Wildcard of wildcard_shape
            type var_infer = {
            1. infer_unbound_vars : infer_unbound_var_scheme;
            2. infer_type_vars_in_binding_pos : bool;
            3. infer_term_vars_in_binding_pos : infer_term_scheme;
            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
            }

            Specification of how to infer variables.

            type sym_infer = {
            1. infer_type_csts : bool;
            2. infer_term_csts : infer_term_scheme;
            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
            }

            Specification of how to infer symbols.

            type free_wildcards =
            1. | Forbidden
            2. | Implicitly_universally_quantified
            type expect =
            1. | Type
            2. | Term
            3. | Anything
            type tag =
            1. | Set : 'a Tag.t * 'a -> tag
            2. | Add : 'a list Tag.t * 'a -> tag
              (*

              Existencial wrapper around tags

              *)
            type res =
            1. | Ttype
            2. | Ty of Ty.t
            3. | Term of T.t
            4. | Tags of tag list

            The results of parsing an untyped term.

            type reservation =
            1. | Strict
              (*

              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

              *)
            2. | Model_completion
              (*

              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

              *)

            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

            type reason =
            1. | Builtin
            2. | Reserved of reservation * string
            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
              (*

              The type of reasons for constant typing

              *)
            type binding = [
            1. | `Not_found
            2. | `Reserved of [ `Model of string | `Solver of string ]
            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
            ]

            The bindings that can occur.

            type var_kind = [
            1. | `Let_bound
            2. | `Quantified
            3. | `Function_param
            4. | `Type_alias_param
            ]

            The type of kinds of variables

            type nonrec symbol = Intf.symbol =
            1. | Id of Dolmen.Std.Id.t
            2. | Builtin of Dolmen.Std.Term.builtin

            Wrapper around potential function symbols from the Dolmen AST.

            Errors and warnings

            type _ warn = ..

            The type of warnings, parameterized by the type of fragment they can trigger on

            type warn +=
            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
              (*

              Unused quantified type variable

              *)
            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
              (*

              Unused quantified term variable

              *)
            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
              (*

              An error occurred wile parsing an attribute

              *)
            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
            ]
            type builtin_meta_ttype = unit

            The bindings that can occur.

            type builtin_meta_ty = unit
            type builtin_meta_tags = unit

            Some type aliases

            type partial_semantics = [
            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
            ]
            type term_semantics = [
            1. | partial_semantics
            2. | `Total
            ]

            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

            type builtin_meta_term = term_semantics

            Meta data for term builtins.

            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

            Small record to hold the results of builtin parsing by theories.

            type builtin_res = [
            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
            6. | `Infer of binding * var_infer * sym_infer
            ]

            The result of parsing a symbol by the theory

            type not_found = [
            1. | `Not_found
            ]

            Not bound bindings

            type var_kind = [
            1. | `Let_bound
            2. | `Quantified
            3. | `Function_param
            4. | `Type_alias_param
            ]

            The type of kinds of variables

            type nonrec symbol = Intf.symbol =
            1. | Id of Dolmen.Std.Id.t
            2. | Builtin of Dolmen.Std.Term.builtin

            Wrapper around potential function symbols from the Dolmen AST.

            Errors and warnings

            type _ warn = ..

            The type of warnings, parameterized by the type of fragment they can trigger on

            type warn +=
            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
              (*

              Unused quantified type variable

              *)
            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
              (*

              Unused quantified term variable

              *)
            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
              (*

              An error occurred wile parsing an attribute

              *)
            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
              (*

              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

              *)
            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
              (*

              Redundant cases in pattern matching

              *)

            Warnings that cna trigger on regular parsed terms.

            type warn +=
            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
              (*

              Shadowing of the given identifier, together with the old and current binding.

              *)

            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

            type _ err = ..

            The type of errors, parameterized by the type of fragment they can trigger on

            type err +=
            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
              (*

              Not well-dounded datatypes definitions.

              *)

            Errors that occur on declaration(s)

            type err +=
            1. | Expected : string * res option -> Dolmen.Std.Term.t err
              (*

              The parsed term didn't match the expected shape

              *)
            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
              (*

              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

              *)
            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
              (*

              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

              *)
            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
              (*

              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

              *)
            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
              (*

              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

              *)
            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
              (*

              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

              *)
            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
              (*

              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real/Tff/argument-1-Type/index.html index 26df60042..7e76a8008 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

              Type definitions

              type order =
              1. | First_order
                (*

                First-oreder typechecking

                *)
              2. | Higher_order
                (*

                Higher-order typechecking

                *)

              Control whether the typechecker should type

              type poly =
              1. | Explicit
                (*

                Type arguments must be explicitly given in funciton applications

                *)
              2. | Implicit
                (*

                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                *)
              3. | Flexible
                (*

                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                *)

              The various polymorphism mode for the typechecker

              type sym_inference_source = {
              1. symbol : Dolmen.Std.Id.t;
              2. symbol_loc : Dolmen.Std.Loc.t;
              3. mutable inferred_ty : Ty.t;
              }
              type var_inference_source = {
              1. variable : Dolmen.Std.Id.t;
              2. variable_loc : Dolmen.Std.Loc.t;
              3. mutable inferred_ty : Ty.t;
              }
              type wildcard_source =
              1. | Arg_of of wildcard_source
              2. | Ret_of of wildcard_source
              3. | From_source of Dolmen.Std.Term.t
              4. | Added_type_argument of Dolmen.Std.Term.t
              5. | Symbol_inference of sym_inference_source
              6. | Variable_inference of var_inference_source
              type wildcard_shape =
              1. | Forbidden
              2. | Any_in_scope
              3. | Any_base of {
                1. allowed : Ty.t list;
                2. preferred : Ty.t;
                }
              4. | Arrow of {
                1. arg_shape : wildcard_shape;
                2. ret_shape : wildcard_shape;
                }
              type infer_unbound_var_scheme =
              1. | No_inference
              2. | Unification_type_variable
              type infer_term_scheme =
              1. | No_inference
              2. | Wildcard of wildcard_shape
              type var_infer = {
              1. infer_unbound_vars : infer_unbound_var_scheme;
              2. infer_type_vars_in_binding_pos : bool;
              3. infer_term_vars_in_binding_pos : infer_term_scheme;
              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
              }

              Specification of how to infer variables.

              type sym_infer = {
              1. infer_type_csts : bool;
              2. infer_term_csts : infer_term_scheme;
              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
              }

              Specification of how to infer symbols.

              type free_wildcards =
              1. | Forbidden
              2. | Implicitly_universally_quantified
              type expect =
              1. | Type
              2. | Term
              3. | Anything
              type tag =
              1. | Set : 'a Tag.t * 'a -> tag
              2. | Add : 'a list Tag.t * 'a -> tag
                (*

                Existencial wrapper around tags

                *)
              type res =
              1. | Ttype
              2. | Ty of Ty.t
              3. | Term of T.t
              4. | Tags of tag list

              The results of parsing an untyped term.

              type builtin_meta_ttype = unit
              type builtin_meta_ty = unit
              type builtin_meta_tags = unit

              Some type aliases

              type term_semantics = [
              1. | `Total
              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
              ]

              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

              type builtin_meta_term = term_semantics

              Meta data for term builtins.

              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

              Small record to hold the results of builtin parsing by theories.

              type builtin_res = [
              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
              6. | `Infer of string * var_infer * sym_infer
              ]

              The result of parsing a symbol by the theory

              type not_found = [
              1. | `Not_found
              ]

              Not bound bindings

              type reason =
              1. | Builtin
              2. | Reserved of string
              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                (*

                The type of reasons for constant typing

                *)
              type binding = [
              1. | `Not_found
              2. | `Reserved of string
              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                Type definitions

                type order =
                1. | First_order
                  (*

                  First-oreder typechecking

                  *)
                2. | Higher_order
                  (*

                  Higher-order typechecking

                  *)

                Control whether the typechecker should type

                type poly =
                1. | Explicit
                  (*

                  Type arguments must be explicitly given in funciton applications

                  *)
                2. | Implicit
                  (*

                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                  *)
                3. | Flexible
                  (*

                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                  *)

                The various polymorphism mode for the typechecker

                type sym_inference_source = {
                1. symbol : Dolmen.Std.Id.t;
                2. symbol_loc : Dolmen.Std.Loc.t;
                3. mutable inferred_ty : Ty.t;
                }
                type var_inference_source = {
                1. variable : Dolmen.Std.Id.t;
                2. variable_loc : Dolmen.Std.Loc.t;
                3. mutable inferred_ty : Ty.t;
                }
                type wildcard_source =
                1. | Arg_of of wildcard_source
                2. | Ret_of of wildcard_source
                3. | From_source of Dolmen.Std.Term.t
                4. | Added_type_argument of Dolmen.Std.Term.t
                5. | Symbol_inference of sym_inference_source
                6. | Variable_inference of var_inference_source
                type wildcard_shape =
                1. | Forbidden
                2. | Any_in_scope
                3. | Any_base of {
                  1. allowed : Ty.t list;
                  2. preferred : Ty.t;
                  }
                4. | Arrow of {
                  1. arg_shape : wildcard_shape;
                  2. ret_shape : wildcard_shape;
                  }
                type infer_unbound_var_scheme =
                1. | No_inference
                2. | Unification_type_variable
                type infer_term_scheme =
                1. | No_inference
                2. | Wildcard of wildcard_shape
                type var_infer = {
                1. infer_unbound_vars : infer_unbound_var_scheme;
                2. infer_type_vars_in_binding_pos : bool;
                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                }

                Specification of how to infer variables.

                type sym_infer = {
                1. infer_type_csts : bool;
                2. infer_term_csts : infer_term_scheme;
                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                }

                Specification of how to infer symbols.

                type free_wildcards =
                1. | Forbidden
                2. | Implicitly_universally_quantified
                type expect =
                1. | Type
                2. | Term
                3. | Anything
                type tag =
                1. | Set : 'a Tag.t * 'a -> tag
                2. | Add : 'a list Tag.t * 'a -> tag
                  (*

                  Existencial wrapper around tags

                  *)
                type res =
                1. | Ttype
                2. | Ty of Ty.t
                3. | Term of T.t
                4. | Tags of tag list

                The results of parsing an untyped term.

                type reservation =
                1. | Strict
                  (*

                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                  *)
                2. | Model_completion
                  (*

                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                  *)

                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                type reason =
                1. | Builtin
                2. | Reserved of reservation * string
                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                  (*

                  The type of reasons for constant typing

                  *)
                type binding = [
                1. | `Not_found
                2. | `Reserved of [ `Model of string | `Solver of string ]
                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                ]

                The bindings that can occur.

                type var_kind = [
                1. | `Let_bound
                2. | `Quantified
                3. | `Function_param
                4. | `Type_alias_param
                ]

                The type of kinds of variables

                type nonrec symbol = Intf.symbol =
                1. | Id of Dolmen.Std.Id.t
                2. | Builtin of Dolmen.Std.Term.builtin

                Wrapper around potential function symbols from the Dolmen AST.

                Errors and warnings

                type _ warn = ..

                The type of warnings, parameterized by the type of fragment they can trigger on

                type warn +=
                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                  (*

                  Unused quantified type variable

                  *)
                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                  (*

                  Unused quantified term variable

                  *)
                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                  (*

                  An error occurred wile parsing an attribute

                  *)
                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                ]
                type builtin_meta_ttype = unit

                The bindings that can occur.

                type builtin_meta_ty = unit
                type builtin_meta_tags = unit

                Some type aliases

                type partial_semantics = [
                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                ]
                type term_semantics = [
                1. | partial_semantics
                2. | `Total
                ]

                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                type builtin_meta_term = term_semantics

                Meta data for term builtins.

                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                Small record to hold the results of builtin parsing by theories.

                type builtin_res = [
                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                6. | `Infer of binding * var_infer * sym_infer
                ]

                The result of parsing a symbol by the theory

                type not_found = [
                1. | `Not_found
                ]

                Not bound bindings

                type var_kind = [
                1. | `Let_bound
                2. | `Quantified
                3. | `Function_param
                4. | `Type_alias_param
                ]

                The type of kinds of variables

                type nonrec symbol = Intf.symbol =
                1. | Id of Dolmen.Std.Id.t
                2. | Builtin of Dolmen.Std.Term.builtin

                Wrapper around potential function symbols from the Dolmen AST.

                Errors and warnings

                type _ warn = ..

                The type of warnings, parameterized by the type of fragment they can trigger on

                type warn +=
                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                  (*

                  Unused quantified type variable

                  *)
                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                  (*

                  Unused quantified term variable

                  *)
                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                  (*

                  An error occurred wile parsing an attribute

                  *)
                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                  (*

                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                  *)
                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                  (*

                  Redundant cases in pattern matching

                  *)

                Warnings that cna trigger on regular parsed terms.

                type warn +=
                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                  (*

                  Shadowing of the given identifier, together with the old and current binding.

                  *)

                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                type _ err = ..

                The type of errors, parameterized by the type of fragment they can trigger on

                type err +=
                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                  (*

                  Not well-dounded datatypes definitions.

                  *)

                Errors that occur on declaration(s)

                type err +=
                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                  (*

                  The parsed term didn't match the expected shape

                  *)
                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                  (*

                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                  *)
                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                  (*

                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                  *)
                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                  (*

                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                  *)
                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                  (*

                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                  *)
                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                  (*

                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                  *)
                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                  (*

                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real_Int/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real_Int/Tff/argument-1-Type/index.html index 24126ed0c..6344d4cc6 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real_Int/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Smtlib2/Real_Int/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                  Type definitions

                  type order =
                  1. | First_order
                    (*

                    First-oreder typechecking

                    *)
                  2. | Higher_order
                    (*

                    Higher-order typechecking

                    *)

                  Control whether the typechecker should type

                  type poly =
                  1. | Explicit
                    (*

                    Type arguments must be explicitly given in funciton applications

                    *)
                  2. | Implicit
                    (*

                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                    *)
                  3. | Flexible
                    (*

                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                    *)

                  The various polymorphism mode for the typechecker

                  type sym_inference_source = {
                  1. symbol : Dolmen.Std.Id.t;
                  2. symbol_loc : Dolmen.Std.Loc.t;
                  3. mutable inferred_ty : Ty.t;
                  }
                  type var_inference_source = {
                  1. variable : Dolmen.Std.Id.t;
                  2. variable_loc : Dolmen.Std.Loc.t;
                  3. mutable inferred_ty : Ty.t;
                  }
                  type wildcard_source =
                  1. | Arg_of of wildcard_source
                  2. | Ret_of of wildcard_source
                  3. | From_source of Dolmen.Std.Term.t
                  4. | Added_type_argument of Dolmen.Std.Term.t
                  5. | Symbol_inference of sym_inference_source
                  6. | Variable_inference of var_inference_source
                  type wildcard_shape =
                  1. | Forbidden
                  2. | Any_in_scope
                  3. | Any_base of {
                    1. allowed : Ty.t list;
                    2. preferred : Ty.t;
                    }
                  4. | Arrow of {
                    1. arg_shape : wildcard_shape;
                    2. ret_shape : wildcard_shape;
                    }
                  type infer_unbound_var_scheme =
                  1. | No_inference
                  2. | Unification_type_variable
                  type infer_term_scheme =
                  1. | No_inference
                  2. | Wildcard of wildcard_shape
                  type var_infer = {
                  1. infer_unbound_vars : infer_unbound_var_scheme;
                  2. infer_type_vars_in_binding_pos : bool;
                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                  }

                  Specification of how to infer variables.

                  type sym_infer = {
                  1. infer_type_csts : bool;
                  2. infer_term_csts : infer_term_scheme;
                  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                  }

                  Specification of how to infer symbols.

                  type free_wildcards =
                  1. | Forbidden
                  2. | Implicitly_universally_quantified
                  type expect =
                  1. | Type
                  2. | Term
                  3. | Anything
                  type tag =
                  1. | Set : 'a Tag.t * 'a -> tag
                  2. | Add : 'a list Tag.t * 'a -> tag
                    (*

                    Existencial wrapper around tags

                    *)
                  type res =
                  1. | Ttype
                  2. | Ty of Ty.t
                  3. | Term of T.t
                  4. | Tags of tag list

                  The results of parsing an untyped term.

                  type builtin_meta_ttype = unit
                  type builtin_meta_ty = unit
                  type builtin_meta_tags = unit

                  Some type aliases

                  type term_semantics = [
                  1. | `Total
                  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                  ]

                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                  type builtin_meta_term = term_semantics

                  Meta data for term builtins.

                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                  Small record to hold the results of builtin parsing by theories.

                  type builtin_res = [
                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                  6. | `Infer of string * var_infer * sym_infer
                  ]

                  The result of parsing a symbol by the theory

                  type not_found = [
                  1. | `Not_found
                  ]

                  Not bound bindings

                  type reason =
                  1. | Builtin
                  2. | Reserved of string
                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                    (*

                    The type of reasons for constant typing

                    *)
                  type binding = [
                  1. | `Not_found
                  2. | `Reserved of string
                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                    Type definitions

                    type order =
                    1. | First_order
                      (*

                      First-oreder typechecking

                      *)
                    2. | Higher_order
                      (*

                      Higher-order typechecking

                      *)

                    Control whether the typechecker should type

                    type poly =
                    1. | Explicit
                      (*

                      Type arguments must be explicitly given in funciton applications

                      *)
                    2. | Implicit
                      (*

                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                      *)
                    3. | Flexible
                      (*

                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                      *)

                    The various polymorphism mode for the typechecker

                    type sym_inference_source = {
                    1. symbol : Dolmen.Std.Id.t;
                    2. symbol_loc : Dolmen.Std.Loc.t;
                    3. mutable inferred_ty : Ty.t;
                    }
                    type var_inference_source = {
                    1. variable : Dolmen.Std.Id.t;
                    2. variable_loc : Dolmen.Std.Loc.t;
                    3. mutable inferred_ty : Ty.t;
                    }
                    type wildcard_source =
                    1. | Arg_of of wildcard_source
                    2. | Ret_of of wildcard_source
                    3. | From_source of Dolmen.Std.Term.t
                    4. | Added_type_argument of Dolmen.Std.Term.t
                    5. | Symbol_inference of sym_inference_source
                    6. | Variable_inference of var_inference_source
                    type wildcard_shape =
                    1. | Forbidden
                    2. | Any_in_scope
                    3. | Any_base of {
                      1. allowed : Ty.t list;
                      2. preferred : Ty.t;
                      }
                    4. | Arrow of {
                      1. arg_shape : wildcard_shape;
                      2. ret_shape : wildcard_shape;
                      }
                    type infer_unbound_var_scheme =
                    1. | No_inference
                    2. | Unification_type_variable
                    type infer_term_scheme =
                    1. | No_inference
                    2. | Wildcard of wildcard_shape
                    type var_infer = {
                    1. infer_unbound_vars : infer_unbound_var_scheme;
                    2. infer_type_vars_in_binding_pos : bool;
                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                    }

                    Specification of how to infer variables.

                    type sym_infer = {
                    1. infer_type_csts : bool;
                    2. infer_term_csts : infer_term_scheme;
                    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                    }

                    Specification of how to infer symbols.

                    type free_wildcards =
                    1. | Forbidden
                    2. | Implicitly_universally_quantified
                    type expect =
                    1. | Type
                    2. | Term
                    3. | Anything
                    type tag =
                    1. | Set : 'a Tag.t * 'a -> tag
                    2. | Add : 'a list Tag.t * 'a -> tag
                      (*

                      Existencial wrapper around tags

                      *)
                    type res =
                    1. | Ttype
                    2. | Ty of Ty.t
                    3. | Term of T.t
                    4. | Tags of tag list

                    The results of parsing an untyped term.

                    type reservation =
                    1. | Strict
                      (*

                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                      *)
                    2. | Model_completion
                      (*

                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                      *)

                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                    type reason =
                    1. | Builtin
                    2. | Reserved of reservation * string
                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                      (*

                      The type of reasons for constant typing

                      *)
                    type binding = [
                    1. | `Not_found
                    2. | `Reserved of [ `Model of string | `Solver of string ]
                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                    ]

                    The bindings that can occur.

                    type var_kind = [
                    1. | `Let_bound
                    2. | `Quantified
                    3. | `Function_param
                    4. | `Type_alias_param
                    ]

                    The type of kinds of variables

                    type nonrec symbol = Intf.symbol =
                    1. | Id of Dolmen.Std.Id.t
                    2. | Builtin of Dolmen.Std.Term.builtin

                    Wrapper around potential function symbols from the Dolmen AST.

                    Errors and warnings

                    type _ warn = ..

                    The type of warnings, parameterized by the type of fragment they can trigger on

                    type warn +=
                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                      (*

                      Unused quantified type variable

                      *)
                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                      (*

                      Unused quantified term variable

                      *)
                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                      (*

                      An error occurred wile parsing an attribute

                      *)
                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                    ]
                    type builtin_meta_ttype = unit

                    The bindings that can occur.

                    type builtin_meta_ty = unit
                    type builtin_meta_tags = unit

                    Some type aliases

                    type partial_semantics = [
                    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                    ]
                    type term_semantics = [
                    1. | partial_semantics
                    2. | `Total
                    ]

                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                    type builtin_meta_term = term_semantics

                    Meta data for term builtins.

                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                    Small record to hold the results of builtin parsing by theories.

                    type builtin_res = [
                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                    6. | `Infer of binding * var_infer * sym_infer
                    ]

                    The result of parsing a symbol by the theory

                    type not_found = [
                    1. | `Not_found
                    ]

                    Not bound bindings

                    type var_kind = [
                    1. | `Let_bound
                    2. | `Quantified
                    3. | `Function_param
                    4. | `Type_alias_param
                    ]

                    The type of kinds of variables

                    type nonrec symbol = Intf.symbol =
                    1. | Id of Dolmen.Std.Id.t
                    2. | Builtin of Dolmen.Std.Term.builtin

                    Wrapper around potential function symbols from the Dolmen AST.

                    Errors and warnings

                    type _ warn = ..

                    The type of warnings, parameterized by the type of fragment they can trigger on

                    type warn +=
                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                      (*

                      Unused quantified type variable

                      *)
                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                      (*

                      Unused quantified term variable

                      *)
                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                      (*

                      An error occurred wile parsing an attribute

                      *)
                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                      (*

                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                      *)
                    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                      (*

                      Redundant cases in pattern matching

                      *)

                    Warnings that cna trigger on regular parsed terms.

                    type warn +=
                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                      (*

                      Shadowing of the given identifier, together with the old and current binding.

                      *)

                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                    type _ err = ..

                    The type of errors, parameterized by the type of fragment they can trigger on

                    type err +=
                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                      (*

                      Not well-dounded datatypes definitions.

                      *)

                    Errors that occur on declaration(s)

                    type err +=
                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                      (*

                      The parsed term didn't match the expected shape

                      *)
                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                      (*

                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                      *)
                    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                      (*

                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                      *)
                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                      (*

                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                      *)
                    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                      (*

                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                      *)
                    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                      (*

                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                      *)
                    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                      (*

                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Tptp/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Tptp/Tff/argument-1-Type/index.html index d9c6931bb..17b20f0bb 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Tptp/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Tptp/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                      Type definitions

                      type order =
                      1. | First_order
                        (*

                        First-oreder typechecking

                        *)
                      2. | Higher_order
                        (*

                        Higher-order typechecking

                        *)

                      Control whether the typechecker should type

                      type poly =
                      1. | Explicit
                        (*

                        Type arguments must be explicitly given in funciton applications

                        *)
                      2. | Implicit
                        (*

                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                        *)
                      3. | Flexible
                        (*

                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                        *)

                      The various polymorphism mode for the typechecker

                      type sym_inference_source = {
                      1. symbol : Dolmen.Std.Id.t;
                      2. symbol_loc : Dolmen.Std.Loc.t;
                      3. mutable inferred_ty : Ty.t;
                      }
                      type var_inference_source = {
                      1. variable : Dolmen.Std.Id.t;
                      2. variable_loc : Dolmen.Std.Loc.t;
                      3. mutable inferred_ty : Ty.t;
                      }
                      type wildcard_source =
                      1. | Arg_of of wildcard_source
                      2. | Ret_of of wildcard_source
                      3. | From_source of Dolmen.Std.Term.t
                      4. | Added_type_argument of Dolmen.Std.Term.t
                      5. | Symbol_inference of sym_inference_source
                      6. | Variable_inference of var_inference_source
                      type wildcard_shape =
                      1. | Forbidden
                      2. | Any_in_scope
                      3. | Any_base of {
                        1. allowed : Ty.t list;
                        2. preferred : Ty.t;
                        }
                      4. | Arrow of {
                        1. arg_shape : wildcard_shape;
                        2. ret_shape : wildcard_shape;
                        }
                      type infer_unbound_var_scheme =
                      1. | No_inference
                      2. | Unification_type_variable
                      type infer_term_scheme =
                      1. | No_inference
                      2. | Wildcard of wildcard_shape
                      type var_infer = {
                      1. infer_unbound_vars : infer_unbound_var_scheme;
                      2. infer_type_vars_in_binding_pos : bool;
                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                      }

                      Specification of how to infer variables.

                      type sym_infer = {
                      1. infer_type_csts : bool;
                      2. infer_term_csts : infer_term_scheme;
                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                      }

                      Specification of how to infer symbols.

                      type free_wildcards =
                      1. | Forbidden
                      2. | Implicitly_universally_quantified
                      type expect =
                      1. | Type
                      2. | Term
                      3. | Anything
                      type tag =
                      1. | Set : 'a Tag.t * 'a -> tag
                      2. | Add : 'a list Tag.t * 'a -> tag
                        (*

                        Existencial wrapper around tags

                        *)
                      type res =
                      1. | Ttype
                      2. | Ty of Ty.t
                      3. | Term of T.t
                      4. | Tags of tag list

                      The results of parsing an untyped term.

                      type builtin_meta_ttype = unit
                      type builtin_meta_ty = unit
                      type builtin_meta_tags = unit

                      Some type aliases

                      type term_semantics = [
                      1. | `Total
                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                      ]

                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                      type builtin_meta_term = term_semantics

                      Meta data for term builtins.

                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                      Small record to hold the results of builtin parsing by theories.

                      type builtin_res = [
                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                      6. | `Infer of string * var_infer * sym_infer
                      ]

                      The result of parsing a symbol by the theory

                      type not_found = [
                      1. | `Not_found
                      ]

                      Not bound bindings

                      type reason =
                      1. | Builtin
                      2. | Reserved of string
                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                        (*

                        The type of reasons for constant typing

                        *)
                      type binding = [
                      1. | `Not_found
                      2. | `Reserved of string
                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                        Type definitions

                        type order =
                        1. | First_order
                          (*

                          First-oreder typechecking

                          *)
                        2. | Higher_order
                          (*

                          Higher-order typechecking

                          *)

                        Control whether the typechecker should type

                        type poly =
                        1. | Explicit
                          (*

                          Type arguments must be explicitly given in funciton applications

                          *)
                        2. | Implicit
                          (*

                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                          *)
                        3. | Flexible
                          (*

                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                          *)

                        The various polymorphism mode for the typechecker

                        type sym_inference_source = {
                        1. symbol : Dolmen.Std.Id.t;
                        2. symbol_loc : Dolmen.Std.Loc.t;
                        3. mutable inferred_ty : Ty.t;
                        }
                        type var_inference_source = {
                        1. variable : Dolmen.Std.Id.t;
                        2. variable_loc : Dolmen.Std.Loc.t;
                        3. mutable inferred_ty : Ty.t;
                        }
                        type wildcard_source =
                        1. | Arg_of of wildcard_source
                        2. | Ret_of of wildcard_source
                        3. | From_source of Dolmen.Std.Term.t
                        4. | Added_type_argument of Dolmen.Std.Term.t
                        5. | Symbol_inference of sym_inference_source
                        6. | Variable_inference of var_inference_source
                        type wildcard_shape =
                        1. | Forbidden
                        2. | Any_in_scope
                        3. | Any_base of {
                          1. allowed : Ty.t list;
                          2. preferred : Ty.t;
                          }
                        4. | Arrow of {
                          1. arg_shape : wildcard_shape;
                          2. ret_shape : wildcard_shape;
                          }
                        type infer_unbound_var_scheme =
                        1. | No_inference
                        2. | Unification_type_variable
                        type infer_term_scheme =
                        1. | No_inference
                        2. | Wildcard of wildcard_shape
                        type var_infer = {
                        1. infer_unbound_vars : infer_unbound_var_scheme;
                        2. infer_type_vars_in_binding_pos : bool;
                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                        }

                        Specification of how to infer variables.

                        type sym_infer = {
                        1. infer_type_csts : bool;
                        2. infer_term_csts : infer_term_scheme;
                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                        }

                        Specification of how to infer symbols.

                        type free_wildcards =
                        1. | Forbidden
                        2. | Implicitly_universally_quantified
                        type expect =
                        1. | Type
                        2. | Term
                        3. | Anything
                        type tag =
                        1. | Set : 'a Tag.t * 'a -> tag
                        2. | Add : 'a list Tag.t * 'a -> tag
                          (*

                          Existencial wrapper around tags

                          *)
                        type res =
                        1. | Ttype
                        2. | Ty of Ty.t
                        3. | Term of T.t
                        4. | Tags of tag list

                        The results of parsing an untyped term.

                        type reservation =
                        1. | Strict
                          (*

                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                          *)
                        2. | Model_completion
                          (*

                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                          *)

                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                        type reason =
                        1. | Builtin
                        2. | Reserved of reservation * string
                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                          (*

                          The type of reasons for constant typing

                          *)
                        type binding = [
                        1. | `Not_found
                        2. | `Reserved of [ `Model of string | `Solver of string ]
                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                        ]

                        The bindings that can occur.

                        type var_kind = [
                        1. | `Let_bound
                        2. | `Quantified
                        3. | `Function_param
                        4. | `Type_alias_param
                        ]

                        The type of kinds of variables

                        type nonrec symbol = Intf.symbol =
                        1. | Id of Dolmen.Std.Id.t
                        2. | Builtin of Dolmen.Std.Term.builtin

                        Wrapper around potential function symbols from the Dolmen AST.

                        Errors and warnings

                        type _ warn = ..

                        The type of warnings, parameterized by the type of fragment they can trigger on

                        type warn +=
                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                          (*

                          Unused quantified type variable

                          *)
                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                          (*

                          Unused quantified term variable

                          *)
                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                          (*

                          An error occurred wile parsing an attribute

                          *)
                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                        ]
                        type builtin_meta_ttype = unit

                        The bindings that can occur.

                        type builtin_meta_ty = unit
                        type builtin_meta_tags = unit

                        Some type aliases

                        type partial_semantics = [
                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                        ]
                        type term_semantics = [
                        1. | partial_semantics
                        2. | `Total
                        ]

                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                        type builtin_meta_term = term_semantics

                        Meta data for term builtins.

                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                        Small record to hold the results of builtin parsing by theories.

                        type builtin_res = [
                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                        6. | `Infer of binding * var_infer * sym_infer
                        ]

                        The result of parsing a symbol by the theory

                        type not_found = [
                        1. | `Not_found
                        ]

                        Not bound bindings

                        type var_kind = [
                        1. | `Let_bound
                        2. | `Quantified
                        3. | `Function_param
                        4. | `Type_alias_param
                        ]

                        The type of kinds of variables

                        type nonrec symbol = Intf.symbol =
                        1. | Id of Dolmen.Std.Id.t
                        2. | Builtin of Dolmen.Std.Term.builtin

                        Wrapper around potential function symbols from the Dolmen AST.

                        Errors and warnings

                        type _ warn = ..

                        The type of warnings, parameterized by the type of fragment they can trigger on

                        type warn +=
                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                          (*

                          Unused quantified type variable

                          *)
                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                          (*

                          Unused quantified term variable

                          *)
                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                          (*

                          An error occurred wile parsing an attribute

                          *)
                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                          (*

                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                          *)
                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                          (*

                          Redundant cases in pattern matching

                          *)

                        Warnings that cna trigger on regular parsed terms.

                        type warn +=
                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                          (*

                          Shadowing of the given identifier, together with the old and current binding.

                          *)

                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                        type _ err = ..

                        The type of errors, parameterized by the type of fragment they can trigger on

                        type err +=
                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                          (*

                          Not well-dounded datatypes definitions.

                          *)

                        Errors that occur on declaration(s)

                        type err +=
                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                          (*

                          The parsed term didn't match the expected shape

                          *)
                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                          (*

                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                          *)
                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                          (*

                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                          *)
                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                          (*

                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                          *)
                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                          (*

                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                          *)
                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                          (*

                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                          *)
                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                          (*

                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arith/Zf/Thf/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arith/Zf/Thf/argument-1-Type/index.html index e01d4237d..0f9eaf66e 100644 --- a/dev/dolmen_type/Dolmen_type/Arith/Zf/Thf/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arith/Zf/Thf/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                          Type definitions

                          type order =
                          1. | First_order
                            (*

                            First-oreder typechecking

                            *)
                          2. | Higher_order
                            (*

                            Higher-order typechecking

                            *)

                          Control whether the typechecker should type

                          type poly =
                          1. | Explicit
                            (*

                            Type arguments must be explicitly given in funciton applications

                            *)
                          2. | Implicit
                            (*

                            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                            *)
                          3. | Flexible
                            (*

                            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                            *)

                          The various polymorphism mode for the typechecker

                          type sym_inference_source = {
                          1. symbol : Dolmen.Std.Id.t;
                          2. symbol_loc : Dolmen.Std.Loc.t;
                          3. mutable inferred_ty : Ty.t;
                          }
                          type var_inference_source = {
                          1. variable : Dolmen.Std.Id.t;
                          2. variable_loc : Dolmen.Std.Loc.t;
                          3. mutable inferred_ty : Ty.t;
                          }
                          type wildcard_source =
                          1. | Arg_of of wildcard_source
                          2. | Ret_of of wildcard_source
                          3. | From_source of Dolmen.Std.Term.t
                          4. | Added_type_argument of Dolmen.Std.Term.t
                          5. | Symbol_inference of sym_inference_source
                          6. | Variable_inference of var_inference_source
                          type wildcard_shape =
                          1. | Forbidden
                          2. | Any_in_scope
                          3. | Any_base of {
                            1. allowed : Ty.t list;
                            2. preferred : Ty.t;
                            }
                          4. | Arrow of {
                            1. arg_shape : wildcard_shape;
                            2. ret_shape : wildcard_shape;
                            }
                          type infer_unbound_var_scheme =
                          1. | No_inference
                          2. | Unification_type_variable
                          type infer_term_scheme =
                          1. | No_inference
                          2. | Wildcard of wildcard_shape
                          type var_infer = {
                          1. infer_unbound_vars : infer_unbound_var_scheme;
                          2. infer_type_vars_in_binding_pos : bool;
                          3. infer_term_vars_in_binding_pos : infer_term_scheme;
                          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                          }

                          Specification of how to infer variables.

                          type sym_infer = {
                          1. infer_type_csts : bool;
                          2. infer_term_csts : infer_term_scheme;
                          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                          }

                          Specification of how to infer symbols.

                          type free_wildcards =
                          1. | Forbidden
                          2. | Implicitly_universally_quantified
                          type expect =
                          1. | Type
                          2. | Term
                          3. | Anything
                          type tag =
                          1. | Set : 'a Tag.t * 'a -> tag
                          2. | Add : 'a list Tag.t * 'a -> tag
                            (*

                            Existencial wrapper around tags

                            *)
                          type res =
                          1. | Ttype
                          2. | Ty of Ty.t
                          3. | Term of T.t
                          4. | Tags of tag list

                          The results of parsing an untyped term.

                          type builtin_meta_ttype = unit
                          type builtin_meta_ty = unit
                          type builtin_meta_tags = unit

                          Some type aliases

                          type term_semantics = [
                          1. | `Total
                          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                          ]

                          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                          type builtin_meta_term = term_semantics

                          Meta data for term builtins.

                          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                          Small record to hold the results of builtin parsing by theories.

                          type builtin_res = [
                          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                          6. | `Infer of string * var_infer * sym_infer
                          ]

                          The result of parsing a symbol by the theory

                          type not_found = [
                          1. | `Not_found
                          ]

                          Not bound bindings

                          type reason =
                          1. | Builtin
                          2. | Reserved of string
                          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                            (*

                            The type of reasons for constant typing

                            *)
                          type binding = [
                          1. | `Not_found
                          2. | `Reserved of string
                          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                            Type definitions

                            type order =
                            1. | First_order
                              (*

                              First-oreder typechecking

                              *)
                            2. | Higher_order
                              (*

                              Higher-order typechecking

                              *)

                            Control whether the typechecker should type

                            type poly =
                            1. | Explicit
                              (*

                              Type arguments must be explicitly given in funciton applications

                              *)
                            2. | Implicit
                              (*

                              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                              *)
                            3. | Flexible
                              (*

                              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                              *)

                            The various polymorphism mode for the typechecker

                            type sym_inference_source = {
                            1. symbol : Dolmen.Std.Id.t;
                            2. symbol_loc : Dolmen.Std.Loc.t;
                            3. mutable inferred_ty : Ty.t;
                            }
                            type var_inference_source = {
                            1. variable : Dolmen.Std.Id.t;
                            2. variable_loc : Dolmen.Std.Loc.t;
                            3. mutable inferred_ty : Ty.t;
                            }
                            type wildcard_source =
                            1. | Arg_of of wildcard_source
                            2. | Ret_of of wildcard_source
                            3. | From_source of Dolmen.Std.Term.t
                            4. | Added_type_argument of Dolmen.Std.Term.t
                            5. | Symbol_inference of sym_inference_source
                            6. | Variable_inference of var_inference_source
                            type wildcard_shape =
                            1. | Forbidden
                            2. | Any_in_scope
                            3. | Any_base of {
                              1. allowed : Ty.t list;
                              2. preferred : Ty.t;
                              }
                            4. | Arrow of {
                              1. arg_shape : wildcard_shape;
                              2. ret_shape : wildcard_shape;
                              }
                            type infer_unbound_var_scheme =
                            1. | No_inference
                            2. | Unification_type_variable
                            type infer_term_scheme =
                            1. | No_inference
                            2. | Wildcard of wildcard_shape
                            type var_infer = {
                            1. infer_unbound_vars : infer_unbound_var_scheme;
                            2. infer_type_vars_in_binding_pos : bool;
                            3. infer_term_vars_in_binding_pos : infer_term_scheme;
                            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                            }

                            Specification of how to infer variables.

                            type sym_infer = {
                            1. infer_type_csts : bool;
                            2. infer_term_csts : infer_term_scheme;
                            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                            }

                            Specification of how to infer symbols.

                            type free_wildcards =
                            1. | Forbidden
                            2. | Implicitly_universally_quantified
                            type expect =
                            1. | Type
                            2. | Term
                            3. | Anything
                            type tag =
                            1. | Set : 'a Tag.t * 'a -> tag
                            2. | Add : 'a list Tag.t * 'a -> tag
                              (*

                              Existencial wrapper around tags

                              *)
                            type res =
                            1. | Ttype
                            2. | Ty of Ty.t
                            3. | Term of T.t
                            4. | Tags of tag list

                            The results of parsing an untyped term.

                            type reservation =
                            1. | Strict
                              (*

                              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                              *)
                            2. | Model_completion
                              (*

                              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                              *)

                            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                            type reason =
                            1. | Builtin
                            2. | Reserved of reservation * string
                            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                              (*

                              The type of reasons for constant typing

                              *)
                            type binding = [
                            1. | `Not_found
                            2. | `Reserved of [ `Model of string | `Solver of string ]
                            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                            ]

                            The bindings that can occur.

                            type var_kind = [
                            1. | `Let_bound
                            2. | `Quantified
                            3. | `Function_param
                            4. | `Type_alias_param
                            ]

                            The type of kinds of variables

                            type nonrec symbol = Intf.symbol =
                            1. | Id of Dolmen.Std.Id.t
                            2. | Builtin of Dolmen.Std.Term.builtin

                            Wrapper around potential function symbols from the Dolmen AST.

                            Errors and warnings

                            type _ warn = ..

                            The type of warnings, parameterized by the type of fragment they can trigger on

                            type warn +=
                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                              (*

                              Unused quantified type variable

                              *)
                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                              (*

                              Unused quantified term variable

                              *)
                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                              (*

                              An error occurred wile parsing an attribute

                              *)
                            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                            ]
                            type builtin_meta_ttype = unit

                            The bindings that can occur.

                            type builtin_meta_ty = unit
                            type builtin_meta_tags = unit

                            Some type aliases

                            type partial_semantics = [
                            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                            ]
                            type term_semantics = [
                            1. | partial_semantics
                            2. | `Total
                            ]

                            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                            type builtin_meta_term = term_semantics

                            Meta data for term builtins.

                            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                            Small record to hold the results of builtin parsing by theories.

                            type builtin_res = [
                            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                            6. | `Infer of binding * var_infer * sym_infer
                            ]

                            The result of parsing a symbol by the theory

                            type not_found = [
                            1. | `Not_found
                            ]

                            Not bound bindings

                            type var_kind = [
                            1. | `Let_bound
                            2. | `Quantified
                            3. | `Function_param
                            4. | `Type_alias_param
                            ]

                            The type of kinds of variables

                            type nonrec symbol = Intf.symbol =
                            1. | Id of Dolmen.Std.Id.t
                            2. | Builtin of Dolmen.Std.Term.builtin

                            Wrapper around potential function symbols from the Dolmen AST.

                            Errors and warnings

                            type _ warn = ..

                            The type of warnings, parameterized by the type of fragment they can trigger on

                            type warn +=
                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                              (*

                              Unused quantified type variable

                              *)
                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                              (*

                              Unused quantified term variable

                              *)
                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                              (*

                              An error occurred wile parsing an attribute

                              *)
                            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                              (*

                              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                              *)
                            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                              (*

                              Redundant cases in pattern matching

                              *)

                            Warnings that cna trigger on regular parsed terms.

                            type warn +=
                            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                              (*

                              Shadowing of the given identifier, together with the old and current binding.

                              *)

                            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                            type _ err = ..

                            The type of errors, parameterized by the type of fragment they can trigger on

                            type err +=
                            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                              (*

                              Not well-dounded datatypes definitions.

                              *)

                            Errors that occur on declaration(s)

                            type err +=
                            1. | Expected : string * res option -> Dolmen.Std.Term.t err
                              (*

                              The parsed term didn't match the expected shape

                              *)
                            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                              (*

                              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                              *)
                            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                              (*

                              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                              *)
                            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                              (*

                              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                              *)
                            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                              (*

                              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                              *)
                            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                              (*

                              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                              *)
                            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                              (*

                              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arrays/Ae/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arrays/Ae/Tff/argument-1-Type/index.html index 12ed9941c..5c29ea0c3 100644 --- a/dev/dolmen_type/Dolmen_type/Arrays/Ae/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arrays/Ae/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                              Type definitions

                              type order =
                              1. | First_order
                                (*

                                First-oreder typechecking

                                *)
                              2. | Higher_order
                                (*

                                Higher-order typechecking

                                *)

                              Control whether the typechecker should type

                              type poly =
                              1. | Explicit
                                (*

                                Type arguments must be explicitly given in funciton applications

                                *)
                              2. | Implicit
                                (*

                                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                *)
                              3. | Flexible
                                (*

                                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                *)

                              The various polymorphism mode for the typechecker

                              type sym_inference_source = {
                              1. symbol : Dolmen.Std.Id.t;
                              2. symbol_loc : Dolmen.Std.Loc.t;
                              3. mutable inferred_ty : Ty.t;
                              }
                              type var_inference_source = {
                              1. variable : Dolmen.Std.Id.t;
                              2. variable_loc : Dolmen.Std.Loc.t;
                              3. mutable inferred_ty : Ty.t;
                              }
                              type wildcard_source =
                              1. | Arg_of of wildcard_source
                              2. | Ret_of of wildcard_source
                              3. | From_source of Dolmen.Std.Term.t
                              4. | Added_type_argument of Dolmen.Std.Term.t
                              5. | Symbol_inference of sym_inference_source
                              6. | Variable_inference of var_inference_source
                              type wildcard_shape =
                              1. | Forbidden
                              2. | Any_in_scope
                              3. | Any_base of {
                                1. allowed : Ty.t list;
                                2. preferred : Ty.t;
                                }
                              4. | Arrow of {
                                1. arg_shape : wildcard_shape;
                                2. ret_shape : wildcard_shape;
                                }
                              type infer_unbound_var_scheme =
                              1. | No_inference
                              2. | Unification_type_variable
                              type infer_term_scheme =
                              1. | No_inference
                              2. | Wildcard of wildcard_shape
                              type var_infer = {
                              1. infer_unbound_vars : infer_unbound_var_scheme;
                              2. infer_type_vars_in_binding_pos : bool;
                              3. infer_term_vars_in_binding_pos : infer_term_scheme;
                              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                              }

                              Specification of how to infer variables.

                              type sym_infer = {
                              1. infer_type_csts : bool;
                              2. infer_term_csts : infer_term_scheme;
                              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                              }

                              Specification of how to infer symbols.

                              type free_wildcards =
                              1. | Forbidden
                              2. | Implicitly_universally_quantified
                              type expect =
                              1. | Type
                              2. | Term
                              3. | Anything
                              type tag =
                              1. | Set : 'a Tag.t * 'a -> tag
                              2. | Add : 'a list Tag.t * 'a -> tag
                                (*

                                Existencial wrapper around tags

                                *)
                              type res =
                              1. | Ttype
                              2. | Ty of Ty.t
                              3. | Term of T.t
                              4. | Tags of tag list

                              The results of parsing an untyped term.

                              type builtin_meta_ttype = unit
                              type builtin_meta_ty = unit
                              type builtin_meta_tags = unit

                              Some type aliases

                              type term_semantics = [
                              1. | `Total
                              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                              ]

                              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                              type builtin_meta_term = term_semantics

                              Meta data for term builtins.

                              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                              Small record to hold the results of builtin parsing by theories.

                              type builtin_res = [
                              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                              6. | `Infer of string * var_infer * sym_infer
                              ]

                              The result of parsing a symbol by the theory

                              type not_found = [
                              1. | `Not_found
                              ]

                              Not bound bindings

                              type reason =
                              1. | Builtin
                              2. | Reserved of string
                              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                (*

                                The type of reasons for constant typing

                                *)
                              type binding = [
                              1. | `Not_found
                              2. | `Reserved of string
                              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                Type definitions

                                type order =
                                1. | First_order
                                  (*

                                  First-oreder typechecking

                                  *)
                                2. | Higher_order
                                  (*

                                  Higher-order typechecking

                                  *)

                                Control whether the typechecker should type

                                type poly =
                                1. | Explicit
                                  (*

                                  Type arguments must be explicitly given in funciton applications

                                  *)
                                2. | Implicit
                                  (*

                                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                  *)
                                3. | Flexible
                                  (*

                                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                  *)

                                The various polymorphism mode for the typechecker

                                type sym_inference_source = {
                                1. symbol : Dolmen.Std.Id.t;
                                2. symbol_loc : Dolmen.Std.Loc.t;
                                3. mutable inferred_ty : Ty.t;
                                }
                                type var_inference_source = {
                                1. variable : Dolmen.Std.Id.t;
                                2. variable_loc : Dolmen.Std.Loc.t;
                                3. mutable inferred_ty : Ty.t;
                                }
                                type wildcard_source =
                                1. | Arg_of of wildcard_source
                                2. | Ret_of of wildcard_source
                                3. | From_source of Dolmen.Std.Term.t
                                4. | Added_type_argument of Dolmen.Std.Term.t
                                5. | Symbol_inference of sym_inference_source
                                6. | Variable_inference of var_inference_source
                                type wildcard_shape =
                                1. | Forbidden
                                2. | Any_in_scope
                                3. | Any_base of {
                                  1. allowed : Ty.t list;
                                  2. preferred : Ty.t;
                                  }
                                4. | Arrow of {
                                  1. arg_shape : wildcard_shape;
                                  2. ret_shape : wildcard_shape;
                                  }
                                type infer_unbound_var_scheme =
                                1. | No_inference
                                2. | Unification_type_variable
                                type infer_term_scheme =
                                1. | No_inference
                                2. | Wildcard of wildcard_shape
                                type var_infer = {
                                1. infer_unbound_vars : infer_unbound_var_scheme;
                                2. infer_type_vars_in_binding_pos : bool;
                                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                }

                                Specification of how to infer variables.

                                type sym_infer = {
                                1. infer_type_csts : bool;
                                2. infer_term_csts : infer_term_scheme;
                                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                }

                                Specification of how to infer symbols.

                                type free_wildcards =
                                1. | Forbidden
                                2. | Implicitly_universally_quantified
                                type expect =
                                1. | Type
                                2. | Term
                                3. | Anything
                                type tag =
                                1. | Set : 'a Tag.t * 'a -> tag
                                2. | Add : 'a list Tag.t * 'a -> tag
                                  (*

                                  Existencial wrapper around tags

                                  *)
                                type res =
                                1. | Ttype
                                2. | Ty of Ty.t
                                3. | Term of T.t
                                4. | Tags of tag list

                                The results of parsing an untyped term.

                                type reservation =
                                1. | Strict
                                  (*

                                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                  *)
                                2. | Model_completion
                                  (*

                                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                  *)

                                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                type reason =
                                1. | Builtin
                                2. | Reserved of reservation * string
                                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                  (*

                                  The type of reasons for constant typing

                                  *)
                                type binding = [
                                1. | `Not_found
                                2. | `Reserved of [ `Model of string | `Solver of string ]
                                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                ]

                                The bindings that can occur.

                                type var_kind = [
                                1. | `Let_bound
                                2. | `Quantified
                                3. | `Function_param
                                4. | `Type_alias_param
                                ]

                                The type of kinds of variables

                                type nonrec symbol = Intf.symbol =
                                1. | Id of Dolmen.Std.Id.t
                                2. | Builtin of Dolmen.Std.Term.builtin

                                Wrapper around potential function symbols from the Dolmen AST.

                                Errors and warnings

                                type _ warn = ..

                                The type of warnings, parameterized by the type of fragment they can trigger on

                                type warn +=
                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                  (*

                                  Unused quantified type variable

                                  *)
                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                  (*

                                  Unused quantified term variable

                                  *)
                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                  (*

                                  An error occurred wile parsing an attribute

                                  *)
                                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                ]
                                type builtin_meta_ttype = unit

                                The bindings that can occur.

                                type builtin_meta_ty = unit
                                type builtin_meta_tags = unit

                                Some type aliases

                                type partial_semantics = [
                                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                ]
                                type term_semantics = [
                                1. | partial_semantics
                                2. | `Total
                                ]

                                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                type builtin_meta_term = term_semantics

                                Meta data for term builtins.

                                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                Small record to hold the results of builtin parsing by theories.

                                type builtin_res = [
                                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                6. | `Infer of binding * var_infer * sym_infer
                                ]

                                The result of parsing a symbol by the theory

                                type not_found = [
                                1. | `Not_found
                                ]

                                Not bound bindings

                                type var_kind = [
                                1. | `Let_bound
                                2. | `Quantified
                                3. | `Function_param
                                4. | `Type_alias_param
                                ]

                                The type of kinds of variables

                                type nonrec symbol = Intf.symbol =
                                1. | Id of Dolmen.Std.Id.t
                                2. | Builtin of Dolmen.Std.Term.builtin

                                Wrapper around potential function symbols from the Dolmen AST.

                                Errors and warnings

                                type _ warn = ..

                                The type of warnings, parameterized by the type of fragment they can trigger on

                                type warn +=
                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                  (*

                                  Unused quantified type variable

                                  *)
                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                  (*

                                  Unused quantified term variable

                                  *)
                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                  (*

                                  An error occurred wile parsing an attribute

                                  *)
                                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                  (*

                                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                  *)
                                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                  (*

                                  Redundant cases in pattern matching

                                  *)

                                Warnings that cna trigger on regular parsed terms.

                                type warn +=
                                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                  (*

                                  Shadowing of the given identifier, together with the old and current binding.

                                  *)

                                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                type _ err = ..

                                The type of errors, parameterized by the type of fragment they can trigger on

                                type err +=
                                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                  (*

                                  Not well-dounded datatypes definitions.

                                  *)

                                Errors that occur on declaration(s)

                                type err +=
                                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                  (*

                                  The parsed term didn't match the expected shape

                                  *)
                                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                  *)
                                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                  *)
                                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                  *)
                                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                  *)
                                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                  *)
                                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                  (*

                                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Arrays/Smtlib2/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Arrays/Smtlib2/Tff/argument-1-Type/index.html index ef3c57b58..f6111dcb3 100644 --- a/dev/dolmen_type/Dolmen_type/Arrays/Smtlib2/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Arrays/Smtlib2/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                  Type definitions

                                  type order =
                                  1. | First_order
                                    (*

                                    First-oreder typechecking

                                    *)
                                  2. | Higher_order
                                    (*

                                    Higher-order typechecking

                                    *)

                                  Control whether the typechecker should type

                                  type poly =
                                  1. | Explicit
                                    (*

                                    Type arguments must be explicitly given in funciton applications

                                    *)
                                  2. | Implicit
                                    (*

                                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                    *)
                                  3. | Flexible
                                    (*

                                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                    *)

                                  The various polymorphism mode for the typechecker

                                  type sym_inference_source = {
                                  1. symbol : Dolmen.Std.Id.t;
                                  2. symbol_loc : Dolmen.Std.Loc.t;
                                  3. mutable inferred_ty : Ty.t;
                                  }
                                  type var_inference_source = {
                                  1. variable : Dolmen.Std.Id.t;
                                  2. variable_loc : Dolmen.Std.Loc.t;
                                  3. mutable inferred_ty : Ty.t;
                                  }
                                  type wildcard_source =
                                  1. | Arg_of of wildcard_source
                                  2. | Ret_of of wildcard_source
                                  3. | From_source of Dolmen.Std.Term.t
                                  4. | Added_type_argument of Dolmen.Std.Term.t
                                  5. | Symbol_inference of sym_inference_source
                                  6. | Variable_inference of var_inference_source
                                  type wildcard_shape =
                                  1. | Forbidden
                                  2. | Any_in_scope
                                  3. | Any_base of {
                                    1. allowed : Ty.t list;
                                    2. preferred : Ty.t;
                                    }
                                  4. | Arrow of {
                                    1. arg_shape : wildcard_shape;
                                    2. ret_shape : wildcard_shape;
                                    }
                                  type infer_unbound_var_scheme =
                                  1. | No_inference
                                  2. | Unification_type_variable
                                  type infer_term_scheme =
                                  1. | No_inference
                                  2. | Wildcard of wildcard_shape
                                  type var_infer = {
                                  1. infer_unbound_vars : infer_unbound_var_scheme;
                                  2. infer_type_vars_in_binding_pos : bool;
                                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                  }

                                  Specification of how to infer variables.

                                  type sym_infer = {
                                  1. infer_type_csts : bool;
                                  2. infer_term_csts : infer_term_scheme;
                                  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                  }

                                  Specification of how to infer symbols.

                                  type free_wildcards =
                                  1. | Forbidden
                                  2. | Implicitly_universally_quantified
                                  type expect =
                                  1. | Type
                                  2. | Term
                                  3. | Anything
                                  type tag =
                                  1. | Set : 'a Tag.t * 'a -> tag
                                  2. | Add : 'a list Tag.t * 'a -> tag
                                    (*

                                    Existencial wrapper around tags

                                    *)
                                  type res =
                                  1. | Ttype
                                  2. | Ty of Ty.t
                                  3. | Term of T.t
                                  4. | Tags of tag list

                                  The results of parsing an untyped term.

                                  type builtin_meta_ttype = unit
                                  type builtin_meta_ty = unit
                                  type builtin_meta_tags = unit

                                  Some type aliases

                                  type term_semantics = [
                                  1. | `Total
                                  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                  ]

                                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                  type builtin_meta_term = term_semantics

                                  Meta data for term builtins.

                                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                  Small record to hold the results of builtin parsing by theories.

                                  type builtin_res = [
                                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                  6. | `Infer of string * var_infer * sym_infer
                                  ]

                                  The result of parsing a symbol by the theory

                                  type not_found = [
                                  1. | `Not_found
                                  ]

                                  Not bound bindings

                                  type reason =
                                  1. | Builtin
                                  2. | Reserved of string
                                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                    (*

                                    The type of reasons for constant typing

                                    *)
                                  type binding = [
                                  1. | `Not_found
                                  2. | `Reserved of string
                                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                    Type definitions

                                    type order =
                                    1. | First_order
                                      (*

                                      First-oreder typechecking

                                      *)
                                    2. | Higher_order
                                      (*

                                      Higher-order typechecking

                                      *)

                                    Control whether the typechecker should type

                                    type poly =
                                    1. | Explicit
                                      (*

                                      Type arguments must be explicitly given in funciton applications

                                      *)
                                    2. | Implicit
                                      (*

                                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                      *)
                                    3. | Flexible
                                      (*

                                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                      *)

                                    The various polymorphism mode for the typechecker

                                    type sym_inference_source = {
                                    1. symbol : Dolmen.Std.Id.t;
                                    2. symbol_loc : Dolmen.Std.Loc.t;
                                    3. mutable inferred_ty : Ty.t;
                                    }
                                    type var_inference_source = {
                                    1. variable : Dolmen.Std.Id.t;
                                    2. variable_loc : Dolmen.Std.Loc.t;
                                    3. mutable inferred_ty : Ty.t;
                                    }
                                    type wildcard_source =
                                    1. | Arg_of of wildcard_source
                                    2. | Ret_of of wildcard_source
                                    3. | From_source of Dolmen.Std.Term.t
                                    4. | Added_type_argument of Dolmen.Std.Term.t
                                    5. | Symbol_inference of sym_inference_source
                                    6. | Variable_inference of var_inference_source
                                    type wildcard_shape =
                                    1. | Forbidden
                                    2. | Any_in_scope
                                    3. | Any_base of {
                                      1. allowed : Ty.t list;
                                      2. preferred : Ty.t;
                                      }
                                    4. | Arrow of {
                                      1. arg_shape : wildcard_shape;
                                      2. ret_shape : wildcard_shape;
                                      }
                                    type infer_unbound_var_scheme =
                                    1. | No_inference
                                    2. | Unification_type_variable
                                    type infer_term_scheme =
                                    1. | No_inference
                                    2. | Wildcard of wildcard_shape
                                    type var_infer = {
                                    1. infer_unbound_vars : infer_unbound_var_scheme;
                                    2. infer_type_vars_in_binding_pos : bool;
                                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                    }

                                    Specification of how to infer variables.

                                    type sym_infer = {
                                    1. infer_type_csts : bool;
                                    2. infer_term_csts : infer_term_scheme;
                                    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                    }

                                    Specification of how to infer symbols.

                                    type free_wildcards =
                                    1. | Forbidden
                                    2. | Implicitly_universally_quantified
                                    type expect =
                                    1. | Type
                                    2. | Term
                                    3. | Anything
                                    type tag =
                                    1. | Set : 'a Tag.t * 'a -> tag
                                    2. | Add : 'a list Tag.t * 'a -> tag
                                      (*

                                      Existencial wrapper around tags

                                      *)
                                    type res =
                                    1. | Ttype
                                    2. | Ty of Ty.t
                                    3. | Term of T.t
                                    4. | Tags of tag list

                                    The results of parsing an untyped term.

                                    type reservation =
                                    1. | Strict
                                      (*

                                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                      *)
                                    2. | Model_completion
                                      (*

                                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                      *)

                                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                    type reason =
                                    1. | Builtin
                                    2. | Reserved of reservation * string
                                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                      (*

                                      The type of reasons for constant typing

                                      *)
                                    type binding = [
                                    1. | `Not_found
                                    2. | `Reserved of [ `Model of string | `Solver of string ]
                                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                    ]

                                    The bindings that can occur.

                                    type var_kind = [
                                    1. | `Let_bound
                                    2. | `Quantified
                                    3. | `Function_param
                                    4. | `Type_alias_param
                                    ]

                                    The type of kinds of variables

                                    type nonrec symbol = Intf.symbol =
                                    1. | Id of Dolmen.Std.Id.t
                                    2. | Builtin of Dolmen.Std.Term.builtin

                                    Wrapper around potential function symbols from the Dolmen AST.

                                    Errors and warnings

                                    type _ warn = ..

                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                    type warn +=
                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                      (*

                                      Unused quantified type variable

                                      *)
                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                      (*

                                      Unused quantified term variable

                                      *)
                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                      (*

                                      An error occurred wile parsing an attribute

                                      *)
                                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                    ]
                                    type builtin_meta_ttype = unit

                                    The bindings that can occur.

                                    type builtin_meta_ty = unit
                                    type builtin_meta_tags = unit

                                    Some type aliases

                                    type partial_semantics = [
                                    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                    ]
                                    type term_semantics = [
                                    1. | partial_semantics
                                    2. | `Total
                                    ]

                                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                    type builtin_meta_term = term_semantics

                                    Meta data for term builtins.

                                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                    Small record to hold the results of builtin parsing by theories.

                                    type builtin_res = [
                                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                    6. | `Infer of binding * var_infer * sym_infer
                                    ]

                                    The result of parsing a symbol by the theory

                                    type not_found = [
                                    1. | `Not_found
                                    ]

                                    Not bound bindings

                                    type var_kind = [
                                    1. | `Let_bound
                                    2. | `Quantified
                                    3. | `Function_param
                                    4. | `Type_alias_param
                                    ]

                                    The type of kinds of variables

                                    type nonrec symbol = Intf.symbol =
                                    1. | Id of Dolmen.Std.Id.t
                                    2. | Builtin of Dolmen.Std.Term.builtin

                                    Wrapper around potential function symbols from the Dolmen AST.

                                    Errors and warnings

                                    type _ warn = ..

                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                    type warn +=
                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                      (*

                                      Unused quantified type variable

                                      *)
                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                      (*

                                      Unused quantified term variable

                                      *)
                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                      (*

                                      An error occurred wile parsing an attribute

                                      *)
                                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                      (*

                                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                      *)
                                    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                      (*

                                      Redundant cases in pattern matching

                                      *)

                                    Warnings that cna trigger on regular parsed terms.

                                    type warn +=
                                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                      (*

                                      Shadowing of the given identifier, together with the old and current binding.

                                      *)

                                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                    type _ err = ..

                                    The type of errors, parameterized by the type of fragment they can trigger on

                                    type err +=
                                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                      (*

                                      Not well-dounded datatypes definitions.

                                      *)

                                    Errors that occur on declaration(s)

                                    type err +=
                                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                      (*

                                      The parsed term didn't match the expected shape

                                      *)
                                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                      *)
                                    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                      *)
                                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                      *)
                                    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                      *)
                                    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                      *)
                                    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                      (*

                                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Bitv/Ae/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Bitv/Ae/Tff/argument-1-Type/index.html index bda85ebf8..595543698 100644 --- a/dev/dolmen_type/Dolmen_type/Bitv/Ae/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Bitv/Ae/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                      Type definitions

                                      type order =
                                      1. | First_order
                                        (*

                                        First-oreder typechecking

                                        *)
                                      2. | Higher_order
                                        (*

                                        Higher-order typechecking

                                        *)

                                      Control whether the typechecker should type

                                      type poly =
                                      1. | Explicit
                                        (*

                                        Type arguments must be explicitly given in funciton applications

                                        *)
                                      2. | Implicit
                                        (*

                                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                        *)
                                      3. | Flexible
                                        (*

                                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                        *)

                                      The various polymorphism mode for the typechecker

                                      type sym_inference_source = {
                                      1. symbol : Dolmen.Std.Id.t;
                                      2. symbol_loc : Dolmen.Std.Loc.t;
                                      3. mutable inferred_ty : Ty.t;
                                      }
                                      type var_inference_source = {
                                      1. variable : Dolmen.Std.Id.t;
                                      2. variable_loc : Dolmen.Std.Loc.t;
                                      3. mutable inferred_ty : Ty.t;
                                      }
                                      type wildcard_source =
                                      1. | Arg_of of wildcard_source
                                      2. | Ret_of of wildcard_source
                                      3. | From_source of Dolmen.Std.Term.t
                                      4. | Added_type_argument of Dolmen.Std.Term.t
                                      5. | Symbol_inference of sym_inference_source
                                      6. | Variable_inference of var_inference_source
                                      type wildcard_shape =
                                      1. | Forbidden
                                      2. | Any_in_scope
                                      3. | Any_base of {
                                        1. allowed : Ty.t list;
                                        2. preferred : Ty.t;
                                        }
                                      4. | Arrow of {
                                        1. arg_shape : wildcard_shape;
                                        2. ret_shape : wildcard_shape;
                                        }
                                      type infer_unbound_var_scheme =
                                      1. | No_inference
                                      2. | Unification_type_variable
                                      type infer_term_scheme =
                                      1. | No_inference
                                      2. | Wildcard of wildcard_shape
                                      type var_infer = {
                                      1. infer_unbound_vars : infer_unbound_var_scheme;
                                      2. infer_type_vars_in_binding_pos : bool;
                                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                      }

                                      Specification of how to infer variables.

                                      type sym_infer = {
                                      1. infer_type_csts : bool;
                                      2. infer_term_csts : infer_term_scheme;
                                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                      }

                                      Specification of how to infer symbols.

                                      type free_wildcards =
                                      1. | Forbidden
                                      2. | Implicitly_universally_quantified
                                      type expect =
                                      1. | Type
                                      2. | Term
                                      3. | Anything
                                      type tag =
                                      1. | Set : 'a Tag.t * 'a -> tag
                                      2. | Add : 'a list Tag.t * 'a -> tag
                                        (*

                                        Existencial wrapper around tags

                                        *)
                                      type res =
                                      1. | Ttype
                                      2. | Ty of Ty.t
                                      3. | Term of T.t
                                      4. | Tags of tag list

                                      The results of parsing an untyped term.

                                      type builtin_meta_ttype = unit
                                      type builtin_meta_ty = unit
                                      type builtin_meta_tags = unit

                                      Some type aliases

                                      type term_semantics = [
                                      1. | `Total
                                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                      ]

                                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                      type builtin_meta_term = term_semantics

                                      Meta data for term builtins.

                                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                      Small record to hold the results of builtin parsing by theories.

                                      type builtin_res = [
                                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                      6. | `Infer of string * var_infer * sym_infer
                                      ]

                                      The result of parsing a symbol by the theory

                                      type not_found = [
                                      1. | `Not_found
                                      ]

                                      Not bound bindings

                                      type reason =
                                      1. | Builtin
                                      2. | Reserved of string
                                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                        (*

                                        The type of reasons for constant typing

                                        *)
                                      type binding = [
                                      1. | `Not_found
                                      2. | `Reserved of string
                                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                        Type definitions

                                        type order =
                                        1. | First_order
                                          (*

                                          First-oreder typechecking

                                          *)
                                        2. | Higher_order
                                          (*

                                          Higher-order typechecking

                                          *)

                                        Control whether the typechecker should type

                                        type poly =
                                        1. | Explicit
                                          (*

                                          Type arguments must be explicitly given in funciton applications

                                          *)
                                        2. | Implicit
                                          (*

                                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                          *)
                                        3. | Flexible
                                          (*

                                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                          *)

                                        The various polymorphism mode for the typechecker

                                        type sym_inference_source = {
                                        1. symbol : Dolmen.Std.Id.t;
                                        2. symbol_loc : Dolmen.Std.Loc.t;
                                        3. mutable inferred_ty : Ty.t;
                                        }
                                        type var_inference_source = {
                                        1. variable : Dolmen.Std.Id.t;
                                        2. variable_loc : Dolmen.Std.Loc.t;
                                        3. mutable inferred_ty : Ty.t;
                                        }
                                        type wildcard_source =
                                        1. | Arg_of of wildcard_source
                                        2. | Ret_of of wildcard_source
                                        3. | From_source of Dolmen.Std.Term.t
                                        4. | Added_type_argument of Dolmen.Std.Term.t
                                        5. | Symbol_inference of sym_inference_source
                                        6. | Variable_inference of var_inference_source
                                        type wildcard_shape =
                                        1. | Forbidden
                                        2. | Any_in_scope
                                        3. | Any_base of {
                                          1. allowed : Ty.t list;
                                          2. preferred : Ty.t;
                                          }
                                        4. | Arrow of {
                                          1. arg_shape : wildcard_shape;
                                          2. ret_shape : wildcard_shape;
                                          }
                                        type infer_unbound_var_scheme =
                                        1. | No_inference
                                        2. | Unification_type_variable
                                        type infer_term_scheme =
                                        1. | No_inference
                                        2. | Wildcard of wildcard_shape
                                        type var_infer = {
                                        1. infer_unbound_vars : infer_unbound_var_scheme;
                                        2. infer_type_vars_in_binding_pos : bool;
                                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                        }

                                        Specification of how to infer variables.

                                        type sym_infer = {
                                        1. infer_type_csts : bool;
                                        2. infer_term_csts : infer_term_scheme;
                                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                        }

                                        Specification of how to infer symbols.

                                        type free_wildcards =
                                        1. | Forbidden
                                        2. | Implicitly_universally_quantified
                                        type expect =
                                        1. | Type
                                        2. | Term
                                        3. | Anything
                                        type tag =
                                        1. | Set : 'a Tag.t * 'a -> tag
                                        2. | Add : 'a list Tag.t * 'a -> tag
                                          (*

                                          Existencial wrapper around tags

                                          *)
                                        type res =
                                        1. | Ttype
                                        2. | Ty of Ty.t
                                        3. | Term of T.t
                                        4. | Tags of tag list

                                        The results of parsing an untyped term.

                                        type reservation =
                                        1. | Strict
                                          (*

                                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                          *)
                                        2. | Model_completion
                                          (*

                                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                          *)

                                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                        type reason =
                                        1. | Builtin
                                        2. | Reserved of reservation * string
                                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                          (*

                                          The type of reasons for constant typing

                                          *)
                                        type binding = [
                                        1. | `Not_found
                                        2. | `Reserved of [ `Model of string | `Solver of string ]
                                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                        ]

                                        The bindings that can occur.

                                        type var_kind = [
                                        1. | `Let_bound
                                        2. | `Quantified
                                        3. | `Function_param
                                        4. | `Type_alias_param
                                        ]

                                        The type of kinds of variables

                                        type nonrec symbol = Intf.symbol =
                                        1. | Id of Dolmen.Std.Id.t
                                        2. | Builtin of Dolmen.Std.Term.builtin

                                        Wrapper around potential function symbols from the Dolmen AST.

                                        Errors and warnings

                                        type _ warn = ..

                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                        type warn +=
                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                          (*

                                          Unused quantified type variable

                                          *)
                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                          (*

                                          Unused quantified term variable

                                          *)
                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                          (*

                                          An error occurred wile parsing an attribute

                                          *)
                                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                        ]
                                        type builtin_meta_ttype = unit

                                        The bindings that can occur.

                                        type builtin_meta_ty = unit
                                        type builtin_meta_tags = unit

                                        Some type aliases

                                        type partial_semantics = [
                                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                        ]
                                        type term_semantics = [
                                        1. | partial_semantics
                                        2. | `Total
                                        ]

                                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                        type builtin_meta_term = term_semantics

                                        Meta data for term builtins.

                                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                        Small record to hold the results of builtin parsing by theories.

                                        type builtin_res = [
                                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                        6. | `Infer of binding * var_infer * sym_infer
                                        ]

                                        The result of parsing a symbol by the theory

                                        type not_found = [
                                        1. | `Not_found
                                        ]

                                        Not bound bindings

                                        type var_kind = [
                                        1. | `Let_bound
                                        2. | `Quantified
                                        3. | `Function_param
                                        4. | `Type_alias_param
                                        ]

                                        The type of kinds of variables

                                        type nonrec symbol = Intf.symbol =
                                        1. | Id of Dolmen.Std.Id.t
                                        2. | Builtin of Dolmen.Std.Term.builtin

                                        Wrapper around potential function symbols from the Dolmen AST.

                                        Errors and warnings

                                        type _ warn = ..

                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                        type warn +=
                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                          (*

                                          Unused quantified type variable

                                          *)
                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                          (*

                                          Unused quantified term variable

                                          *)
                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                          (*

                                          An error occurred wile parsing an attribute

                                          *)
                                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                          (*

                                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                          *)
                                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                          (*

                                          Redundant cases in pattern matching

                                          *)

                                        Warnings that cna trigger on regular parsed terms.

                                        type warn +=
                                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                          (*

                                          Shadowing of the given identifier, together with the old and current binding.

                                          *)

                                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                        type _ err = ..

                                        The type of errors, parameterized by the type of fragment they can trigger on

                                        type err +=
                                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                          (*

                                          Not well-dounded datatypes definitions.

                                          *)

                                        Errors that occur on declaration(s)

                                        type err +=
                                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                          (*

                                          The parsed term didn't match the expected shape

                                          *)
                                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                          *)
                                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                          *)
                                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                          *)
                                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                          *)
                                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                          *)
                                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                          (*

                                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Bitv/Smtlib2/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Bitv/Smtlib2/Tff/argument-1-Type/index.html index cdbf13925..ef9888c20 100644 --- a/dev/dolmen_type/Dolmen_type/Bitv/Smtlib2/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Bitv/Smtlib2/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                          Type definitions

                                          type order =
                                          1. | First_order
                                            (*

                                            First-oreder typechecking

                                            *)
                                          2. | Higher_order
                                            (*

                                            Higher-order typechecking

                                            *)

                                          Control whether the typechecker should type

                                          type poly =
                                          1. | Explicit
                                            (*

                                            Type arguments must be explicitly given in funciton applications

                                            *)
                                          2. | Implicit
                                            (*

                                            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                            *)
                                          3. | Flexible
                                            (*

                                            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                            *)

                                          The various polymorphism mode for the typechecker

                                          type sym_inference_source = {
                                          1. symbol : Dolmen.Std.Id.t;
                                          2. symbol_loc : Dolmen.Std.Loc.t;
                                          3. mutable inferred_ty : Ty.t;
                                          }
                                          type var_inference_source = {
                                          1. variable : Dolmen.Std.Id.t;
                                          2. variable_loc : Dolmen.Std.Loc.t;
                                          3. mutable inferred_ty : Ty.t;
                                          }
                                          type wildcard_source =
                                          1. | Arg_of of wildcard_source
                                          2. | Ret_of of wildcard_source
                                          3. | From_source of Dolmen.Std.Term.t
                                          4. | Added_type_argument of Dolmen.Std.Term.t
                                          5. | Symbol_inference of sym_inference_source
                                          6. | Variable_inference of var_inference_source
                                          type wildcard_shape =
                                          1. | Forbidden
                                          2. | Any_in_scope
                                          3. | Any_base of {
                                            1. allowed : Ty.t list;
                                            2. preferred : Ty.t;
                                            }
                                          4. | Arrow of {
                                            1. arg_shape : wildcard_shape;
                                            2. ret_shape : wildcard_shape;
                                            }
                                          type infer_unbound_var_scheme =
                                          1. | No_inference
                                          2. | Unification_type_variable
                                          type infer_term_scheme =
                                          1. | No_inference
                                          2. | Wildcard of wildcard_shape
                                          type var_infer = {
                                          1. infer_unbound_vars : infer_unbound_var_scheme;
                                          2. infer_type_vars_in_binding_pos : bool;
                                          3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                          }

                                          Specification of how to infer variables.

                                          type sym_infer = {
                                          1. infer_type_csts : bool;
                                          2. infer_term_csts : infer_term_scheme;
                                          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                          }

                                          Specification of how to infer symbols.

                                          type free_wildcards =
                                          1. | Forbidden
                                          2. | Implicitly_universally_quantified
                                          type expect =
                                          1. | Type
                                          2. | Term
                                          3. | Anything
                                          type tag =
                                          1. | Set : 'a Tag.t * 'a -> tag
                                          2. | Add : 'a list Tag.t * 'a -> tag
                                            (*

                                            Existencial wrapper around tags

                                            *)
                                          type res =
                                          1. | Ttype
                                          2. | Ty of Ty.t
                                          3. | Term of T.t
                                          4. | Tags of tag list

                                          The results of parsing an untyped term.

                                          type builtin_meta_ttype = unit
                                          type builtin_meta_ty = unit
                                          type builtin_meta_tags = unit

                                          Some type aliases

                                          type term_semantics = [
                                          1. | `Total
                                          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                          ]

                                          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                          type builtin_meta_term = term_semantics

                                          Meta data for term builtins.

                                          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                          Small record to hold the results of builtin parsing by theories.

                                          type builtin_res = [
                                          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                          6. | `Infer of string * var_infer * sym_infer
                                          ]

                                          The result of parsing a symbol by the theory

                                          type not_found = [
                                          1. | `Not_found
                                          ]

                                          Not bound bindings

                                          type reason =
                                          1. | Builtin
                                          2. | Reserved of string
                                          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                            (*

                                            The type of reasons for constant typing

                                            *)
                                          type binding = [
                                          1. | `Not_found
                                          2. | `Reserved of string
                                          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                            Type definitions

                                            type order =
                                            1. | First_order
                                              (*

                                              First-oreder typechecking

                                              *)
                                            2. | Higher_order
                                              (*

                                              Higher-order typechecking

                                              *)

                                            Control whether the typechecker should type

                                            type poly =
                                            1. | Explicit
                                              (*

                                              Type arguments must be explicitly given in funciton applications

                                              *)
                                            2. | Implicit
                                              (*

                                              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                              *)
                                            3. | Flexible
                                              (*

                                              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                              *)

                                            The various polymorphism mode for the typechecker

                                            type sym_inference_source = {
                                            1. symbol : Dolmen.Std.Id.t;
                                            2. symbol_loc : Dolmen.Std.Loc.t;
                                            3. mutable inferred_ty : Ty.t;
                                            }
                                            type var_inference_source = {
                                            1. variable : Dolmen.Std.Id.t;
                                            2. variable_loc : Dolmen.Std.Loc.t;
                                            3. mutable inferred_ty : Ty.t;
                                            }
                                            type wildcard_source =
                                            1. | Arg_of of wildcard_source
                                            2. | Ret_of of wildcard_source
                                            3. | From_source of Dolmen.Std.Term.t
                                            4. | Added_type_argument of Dolmen.Std.Term.t
                                            5. | Symbol_inference of sym_inference_source
                                            6. | Variable_inference of var_inference_source
                                            type wildcard_shape =
                                            1. | Forbidden
                                            2. | Any_in_scope
                                            3. | Any_base of {
                                              1. allowed : Ty.t list;
                                              2. preferred : Ty.t;
                                              }
                                            4. | Arrow of {
                                              1. arg_shape : wildcard_shape;
                                              2. ret_shape : wildcard_shape;
                                              }
                                            type infer_unbound_var_scheme =
                                            1. | No_inference
                                            2. | Unification_type_variable
                                            type infer_term_scheme =
                                            1. | No_inference
                                            2. | Wildcard of wildcard_shape
                                            type var_infer = {
                                            1. infer_unbound_vars : infer_unbound_var_scheme;
                                            2. infer_type_vars_in_binding_pos : bool;
                                            3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                            }

                                            Specification of how to infer variables.

                                            type sym_infer = {
                                            1. infer_type_csts : bool;
                                            2. infer_term_csts : infer_term_scheme;
                                            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                            }

                                            Specification of how to infer symbols.

                                            type free_wildcards =
                                            1. | Forbidden
                                            2. | Implicitly_universally_quantified
                                            type expect =
                                            1. | Type
                                            2. | Term
                                            3. | Anything
                                            type tag =
                                            1. | Set : 'a Tag.t * 'a -> tag
                                            2. | Add : 'a list Tag.t * 'a -> tag
                                              (*

                                              Existencial wrapper around tags

                                              *)
                                            type res =
                                            1. | Ttype
                                            2. | Ty of Ty.t
                                            3. | Term of T.t
                                            4. | Tags of tag list

                                            The results of parsing an untyped term.

                                            type reservation =
                                            1. | Strict
                                              (*

                                              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                              *)
                                            2. | Model_completion
                                              (*

                                              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                              *)

                                            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                            type reason =
                                            1. | Builtin
                                            2. | Reserved of reservation * string
                                            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                              (*

                                              The type of reasons for constant typing

                                              *)
                                            type binding = [
                                            1. | `Not_found
                                            2. | `Reserved of [ `Model of string | `Solver of string ]
                                            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                            ]

                                            The bindings that can occur.

                                            type var_kind = [
                                            1. | `Let_bound
                                            2. | `Quantified
                                            3. | `Function_param
                                            4. | `Type_alias_param
                                            ]

                                            The type of kinds of variables

                                            type nonrec symbol = Intf.symbol =
                                            1. | Id of Dolmen.Std.Id.t
                                            2. | Builtin of Dolmen.Std.Term.builtin

                                            Wrapper around potential function symbols from the Dolmen AST.

                                            Errors and warnings

                                            type _ warn = ..

                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                            type warn +=
                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                              (*

                                              Unused quantified type variable

                                              *)
                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                              (*

                                              Unused quantified term variable

                                              *)
                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                              (*

                                              An error occurred wile parsing an attribute

                                              *)
                                            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                            ]
                                            type builtin_meta_ttype = unit

                                            The bindings that can occur.

                                            type builtin_meta_ty = unit
                                            type builtin_meta_tags = unit

                                            Some type aliases

                                            type partial_semantics = [
                                            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                            ]
                                            type term_semantics = [
                                            1. | partial_semantics
                                            2. | `Total
                                            ]

                                            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                            type builtin_meta_term = term_semantics

                                            Meta data for term builtins.

                                            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                            Small record to hold the results of builtin parsing by theories.

                                            type builtin_res = [
                                            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                            6. | `Infer of binding * var_infer * sym_infer
                                            ]

                                            The result of parsing a symbol by the theory

                                            type not_found = [
                                            1. | `Not_found
                                            ]

                                            Not bound bindings

                                            type var_kind = [
                                            1. | `Let_bound
                                            2. | `Quantified
                                            3. | `Function_param
                                            4. | `Type_alias_param
                                            ]

                                            The type of kinds of variables

                                            type nonrec symbol = Intf.symbol =
                                            1. | Id of Dolmen.Std.Id.t
                                            2. | Builtin of Dolmen.Std.Term.builtin

                                            Wrapper around potential function symbols from the Dolmen AST.

                                            Errors and warnings

                                            type _ warn = ..

                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                            type warn +=
                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                              (*

                                              Unused quantified type variable

                                              *)
                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                              (*

                                              Unused quantified term variable

                                              *)
                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                              (*

                                              An error occurred wile parsing an attribute

                                              *)
                                            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                              (*

                                              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                              *)
                                            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                              (*

                                              Redundant cases in pattern matching

                                              *)

                                            Warnings that cna trigger on regular parsed terms.

                                            type warn +=
                                            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                              (*

                                              Shadowing of the given identifier, together with the old and current binding.

                                              *)

                                            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                            type _ err = ..

                                            The type of errors, parameterized by the type of fragment they can trigger on

                                            type err +=
                                            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                              (*

                                              Not well-dounded datatypes definitions.

                                              *)

                                            Errors that occur on declaration(s)

                                            type err +=
                                            1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                              (*

                                              The parsed term didn't match the expected shape

                                              *)
                                            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                              *)
                                            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                              *)
                                            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                              *)
                                            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                              *)
                                            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                              *)
                                            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                              (*

                                              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Ae/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Ae/Tff/argument-1-Type/index.html index 59f539a29..6d813d586 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Ae/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Ae/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                              Type definitions

                                              type order =
                                              1. | First_order
                                                (*

                                                First-oreder typechecking

                                                *)
                                              2. | Higher_order
                                                (*

                                                Higher-order typechecking

                                                *)

                                              Control whether the typechecker should type

                                              type poly =
                                              1. | Explicit
                                                (*

                                                Type arguments must be explicitly given in funciton applications

                                                *)
                                              2. | Implicit
                                                (*

                                                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                *)
                                              3. | Flexible
                                                (*

                                                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                *)

                                              The various polymorphism mode for the typechecker

                                              type sym_inference_source = {
                                              1. symbol : Dolmen.Std.Id.t;
                                              2. symbol_loc : Dolmen.Std.Loc.t;
                                              3. mutable inferred_ty : Ty.t;
                                              }
                                              type var_inference_source = {
                                              1. variable : Dolmen.Std.Id.t;
                                              2. variable_loc : Dolmen.Std.Loc.t;
                                              3. mutable inferred_ty : Ty.t;
                                              }
                                              type wildcard_source =
                                              1. | Arg_of of wildcard_source
                                              2. | Ret_of of wildcard_source
                                              3. | From_source of Dolmen.Std.Term.t
                                              4. | Added_type_argument of Dolmen.Std.Term.t
                                              5. | Symbol_inference of sym_inference_source
                                              6. | Variable_inference of var_inference_source
                                              type wildcard_shape =
                                              1. | Forbidden
                                              2. | Any_in_scope
                                              3. | Any_base of {
                                                1. allowed : Ty.t list;
                                                2. preferred : Ty.t;
                                                }
                                              4. | Arrow of {
                                                1. arg_shape : wildcard_shape;
                                                2. ret_shape : wildcard_shape;
                                                }
                                              type infer_unbound_var_scheme =
                                              1. | No_inference
                                              2. | Unification_type_variable
                                              type infer_term_scheme =
                                              1. | No_inference
                                              2. | Wildcard of wildcard_shape
                                              type var_infer = {
                                              1. infer_unbound_vars : infer_unbound_var_scheme;
                                              2. infer_type_vars_in_binding_pos : bool;
                                              3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                              }

                                              Specification of how to infer variables.

                                              type sym_infer = {
                                              1. infer_type_csts : bool;
                                              2. infer_term_csts : infer_term_scheme;
                                              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                              }

                                              Specification of how to infer symbols.

                                              type free_wildcards =
                                              1. | Forbidden
                                              2. | Implicitly_universally_quantified
                                              type expect =
                                              1. | Type
                                              2. | Term
                                              3. | Anything
                                              type tag =
                                              1. | Set : 'a Tag.t * 'a -> tag
                                              2. | Add : 'a list Tag.t * 'a -> tag
                                                (*

                                                Existencial wrapper around tags

                                                *)
                                              type res =
                                              1. | Ttype
                                              2. | Ty of Ty.t
                                              3. | Term of T.t
                                              4. | Tags of tag list

                                              The results of parsing an untyped term.

                                              type builtin_meta_ttype = unit
                                              type builtin_meta_ty = unit
                                              type builtin_meta_tags = unit

                                              Some type aliases

                                              type term_semantics = [
                                              1. | `Total
                                              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                              ]

                                              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                              type builtin_meta_term = term_semantics

                                              Meta data for term builtins.

                                              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                              Small record to hold the results of builtin parsing by theories.

                                              type builtin_res = [
                                              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                              6. | `Infer of string * var_infer * sym_infer
                                              ]

                                              The result of parsing a symbol by the theory

                                              type not_found = [
                                              1. | `Not_found
                                              ]

                                              Not bound bindings

                                              type reason =
                                              1. | Builtin
                                              2. | Reserved of string
                                              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                (*

                                                The type of reasons for constant typing

                                                *)
                                              type binding = [
                                              1. | `Not_found
                                              2. | `Reserved of string
                                              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                Type definitions

                                                type order =
                                                1. | First_order
                                                  (*

                                                  First-oreder typechecking

                                                  *)
                                                2. | Higher_order
                                                  (*

                                                  Higher-order typechecking

                                                  *)

                                                Control whether the typechecker should type

                                                type poly =
                                                1. | Explicit
                                                  (*

                                                  Type arguments must be explicitly given in funciton applications

                                                  *)
                                                2. | Implicit
                                                  (*

                                                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                  *)
                                                3. | Flexible
                                                  (*

                                                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                  *)

                                                The various polymorphism mode for the typechecker

                                                type sym_inference_source = {
                                                1. symbol : Dolmen.Std.Id.t;
                                                2. symbol_loc : Dolmen.Std.Loc.t;
                                                3. mutable inferred_ty : Ty.t;
                                                }
                                                type var_inference_source = {
                                                1. variable : Dolmen.Std.Id.t;
                                                2. variable_loc : Dolmen.Std.Loc.t;
                                                3. mutable inferred_ty : Ty.t;
                                                }
                                                type wildcard_source =
                                                1. | Arg_of of wildcard_source
                                                2. | Ret_of of wildcard_source
                                                3. | From_source of Dolmen.Std.Term.t
                                                4. | Added_type_argument of Dolmen.Std.Term.t
                                                5. | Symbol_inference of sym_inference_source
                                                6. | Variable_inference of var_inference_source
                                                type wildcard_shape =
                                                1. | Forbidden
                                                2. | Any_in_scope
                                                3. | Any_base of {
                                                  1. allowed : Ty.t list;
                                                  2. preferred : Ty.t;
                                                  }
                                                4. | Arrow of {
                                                  1. arg_shape : wildcard_shape;
                                                  2. ret_shape : wildcard_shape;
                                                  }
                                                type infer_unbound_var_scheme =
                                                1. | No_inference
                                                2. | Unification_type_variable
                                                type infer_term_scheme =
                                                1. | No_inference
                                                2. | Wildcard of wildcard_shape
                                                type var_infer = {
                                                1. infer_unbound_vars : infer_unbound_var_scheme;
                                                2. infer_type_vars_in_binding_pos : bool;
                                                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                }

                                                Specification of how to infer variables.

                                                type sym_infer = {
                                                1. infer_type_csts : bool;
                                                2. infer_term_csts : infer_term_scheme;
                                                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                }

                                                Specification of how to infer symbols.

                                                type free_wildcards =
                                                1. | Forbidden
                                                2. | Implicitly_universally_quantified
                                                type expect =
                                                1. | Type
                                                2. | Term
                                                3. | Anything
                                                type tag =
                                                1. | Set : 'a Tag.t * 'a -> tag
                                                2. | Add : 'a list Tag.t * 'a -> tag
                                                  (*

                                                  Existencial wrapper around tags

                                                  *)
                                                type res =
                                                1. | Ttype
                                                2. | Ty of Ty.t
                                                3. | Term of T.t
                                                4. | Tags of tag list

                                                The results of parsing an untyped term.

                                                type reservation =
                                                1. | Strict
                                                  (*

                                                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                  *)
                                                2. | Model_completion
                                                  (*

                                                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                  *)

                                                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                type reason =
                                                1. | Builtin
                                                2. | Reserved of reservation * string
                                                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                  (*

                                                  The type of reasons for constant typing

                                                  *)
                                                type binding = [
                                                1. | `Not_found
                                                2. | `Reserved of [ `Model of string | `Solver of string ]
                                                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                ]

                                                The bindings that can occur.

                                                type var_kind = [
                                                1. | `Let_bound
                                                2. | `Quantified
                                                3. | `Function_param
                                                4. | `Type_alias_param
                                                ]

                                                The type of kinds of variables

                                                type nonrec symbol = Intf.symbol =
                                                1. | Id of Dolmen.Std.Id.t
                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                Wrapper around potential function symbols from the Dolmen AST.

                                                Errors and warnings

                                                type _ warn = ..

                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                type warn +=
                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  Unused quantified type variable

                                                  *)
                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  Unused quantified term variable

                                                  *)
                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                  (*

                                                  An error occurred wile parsing an attribute

                                                  *)
                                                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                ]
                                                type builtin_meta_ttype = unit

                                                The bindings that can occur.

                                                type builtin_meta_ty = unit
                                                type builtin_meta_tags = unit

                                                Some type aliases

                                                type partial_semantics = [
                                                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                ]
                                                type term_semantics = [
                                                1. | partial_semantics
                                                2. | `Total
                                                ]

                                                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                type builtin_meta_term = term_semantics

                                                Meta data for term builtins.

                                                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                Small record to hold the results of builtin parsing by theories.

                                                type builtin_res = [
                                                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                6. | `Infer of binding * var_infer * sym_infer
                                                ]

                                                The result of parsing a symbol by the theory

                                                type not_found = [
                                                1. | `Not_found
                                                ]

                                                Not bound bindings

                                                type var_kind = [
                                                1. | `Let_bound
                                                2. | `Quantified
                                                3. | `Function_param
                                                4. | `Type_alias_param
                                                ]

                                                The type of kinds of variables

                                                type nonrec symbol = Intf.symbol =
                                                1. | Id of Dolmen.Std.Id.t
                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                Wrapper around potential function symbols from the Dolmen AST.

                                                Errors and warnings

                                                type _ warn = ..

                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                type warn +=
                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  Unused quantified type variable

                                                  *)
                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  Unused quantified term variable

                                                  *)
                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                  (*

                                                  An error occurred wile parsing an attribute

                                                  *)
                                                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                  *)
                                                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                  (*

                                                  Redundant cases in pattern matching

                                                  *)

                                                Warnings that cna trigger on regular parsed terms.

                                                type warn +=
                                                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                  (*

                                                  Shadowing of the given identifier, together with the old and current binding.

                                                  *)

                                                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                type _ err = ..

                                                The type of errors, parameterized by the type of fragment they can trigger on

                                                type err +=
                                                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                  (*

                                                  Not well-dounded datatypes definitions.

                                                  *)

                                                Errors that occur on declaration(s)

                                                type err +=
                                                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                  (*

                                                  The parsed term didn't match the expected shape

                                                  *)
                                                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                  *)
                                                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                  *)
                                                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                  *)
                                                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                  *)
                                                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                  *)
                                                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                  (*

                                                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Dimacs/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Dimacs/Tff/argument-1-Type/index.html index c30890381..1c2f1176f 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Dimacs/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Dimacs/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                  Type definitions

                                                  type order =
                                                  1. | First_order
                                                    (*

                                                    First-oreder typechecking

                                                    *)
                                                  2. | Higher_order
                                                    (*

                                                    Higher-order typechecking

                                                    *)

                                                  Control whether the typechecker should type

                                                  type poly =
                                                  1. | Explicit
                                                    (*

                                                    Type arguments must be explicitly given in funciton applications

                                                    *)
                                                  2. | Implicit
                                                    (*

                                                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                    *)
                                                  3. | Flexible
                                                    (*

                                                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                    *)

                                                  The various polymorphism mode for the typechecker

                                                  type sym_inference_source = {
                                                  1. symbol : Dolmen.Std.Id.t;
                                                  2. symbol_loc : Dolmen.Std.Loc.t;
                                                  3. mutable inferred_ty : Ty.t;
                                                  }
                                                  type var_inference_source = {
                                                  1. variable : Dolmen.Std.Id.t;
                                                  2. variable_loc : Dolmen.Std.Loc.t;
                                                  3. mutable inferred_ty : Ty.t;
                                                  }
                                                  type wildcard_source =
                                                  1. | Arg_of of wildcard_source
                                                  2. | Ret_of of wildcard_source
                                                  3. | From_source of Dolmen.Std.Term.t
                                                  4. | Added_type_argument of Dolmen.Std.Term.t
                                                  5. | Symbol_inference of sym_inference_source
                                                  6. | Variable_inference of var_inference_source
                                                  type wildcard_shape =
                                                  1. | Forbidden
                                                  2. | Any_in_scope
                                                  3. | Any_base of {
                                                    1. allowed : Ty.t list;
                                                    2. preferred : Ty.t;
                                                    }
                                                  4. | Arrow of {
                                                    1. arg_shape : wildcard_shape;
                                                    2. ret_shape : wildcard_shape;
                                                    }
                                                  type infer_unbound_var_scheme =
                                                  1. | No_inference
                                                  2. | Unification_type_variable
                                                  type infer_term_scheme =
                                                  1. | No_inference
                                                  2. | Wildcard of wildcard_shape
                                                  type var_infer = {
                                                  1. infer_unbound_vars : infer_unbound_var_scheme;
                                                  2. infer_type_vars_in_binding_pos : bool;
                                                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                  }

                                                  Specification of how to infer variables.

                                                  type sym_infer = {
                                                  1. infer_type_csts : bool;
                                                  2. infer_term_csts : infer_term_scheme;
                                                  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                  }

                                                  Specification of how to infer symbols.

                                                  type free_wildcards =
                                                  1. | Forbidden
                                                  2. | Implicitly_universally_quantified
                                                  type expect =
                                                  1. | Type
                                                  2. | Term
                                                  3. | Anything
                                                  type tag =
                                                  1. | Set : 'a Tag.t * 'a -> tag
                                                  2. | Add : 'a list Tag.t * 'a -> tag
                                                    (*

                                                    Existencial wrapper around tags

                                                    *)
                                                  type res =
                                                  1. | Ttype
                                                  2. | Ty of Ty.t
                                                  3. | Term of T.t
                                                  4. | Tags of tag list

                                                  The results of parsing an untyped term.

                                                  type builtin_meta_ttype = unit
                                                  type builtin_meta_ty = unit
                                                  type builtin_meta_tags = unit

                                                  Some type aliases

                                                  type term_semantics = [
                                                  1. | `Total
                                                  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                  ]

                                                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                  type builtin_meta_term = term_semantics

                                                  Meta data for term builtins.

                                                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                  Small record to hold the results of builtin parsing by theories.

                                                  type builtin_res = [
                                                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                  6. | `Infer of string * var_infer * sym_infer
                                                  ]

                                                  The result of parsing a symbol by the theory

                                                  type not_found = [
                                                  1. | `Not_found
                                                  ]

                                                  Not bound bindings

                                                  type reason =
                                                  1. | Builtin
                                                  2. | Reserved of string
                                                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                    (*

                                                    The type of reasons for constant typing

                                                    *)
                                                  type binding = [
                                                  1. | `Not_found
                                                  2. | `Reserved of string
                                                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                    Type definitions

                                                    type order =
                                                    1. | First_order
                                                      (*

                                                      First-oreder typechecking

                                                      *)
                                                    2. | Higher_order
                                                      (*

                                                      Higher-order typechecking

                                                      *)

                                                    Control whether the typechecker should type

                                                    type poly =
                                                    1. | Explicit
                                                      (*

                                                      Type arguments must be explicitly given in funciton applications

                                                      *)
                                                    2. | Implicit
                                                      (*

                                                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                      *)
                                                    3. | Flexible
                                                      (*

                                                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                      *)

                                                    The various polymorphism mode for the typechecker

                                                    type sym_inference_source = {
                                                    1. symbol : Dolmen.Std.Id.t;
                                                    2. symbol_loc : Dolmen.Std.Loc.t;
                                                    3. mutable inferred_ty : Ty.t;
                                                    }
                                                    type var_inference_source = {
                                                    1. variable : Dolmen.Std.Id.t;
                                                    2. variable_loc : Dolmen.Std.Loc.t;
                                                    3. mutable inferred_ty : Ty.t;
                                                    }
                                                    type wildcard_source =
                                                    1. | Arg_of of wildcard_source
                                                    2. | Ret_of of wildcard_source
                                                    3. | From_source of Dolmen.Std.Term.t
                                                    4. | Added_type_argument of Dolmen.Std.Term.t
                                                    5. | Symbol_inference of sym_inference_source
                                                    6. | Variable_inference of var_inference_source
                                                    type wildcard_shape =
                                                    1. | Forbidden
                                                    2. | Any_in_scope
                                                    3. | Any_base of {
                                                      1. allowed : Ty.t list;
                                                      2. preferred : Ty.t;
                                                      }
                                                    4. | Arrow of {
                                                      1. arg_shape : wildcard_shape;
                                                      2. ret_shape : wildcard_shape;
                                                      }
                                                    type infer_unbound_var_scheme =
                                                    1. | No_inference
                                                    2. | Unification_type_variable
                                                    type infer_term_scheme =
                                                    1. | No_inference
                                                    2. | Wildcard of wildcard_shape
                                                    type var_infer = {
                                                    1. infer_unbound_vars : infer_unbound_var_scheme;
                                                    2. infer_type_vars_in_binding_pos : bool;
                                                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                    }

                                                    Specification of how to infer variables.

                                                    type sym_infer = {
                                                    1. infer_type_csts : bool;
                                                    2. infer_term_csts : infer_term_scheme;
                                                    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                    }

                                                    Specification of how to infer symbols.

                                                    type free_wildcards =
                                                    1. | Forbidden
                                                    2. | Implicitly_universally_quantified
                                                    type expect =
                                                    1. | Type
                                                    2. | Term
                                                    3. | Anything
                                                    type tag =
                                                    1. | Set : 'a Tag.t * 'a -> tag
                                                    2. | Add : 'a list Tag.t * 'a -> tag
                                                      (*

                                                      Existencial wrapper around tags

                                                      *)
                                                    type res =
                                                    1. | Ttype
                                                    2. | Ty of Ty.t
                                                    3. | Term of T.t
                                                    4. | Tags of tag list

                                                    The results of parsing an untyped term.

                                                    type reservation =
                                                    1. | Strict
                                                      (*

                                                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                      *)
                                                    2. | Model_completion
                                                      (*

                                                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                      *)

                                                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                    type reason =
                                                    1. | Builtin
                                                    2. | Reserved of reservation * string
                                                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                      (*

                                                      The type of reasons for constant typing

                                                      *)
                                                    type binding = [
                                                    1. | `Not_found
                                                    2. | `Reserved of [ `Model of string | `Solver of string ]
                                                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                    ]

                                                    The bindings that can occur.

                                                    type var_kind = [
                                                    1. | `Let_bound
                                                    2. | `Quantified
                                                    3. | `Function_param
                                                    4. | `Type_alias_param
                                                    ]

                                                    The type of kinds of variables

                                                    type nonrec symbol = Intf.symbol =
                                                    1. | Id of Dolmen.Std.Id.t
                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                    Errors and warnings

                                                    type _ warn = ..

                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                    type warn +=
                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      Unused quantified type variable

                                                      *)
                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      Unused quantified term variable

                                                      *)
                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                      (*

                                                      An error occurred wile parsing an attribute

                                                      *)
                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                    ]
                                                    type builtin_meta_ttype = unit

                                                    The bindings that can occur.

                                                    type builtin_meta_ty = unit
                                                    type builtin_meta_tags = unit

                                                    Some type aliases

                                                    type partial_semantics = [
                                                    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                    ]
                                                    type term_semantics = [
                                                    1. | partial_semantics
                                                    2. | `Total
                                                    ]

                                                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                    type builtin_meta_term = term_semantics

                                                    Meta data for term builtins.

                                                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                    Small record to hold the results of builtin parsing by theories.

                                                    type builtin_res = [
                                                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                    6. | `Infer of binding * var_infer * sym_infer
                                                    ]

                                                    The result of parsing a symbol by the theory

                                                    type not_found = [
                                                    1. | `Not_found
                                                    ]

                                                    Not bound bindings

                                                    type var_kind = [
                                                    1. | `Let_bound
                                                    2. | `Quantified
                                                    3. | `Function_param
                                                    4. | `Type_alias_param
                                                    ]

                                                    The type of kinds of variables

                                                    type nonrec symbol = Intf.symbol =
                                                    1. | Id of Dolmen.Std.Id.t
                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                    Errors and warnings

                                                    type _ warn = ..

                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                    type warn +=
                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      Unused quantified type variable

                                                      *)
                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      Unused quantified term variable

                                                      *)
                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                      (*

                                                      An error occurred wile parsing an attribute

                                                      *)
                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                      *)
                                                    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                      (*

                                                      Redundant cases in pattern matching

                                                      *)

                                                    Warnings that cna trigger on regular parsed terms.

                                                    type warn +=
                                                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                      (*

                                                      Shadowing of the given identifier, together with the old and current binding.

                                                      *)

                                                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                    type _ err = ..

                                                    The type of errors, parameterized by the type of fragment they can trigger on

                                                    type err +=
                                                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                      (*

                                                      Not well-dounded datatypes definitions.

                                                      *)

                                                    Errors that occur on declaration(s)

                                                    type err +=
                                                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                      (*

                                                      The parsed term didn't match the expected shape

                                                      *)
                                                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                      *)
                                                    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                      *)
                                                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                      *)
                                                    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                      *)
                                                    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                      *)
                                                    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                      (*

                                                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Smtlib2/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Smtlib2/Tff/argument-1-Type/index.html index 9d04d33e4..15c3a891a 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Smtlib2/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Smtlib2/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                      Type definitions

                                                      type order =
                                                      1. | First_order
                                                        (*

                                                        First-oreder typechecking

                                                        *)
                                                      2. | Higher_order
                                                        (*

                                                        Higher-order typechecking

                                                        *)

                                                      Control whether the typechecker should type

                                                      type poly =
                                                      1. | Explicit
                                                        (*

                                                        Type arguments must be explicitly given in funciton applications

                                                        *)
                                                      2. | Implicit
                                                        (*

                                                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                        *)
                                                      3. | Flexible
                                                        (*

                                                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                        *)

                                                      The various polymorphism mode for the typechecker

                                                      type sym_inference_source = {
                                                      1. symbol : Dolmen.Std.Id.t;
                                                      2. symbol_loc : Dolmen.Std.Loc.t;
                                                      3. mutable inferred_ty : Ty.t;
                                                      }
                                                      type var_inference_source = {
                                                      1. variable : Dolmen.Std.Id.t;
                                                      2. variable_loc : Dolmen.Std.Loc.t;
                                                      3. mutable inferred_ty : Ty.t;
                                                      }
                                                      type wildcard_source =
                                                      1. | Arg_of of wildcard_source
                                                      2. | Ret_of of wildcard_source
                                                      3. | From_source of Dolmen.Std.Term.t
                                                      4. | Added_type_argument of Dolmen.Std.Term.t
                                                      5. | Symbol_inference of sym_inference_source
                                                      6. | Variable_inference of var_inference_source
                                                      type wildcard_shape =
                                                      1. | Forbidden
                                                      2. | Any_in_scope
                                                      3. | Any_base of {
                                                        1. allowed : Ty.t list;
                                                        2. preferred : Ty.t;
                                                        }
                                                      4. | Arrow of {
                                                        1. arg_shape : wildcard_shape;
                                                        2. ret_shape : wildcard_shape;
                                                        }
                                                      type infer_unbound_var_scheme =
                                                      1. | No_inference
                                                      2. | Unification_type_variable
                                                      type infer_term_scheme =
                                                      1. | No_inference
                                                      2. | Wildcard of wildcard_shape
                                                      type var_infer = {
                                                      1. infer_unbound_vars : infer_unbound_var_scheme;
                                                      2. infer_type_vars_in_binding_pos : bool;
                                                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                      }

                                                      Specification of how to infer variables.

                                                      type sym_infer = {
                                                      1. infer_type_csts : bool;
                                                      2. infer_term_csts : infer_term_scheme;
                                                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                      }

                                                      Specification of how to infer symbols.

                                                      type free_wildcards =
                                                      1. | Forbidden
                                                      2. | Implicitly_universally_quantified
                                                      type expect =
                                                      1. | Type
                                                      2. | Term
                                                      3. | Anything
                                                      type tag =
                                                      1. | Set : 'a Tag.t * 'a -> tag
                                                      2. | Add : 'a list Tag.t * 'a -> tag
                                                        (*

                                                        Existencial wrapper around tags

                                                        *)
                                                      type res =
                                                      1. | Ttype
                                                      2. | Ty of Ty.t
                                                      3. | Term of T.t
                                                      4. | Tags of tag list

                                                      The results of parsing an untyped term.

                                                      type builtin_meta_ttype = unit
                                                      type builtin_meta_ty = unit
                                                      type builtin_meta_tags = unit

                                                      Some type aliases

                                                      type term_semantics = [
                                                      1. | `Total
                                                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                      ]

                                                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                      type builtin_meta_term = term_semantics

                                                      Meta data for term builtins.

                                                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                      Small record to hold the results of builtin parsing by theories.

                                                      type builtin_res = [
                                                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                      6. | `Infer of string * var_infer * sym_infer
                                                      ]

                                                      The result of parsing a symbol by the theory

                                                      type not_found = [
                                                      1. | `Not_found
                                                      ]

                                                      Not bound bindings

                                                      type reason =
                                                      1. | Builtin
                                                      2. | Reserved of string
                                                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                        (*

                                                        The type of reasons for constant typing

                                                        *)
                                                      type binding = [
                                                      1. | `Not_found
                                                      2. | `Reserved of string
                                                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                        Type definitions

                                                        type order =
                                                        1. | First_order
                                                          (*

                                                          First-oreder typechecking

                                                          *)
                                                        2. | Higher_order
                                                          (*

                                                          Higher-order typechecking

                                                          *)

                                                        Control whether the typechecker should type

                                                        type poly =
                                                        1. | Explicit
                                                          (*

                                                          Type arguments must be explicitly given in funciton applications

                                                          *)
                                                        2. | Implicit
                                                          (*

                                                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                          *)
                                                        3. | Flexible
                                                          (*

                                                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                          *)

                                                        The various polymorphism mode for the typechecker

                                                        type sym_inference_source = {
                                                        1. symbol : Dolmen.Std.Id.t;
                                                        2. symbol_loc : Dolmen.Std.Loc.t;
                                                        3. mutable inferred_ty : Ty.t;
                                                        }
                                                        type var_inference_source = {
                                                        1. variable : Dolmen.Std.Id.t;
                                                        2. variable_loc : Dolmen.Std.Loc.t;
                                                        3. mutable inferred_ty : Ty.t;
                                                        }
                                                        type wildcard_source =
                                                        1. | Arg_of of wildcard_source
                                                        2. | Ret_of of wildcard_source
                                                        3. | From_source of Dolmen.Std.Term.t
                                                        4. | Added_type_argument of Dolmen.Std.Term.t
                                                        5. | Symbol_inference of sym_inference_source
                                                        6. | Variable_inference of var_inference_source
                                                        type wildcard_shape =
                                                        1. | Forbidden
                                                        2. | Any_in_scope
                                                        3. | Any_base of {
                                                          1. allowed : Ty.t list;
                                                          2. preferred : Ty.t;
                                                          }
                                                        4. | Arrow of {
                                                          1. arg_shape : wildcard_shape;
                                                          2. ret_shape : wildcard_shape;
                                                          }
                                                        type infer_unbound_var_scheme =
                                                        1. | No_inference
                                                        2. | Unification_type_variable
                                                        type infer_term_scheme =
                                                        1. | No_inference
                                                        2. | Wildcard of wildcard_shape
                                                        type var_infer = {
                                                        1. infer_unbound_vars : infer_unbound_var_scheme;
                                                        2. infer_type_vars_in_binding_pos : bool;
                                                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                        }

                                                        Specification of how to infer variables.

                                                        type sym_infer = {
                                                        1. infer_type_csts : bool;
                                                        2. infer_term_csts : infer_term_scheme;
                                                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                        }

                                                        Specification of how to infer symbols.

                                                        type free_wildcards =
                                                        1. | Forbidden
                                                        2. | Implicitly_universally_quantified
                                                        type expect =
                                                        1. | Type
                                                        2. | Term
                                                        3. | Anything
                                                        type tag =
                                                        1. | Set : 'a Tag.t * 'a -> tag
                                                        2. | Add : 'a list Tag.t * 'a -> tag
                                                          (*

                                                          Existencial wrapper around tags

                                                          *)
                                                        type res =
                                                        1. | Ttype
                                                        2. | Ty of Ty.t
                                                        3. | Term of T.t
                                                        4. | Tags of tag list

                                                        The results of parsing an untyped term.

                                                        type reservation =
                                                        1. | Strict
                                                          (*

                                                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                          *)
                                                        2. | Model_completion
                                                          (*

                                                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                          *)

                                                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                        type reason =
                                                        1. | Builtin
                                                        2. | Reserved of reservation * string
                                                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                          (*

                                                          The type of reasons for constant typing

                                                          *)
                                                        type binding = [
                                                        1. | `Not_found
                                                        2. | `Reserved of [ `Model of string | `Solver of string ]
                                                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                        ]

                                                        The bindings that can occur.

                                                        type var_kind = [
                                                        1. | `Let_bound
                                                        2. | `Quantified
                                                        3. | `Function_param
                                                        4. | `Type_alias_param
                                                        ]

                                                        The type of kinds of variables

                                                        type nonrec symbol = Intf.symbol =
                                                        1. | Id of Dolmen.Std.Id.t
                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                        Errors and warnings

                                                        type _ warn = ..

                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                        type warn +=
                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          Unused quantified type variable

                                                          *)
                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          Unused quantified term variable

                                                          *)
                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                          (*

                                                          An error occurred wile parsing an attribute

                                                          *)
                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                        ]
                                                        type builtin_meta_ttype = unit

                                                        The bindings that can occur.

                                                        type builtin_meta_ty = unit
                                                        type builtin_meta_tags = unit

                                                        Some type aliases

                                                        type partial_semantics = [
                                                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                        ]
                                                        type term_semantics = [
                                                        1. | partial_semantics
                                                        2. | `Total
                                                        ]

                                                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                        type builtin_meta_term = term_semantics

                                                        Meta data for term builtins.

                                                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                        Small record to hold the results of builtin parsing by theories.

                                                        type builtin_res = [
                                                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                        6. | `Infer of binding * var_infer * sym_infer
                                                        ]

                                                        The result of parsing a symbol by the theory

                                                        type not_found = [
                                                        1. | `Not_found
                                                        ]

                                                        Not bound bindings

                                                        type var_kind = [
                                                        1. | `Let_bound
                                                        2. | `Quantified
                                                        3. | `Function_param
                                                        4. | `Type_alias_param
                                                        ]

                                                        The type of kinds of variables

                                                        type nonrec symbol = Intf.symbol =
                                                        1. | Id of Dolmen.Std.Id.t
                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                        Errors and warnings

                                                        type _ warn = ..

                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                        type warn +=
                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          Unused quantified type variable

                                                          *)
                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          Unused quantified term variable

                                                          *)
                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                          (*

                                                          An error occurred wile parsing an attribute

                                                          *)
                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                          *)
                                                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                          (*

                                                          Redundant cases in pattern matching

                                                          *)

                                                        Warnings that cna trigger on regular parsed terms.

                                                        type warn +=
                                                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                          (*

                                                          Shadowing of the given identifier, together with the old and current binding.

                                                          *)

                                                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                        type _ err = ..

                                                        The type of errors, parameterized by the type of fragment they can trigger on

                                                        type err +=
                                                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                          (*

                                                          Not well-dounded datatypes definitions.

                                                          *)

                                                        Errors that occur on declaration(s)

                                                        type err +=
                                                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                          (*

                                                          The parsed term didn't match the expected shape

                                                          *)
                                                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                          *)
                                                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                          *)
                                                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                          *)
                                                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                          *)
                                                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                          *)
                                                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                          (*

                                                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Tptp/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Tptp/Tff/argument-1-Type/index.html index 4f58dc529..b819ca795 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Tptp/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Tptp/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                          Type definitions

                                                          type order =
                                                          1. | First_order
                                                            (*

                                                            First-oreder typechecking

                                                            *)
                                                          2. | Higher_order
                                                            (*

                                                            Higher-order typechecking

                                                            *)

                                                          Control whether the typechecker should type

                                                          type poly =
                                                          1. | Explicit
                                                            (*

                                                            Type arguments must be explicitly given in funciton applications

                                                            *)
                                                          2. | Implicit
                                                            (*

                                                            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                            *)
                                                          3. | Flexible
                                                            (*

                                                            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                            *)

                                                          The various polymorphism mode for the typechecker

                                                          type sym_inference_source = {
                                                          1. symbol : Dolmen.Std.Id.t;
                                                          2. symbol_loc : Dolmen.Std.Loc.t;
                                                          3. mutable inferred_ty : Ty.t;
                                                          }
                                                          type var_inference_source = {
                                                          1. variable : Dolmen.Std.Id.t;
                                                          2. variable_loc : Dolmen.Std.Loc.t;
                                                          3. mutable inferred_ty : Ty.t;
                                                          }
                                                          type wildcard_source =
                                                          1. | Arg_of of wildcard_source
                                                          2. | Ret_of of wildcard_source
                                                          3. | From_source of Dolmen.Std.Term.t
                                                          4. | Added_type_argument of Dolmen.Std.Term.t
                                                          5. | Symbol_inference of sym_inference_source
                                                          6. | Variable_inference of var_inference_source
                                                          type wildcard_shape =
                                                          1. | Forbidden
                                                          2. | Any_in_scope
                                                          3. | Any_base of {
                                                            1. allowed : Ty.t list;
                                                            2. preferred : Ty.t;
                                                            }
                                                          4. | Arrow of {
                                                            1. arg_shape : wildcard_shape;
                                                            2. ret_shape : wildcard_shape;
                                                            }
                                                          type infer_unbound_var_scheme =
                                                          1. | No_inference
                                                          2. | Unification_type_variable
                                                          type infer_term_scheme =
                                                          1. | No_inference
                                                          2. | Wildcard of wildcard_shape
                                                          type var_infer = {
                                                          1. infer_unbound_vars : infer_unbound_var_scheme;
                                                          2. infer_type_vars_in_binding_pos : bool;
                                                          3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                          }

                                                          Specification of how to infer variables.

                                                          type sym_infer = {
                                                          1. infer_type_csts : bool;
                                                          2. infer_term_csts : infer_term_scheme;
                                                          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                          }

                                                          Specification of how to infer symbols.

                                                          type free_wildcards =
                                                          1. | Forbidden
                                                          2. | Implicitly_universally_quantified
                                                          type expect =
                                                          1. | Type
                                                          2. | Term
                                                          3. | Anything
                                                          type tag =
                                                          1. | Set : 'a Tag.t * 'a -> tag
                                                          2. | Add : 'a list Tag.t * 'a -> tag
                                                            (*

                                                            Existencial wrapper around tags

                                                            *)
                                                          type res =
                                                          1. | Ttype
                                                          2. | Ty of Ty.t
                                                          3. | Term of T.t
                                                          4. | Tags of tag list

                                                          The results of parsing an untyped term.

                                                          type builtin_meta_ttype = unit
                                                          type builtin_meta_ty = unit
                                                          type builtin_meta_tags = unit

                                                          Some type aliases

                                                          type term_semantics = [
                                                          1. | `Total
                                                          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                          ]

                                                          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                          type builtin_meta_term = term_semantics

                                                          Meta data for term builtins.

                                                          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                          Small record to hold the results of builtin parsing by theories.

                                                          type builtin_res = [
                                                          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                          6. | `Infer of string * var_infer * sym_infer
                                                          ]

                                                          The result of parsing a symbol by the theory

                                                          type not_found = [
                                                          1. | `Not_found
                                                          ]

                                                          Not bound bindings

                                                          type reason =
                                                          1. | Builtin
                                                          2. | Reserved of string
                                                          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                            (*

                                                            The type of reasons for constant typing

                                                            *)
                                                          type binding = [
                                                          1. | `Not_found
                                                          2. | `Reserved of string
                                                          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                            Type definitions

                                                            type order =
                                                            1. | First_order
                                                              (*

                                                              First-oreder typechecking

                                                              *)
                                                            2. | Higher_order
                                                              (*

                                                              Higher-order typechecking

                                                              *)

                                                            Control whether the typechecker should type

                                                            type poly =
                                                            1. | Explicit
                                                              (*

                                                              Type arguments must be explicitly given in funciton applications

                                                              *)
                                                            2. | Implicit
                                                              (*

                                                              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                              *)
                                                            3. | Flexible
                                                              (*

                                                              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                              *)

                                                            The various polymorphism mode for the typechecker

                                                            type sym_inference_source = {
                                                            1. symbol : Dolmen.Std.Id.t;
                                                            2. symbol_loc : Dolmen.Std.Loc.t;
                                                            3. mutable inferred_ty : Ty.t;
                                                            }
                                                            type var_inference_source = {
                                                            1. variable : Dolmen.Std.Id.t;
                                                            2. variable_loc : Dolmen.Std.Loc.t;
                                                            3. mutable inferred_ty : Ty.t;
                                                            }
                                                            type wildcard_source =
                                                            1. | Arg_of of wildcard_source
                                                            2. | Ret_of of wildcard_source
                                                            3. | From_source of Dolmen.Std.Term.t
                                                            4. | Added_type_argument of Dolmen.Std.Term.t
                                                            5. | Symbol_inference of sym_inference_source
                                                            6. | Variable_inference of var_inference_source
                                                            type wildcard_shape =
                                                            1. | Forbidden
                                                            2. | Any_in_scope
                                                            3. | Any_base of {
                                                              1. allowed : Ty.t list;
                                                              2. preferred : Ty.t;
                                                              }
                                                            4. | Arrow of {
                                                              1. arg_shape : wildcard_shape;
                                                              2. ret_shape : wildcard_shape;
                                                              }
                                                            type infer_unbound_var_scheme =
                                                            1. | No_inference
                                                            2. | Unification_type_variable
                                                            type infer_term_scheme =
                                                            1. | No_inference
                                                            2. | Wildcard of wildcard_shape
                                                            type var_infer = {
                                                            1. infer_unbound_vars : infer_unbound_var_scheme;
                                                            2. infer_type_vars_in_binding_pos : bool;
                                                            3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                            }

                                                            Specification of how to infer variables.

                                                            type sym_infer = {
                                                            1. infer_type_csts : bool;
                                                            2. infer_term_csts : infer_term_scheme;
                                                            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                            }

                                                            Specification of how to infer symbols.

                                                            type free_wildcards =
                                                            1. | Forbidden
                                                            2. | Implicitly_universally_quantified
                                                            type expect =
                                                            1. | Type
                                                            2. | Term
                                                            3. | Anything
                                                            type tag =
                                                            1. | Set : 'a Tag.t * 'a -> tag
                                                            2. | Add : 'a list Tag.t * 'a -> tag
                                                              (*

                                                              Existencial wrapper around tags

                                                              *)
                                                            type res =
                                                            1. | Ttype
                                                            2. | Ty of Ty.t
                                                            3. | Term of T.t
                                                            4. | Tags of tag list

                                                            The results of parsing an untyped term.

                                                            type reservation =
                                                            1. | Strict
                                                              (*

                                                              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                              *)
                                                            2. | Model_completion
                                                              (*

                                                              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                              *)

                                                            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                            type reason =
                                                            1. | Builtin
                                                            2. | Reserved of reservation * string
                                                            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                              (*

                                                              The type of reasons for constant typing

                                                              *)
                                                            type binding = [
                                                            1. | `Not_found
                                                            2. | `Reserved of [ `Model of string | `Solver of string ]
                                                            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                            ]

                                                            The bindings that can occur.

                                                            type var_kind = [
                                                            1. | `Let_bound
                                                            2. | `Quantified
                                                            3. | `Function_param
                                                            4. | `Type_alias_param
                                                            ]

                                                            The type of kinds of variables

                                                            type nonrec symbol = Intf.symbol =
                                                            1. | Id of Dolmen.Std.Id.t
                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                            Errors and warnings

                                                            type _ warn = ..

                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                            type warn +=
                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              Unused quantified type variable

                                                              *)
                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              Unused quantified term variable

                                                              *)
                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                              (*

                                                              An error occurred wile parsing an attribute

                                                              *)
                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                            ]
                                                            type builtin_meta_ttype = unit

                                                            The bindings that can occur.

                                                            type builtin_meta_ty = unit
                                                            type builtin_meta_tags = unit

                                                            Some type aliases

                                                            type partial_semantics = [
                                                            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                            ]
                                                            type term_semantics = [
                                                            1. | partial_semantics
                                                            2. | `Total
                                                            ]

                                                            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                            type builtin_meta_term = term_semantics

                                                            Meta data for term builtins.

                                                            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                            Small record to hold the results of builtin parsing by theories.

                                                            type builtin_res = [
                                                            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                            6. | `Infer of binding * var_infer * sym_infer
                                                            ]

                                                            The result of parsing a symbol by the theory

                                                            type not_found = [
                                                            1. | `Not_found
                                                            ]

                                                            Not bound bindings

                                                            type var_kind = [
                                                            1. | `Let_bound
                                                            2. | `Quantified
                                                            3. | `Function_param
                                                            4. | `Type_alias_param
                                                            ]

                                                            The type of kinds of variables

                                                            type nonrec symbol = Intf.symbol =
                                                            1. | Id of Dolmen.Std.Id.t
                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                            Errors and warnings

                                                            type _ warn = ..

                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                            type warn +=
                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              Unused quantified type variable

                                                              *)
                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              Unused quantified term variable

                                                              *)
                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                              (*

                                                              An error occurred wile parsing an attribute

                                                              *)
                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                              *)
                                                            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                              (*

                                                              Redundant cases in pattern matching

                                                              *)

                                                            Warnings that cna trigger on regular parsed terms.

                                                            type warn +=
                                                            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                              (*

                                                              Shadowing of the given identifier, together with the old and current binding.

                                                              *)

                                                            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                            type _ err = ..

                                                            The type of errors, parameterized by the type of fragment they can trigger on

                                                            type err +=
                                                            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                              (*

                                                              Not well-dounded datatypes definitions.

                                                              *)

                                                            Errors that occur on declaration(s)

                                                            type err +=
                                                            1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                              (*

                                                              The parsed term didn't match the expected shape

                                                              *)
                                                            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                              *)
                                                            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                              *)
                                                            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                              *)
                                                            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                              *)
                                                            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                              *)
                                                            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                              (*

                                                              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Tptp/Thf/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Tptp/Thf/argument-1-Type/index.html index 7f233782d..b0931a359 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Tptp/Thf/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Tptp/Thf/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                              Type definitions

                                                              type order =
                                                              1. | First_order
                                                                (*

                                                                First-oreder typechecking

                                                                *)
                                                              2. | Higher_order
                                                                (*

                                                                Higher-order typechecking

                                                                *)

                                                              Control whether the typechecker should type

                                                              type poly =
                                                              1. | Explicit
                                                                (*

                                                                Type arguments must be explicitly given in funciton applications

                                                                *)
                                                              2. | Implicit
                                                                (*

                                                                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                *)
                                                              3. | Flexible
                                                                (*

                                                                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                *)

                                                              The various polymorphism mode for the typechecker

                                                              type sym_inference_source = {
                                                              1. symbol : Dolmen.Std.Id.t;
                                                              2. symbol_loc : Dolmen.Std.Loc.t;
                                                              3. mutable inferred_ty : Ty.t;
                                                              }
                                                              type var_inference_source = {
                                                              1. variable : Dolmen.Std.Id.t;
                                                              2. variable_loc : Dolmen.Std.Loc.t;
                                                              3. mutable inferred_ty : Ty.t;
                                                              }
                                                              type wildcard_source =
                                                              1. | Arg_of of wildcard_source
                                                              2. | Ret_of of wildcard_source
                                                              3. | From_source of Dolmen.Std.Term.t
                                                              4. | Added_type_argument of Dolmen.Std.Term.t
                                                              5. | Symbol_inference of sym_inference_source
                                                              6. | Variable_inference of var_inference_source
                                                              type wildcard_shape =
                                                              1. | Forbidden
                                                              2. | Any_in_scope
                                                              3. | Any_base of {
                                                                1. allowed : Ty.t list;
                                                                2. preferred : Ty.t;
                                                                }
                                                              4. | Arrow of {
                                                                1. arg_shape : wildcard_shape;
                                                                2. ret_shape : wildcard_shape;
                                                                }
                                                              type infer_unbound_var_scheme =
                                                              1. | No_inference
                                                              2. | Unification_type_variable
                                                              type infer_term_scheme =
                                                              1. | No_inference
                                                              2. | Wildcard of wildcard_shape
                                                              type var_infer = {
                                                              1. infer_unbound_vars : infer_unbound_var_scheme;
                                                              2. infer_type_vars_in_binding_pos : bool;
                                                              3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                              }

                                                              Specification of how to infer variables.

                                                              type sym_infer = {
                                                              1. infer_type_csts : bool;
                                                              2. infer_term_csts : infer_term_scheme;
                                                              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                              }

                                                              Specification of how to infer symbols.

                                                              type free_wildcards =
                                                              1. | Forbidden
                                                              2. | Implicitly_universally_quantified
                                                              type expect =
                                                              1. | Type
                                                              2. | Term
                                                              3. | Anything
                                                              type tag =
                                                              1. | Set : 'a Tag.t * 'a -> tag
                                                              2. | Add : 'a list Tag.t * 'a -> tag
                                                                (*

                                                                Existencial wrapper around tags

                                                                *)
                                                              type res =
                                                              1. | Ttype
                                                              2. | Ty of Ty.t
                                                              3. | Term of T.t
                                                              4. | Tags of tag list

                                                              The results of parsing an untyped term.

                                                              type builtin_meta_ttype = unit
                                                              type builtin_meta_ty = unit
                                                              type builtin_meta_tags = unit

                                                              Some type aliases

                                                              type term_semantics = [
                                                              1. | `Total
                                                              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                              ]

                                                              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                              type builtin_meta_term = term_semantics

                                                              Meta data for term builtins.

                                                              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                              Small record to hold the results of builtin parsing by theories.

                                                              type builtin_res = [
                                                              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                              6. | `Infer of string * var_infer * sym_infer
                                                              ]

                                                              The result of parsing a symbol by the theory

                                                              type not_found = [
                                                              1. | `Not_found
                                                              ]

                                                              Not bound bindings

                                                              type reason =
                                                              1. | Builtin
                                                              2. | Reserved of string
                                                              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                (*

                                                                The type of reasons for constant typing

                                                                *)
                                                              type binding = [
                                                              1. | `Not_found
                                                              2. | `Reserved of string
                                                              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                Type definitions

                                                                type order =
                                                                1. | First_order
                                                                  (*

                                                                  First-oreder typechecking

                                                                  *)
                                                                2. | Higher_order
                                                                  (*

                                                                  Higher-order typechecking

                                                                  *)

                                                                Control whether the typechecker should type

                                                                type poly =
                                                                1. | Explicit
                                                                  (*

                                                                  Type arguments must be explicitly given in funciton applications

                                                                  *)
                                                                2. | Implicit
                                                                  (*

                                                                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                  *)
                                                                3. | Flexible
                                                                  (*

                                                                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                  *)

                                                                The various polymorphism mode for the typechecker

                                                                type sym_inference_source = {
                                                                1. symbol : Dolmen.Std.Id.t;
                                                                2. symbol_loc : Dolmen.Std.Loc.t;
                                                                3. mutable inferred_ty : Ty.t;
                                                                }
                                                                type var_inference_source = {
                                                                1. variable : Dolmen.Std.Id.t;
                                                                2. variable_loc : Dolmen.Std.Loc.t;
                                                                3. mutable inferred_ty : Ty.t;
                                                                }
                                                                type wildcard_source =
                                                                1. | Arg_of of wildcard_source
                                                                2. | Ret_of of wildcard_source
                                                                3. | From_source of Dolmen.Std.Term.t
                                                                4. | Added_type_argument of Dolmen.Std.Term.t
                                                                5. | Symbol_inference of sym_inference_source
                                                                6. | Variable_inference of var_inference_source
                                                                type wildcard_shape =
                                                                1. | Forbidden
                                                                2. | Any_in_scope
                                                                3. | Any_base of {
                                                                  1. allowed : Ty.t list;
                                                                  2. preferred : Ty.t;
                                                                  }
                                                                4. | Arrow of {
                                                                  1. arg_shape : wildcard_shape;
                                                                  2. ret_shape : wildcard_shape;
                                                                  }
                                                                type infer_unbound_var_scheme =
                                                                1. | No_inference
                                                                2. | Unification_type_variable
                                                                type infer_term_scheme =
                                                                1. | No_inference
                                                                2. | Wildcard of wildcard_shape
                                                                type var_infer = {
                                                                1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                2. infer_type_vars_in_binding_pos : bool;
                                                                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                }

                                                                Specification of how to infer variables.

                                                                type sym_infer = {
                                                                1. infer_type_csts : bool;
                                                                2. infer_term_csts : infer_term_scheme;
                                                                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                }

                                                                Specification of how to infer symbols.

                                                                type free_wildcards =
                                                                1. | Forbidden
                                                                2. | Implicitly_universally_quantified
                                                                type expect =
                                                                1. | Type
                                                                2. | Term
                                                                3. | Anything
                                                                type tag =
                                                                1. | Set : 'a Tag.t * 'a -> tag
                                                                2. | Add : 'a list Tag.t * 'a -> tag
                                                                  (*

                                                                  Existencial wrapper around tags

                                                                  *)
                                                                type res =
                                                                1. | Ttype
                                                                2. | Ty of Ty.t
                                                                3. | Term of T.t
                                                                4. | Tags of tag list

                                                                The results of parsing an untyped term.

                                                                type reservation =
                                                                1. | Strict
                                                                  (*

                                                                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                  *)
                                                                2. | Model_completion
                                                                  (*

                                                                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                  *)

                                                                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                type reason =
                                                                1. | Builtin
                                                                2. | Reserved of reservation * string
                                                                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                  (*

                                                                  The type of reasons for constant typing

                                                                  *)
                                                                type binding = [
                                                                1. | `Not_found
                                                                2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                ]

                                                                The bindings that can occur.

                                                                type var_kind = [
                                                                1. | `Let_bound
                                                                2. | `Quantified
                                                                3. | `Function_param
                                                                4. | `Type_alias_param
                                                                ]

                                                                The type of kinds of variables

                                                                type nonrec symbol = Intf.symbol =
                                                                1. | Id of Dolmen.Std.Id.t
                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                Errors and warnings

                                                                type _ warn = ..

                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                type warn +=
                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  Unused quantified type variable

                                                                  *)
                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  Unused quantified term variable

                                                                  *)
                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  An error occurred wile parsing an attribute

                                                                  *)
                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                ]
                                                                type builtin_meta_ttype = unit

                                                                The bindings that can occur.

                                                                type builtin_meta_ty = unit
                                                                type builtin_meta_tags = unit

                                                                Some type aliases

                                                                type partial_semantics = [
                                                                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                ]
                                                                type term_semantics = [
                                                                1. | partial_semantics
                                                                2. | `Total
                                                                ]

                                                                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                type builtin_meta_term = term_semantics

                                                                Meta data for term builtins.

                                                                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                Small record to hold the results of builtin parsing by theories.

                                                                type builtin_res = [
                                                                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                6. | `Infer of binding * var_infer * sym_infer
                                                                ]

                                                                The result of parsing a symbol by the theory

                                                                type not_found = [
                                                                1. | `Not_found
                                                                ]

                                                                Not bound bindings

                                                                type var_kind = [
                                                                1. | `Let_bound
                                                                2. | `Quantified
                                                                3. | `Function_param
                                                                4. | `Type_alias_param
                                                                ]

                                                                The type of kinds of variables

                                                                type nonrec symbol = Intf.symbol =
                                                                1. | Id of Dolmen.Std.Id.t
                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                Errors and warnings

                                                                type _ warn = ..

                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                type warn +=
                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  Unused quantified type variable

                                                                  *)
                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  Unused quantified term variable

                                                                  *)
                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  An error occurred wile parsing an attribute

                                                                  *)
                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                  *)
                                                                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                  (*

                                                                  Redundant cases in pattern matching

                                                                  *)

                                                                Warnings that cna trigger on regular parsed terms.

                                                                type warn +=
                                                                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                  (*

                                                                  Shadowing of the given identifier, together with the old and current binding.

                                                                  *)

                                                                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                type _ err = ..

                                                                The type of errors, parameterized by the type of fragment they can trigger on

                                                                type err +=
                                                                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                  (*

                                                                  Not well-dounded datatypes definitions.

                                                                  *)

                                                                Errors that occur on declaration(s)

                                                                type err +=
                                                                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  The parsed term didn't match the expected shape

                                                                  *)
                                                                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                  *)
                                                                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                  *)
                                                                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                  *)
                                                                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                  *)
                                                                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                  *)
                                                                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                  (*

                                                                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Core/Zf/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Core/Zf/Tff/argument-1-Type/index.html index e7c6f3e4e..2bd9157ac 100644 --- a/dev/dolmen_type/Dolmen_type/Core/Zf/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Core/Zf/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                  Type definitions

                                                                  type order =
                                                                  1. | First_order
                                                                    (*

                                                                    First-oreder typechecking

                                                                    *)
                                                                  2. | Higher_order
                                                                    (*

                                                                    Higher-order typechecking

                                                                    *)

                                                                  Control whether the typechecker should type

                                                                  type poly =
                                                                  1. | Explicit
                                                                    (*

                                                                    Type arguments must be explicitly given in funciton applications

                                                                    *)
                                                                  2. | Implicit
                                                                    (*

                                                                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                    *)
                                                                  3. | Flexible
                                                                    (*

                                                                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                    *)

                                                                  The various polymorphism mode for the typechecker

                                                                  type sym_inference_source = {
                                                                  1. symbol : Dolmen.Std.Id.t;
                                                                  2. symbol_loc : Dolmen.Std.Loc.t;
                                                                  3. mutable inferred_ty : Ty.t;
                                                                  }
                                                                  type var_inference_source = {
                                                                  1. variable : Dolmen.Std.Id.t;
                                                                  2. variable_loc : Dolmen.Std.Loc.t;
                                                                  3. mutable inferred_ty : Ty.t;
                                                                  }
                                                                  type wildcard_source =
                                                                  1. | Arg_of of wildcard_source
                                                                  2. | Ret_of of wildcard_source
                                                                  3. | From_source of Dolmen.Std.Term.t
                                                                  4. | Added_type_argument of Dolmen.Std.Term.t
                                                                  5. | Symbol_inference of sym_inference_source
                                                                  6. | Variable_inference of var_inference_source
                                                                  type wildcard_shape =
                                                                  1. | Forbidden
                                                                  2. | Any_in_scope
                                                                  3. | Any_base of {
                                                                    1. allowed : Ty.t list;
                                                                    2. preferred : Ty.t;
                                                                    }
                                                                  4. | Arrow of {
                                                                    1. arg_shape : wildcard_shape;
                                                                    2. ret_shape : wildcard_shape;
                                                                    }
                                                                  type infer_unbound_var_scheme =
                                                                  1. | No_inference
                                                                  2. | Unification_type_variable
                                                                  type infer_term_scheme =
                                                                  1. | No_inference
                                                                  2. | Wildcard of wildcard_shape
                                                                  type var_infer = {
                                                                  1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                  2. infer_type_vars_in_binding_pos : bool;
                                                                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                  }

                                                                  Specification of how to infer variables.

                                                                  type sym_infer = {
                                                                  1. infer_type_csts : bool;
                                                                  2. infer_term_csts : infer_term_scheme;
                                                                  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                  }

                                                                  Specification of how to infer symbols.

                                                                  type free_wildcards =
                                                                  1. | Forbidden
                                                                  2. | Implicitly_universally_quantified
                                                                  type expect =
                                                                  1. | Type
                                                                  2. | Term
                                                                  3. | Anything
                                                                  type tag =
                                                                  1. | Set : 'a Tag.t * 'a -> tag
                                                                  2. | Add : 'a list Tag.t * 'a -> tag
                                                                    (*

                                                                    Existencial wrapper around tags

                                                                    *)
                                                                  type res =
                                                                  1. | Ttype
                                                                  2. | Ty of Ty.t
                                                                  3. | Term of T.t
                                                                  4. | Tags of tag list

                                                                  The results of parsing an untyped term.

                                                                  type builtin_meta_ttype = unit
                                                                  type builtin_meta_ty = unit
                                                                  type builtin_meta_tags = unit

                                                                  Some type aliases

                                                                  type term_semantics = [
                                                                  1. | `Total
                                                                  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                  ]

                                                                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                  type builtin_meta_term = term_semantics

                                                                  Meta data for term builtins.

                                                                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                  Small record to hold the results of builtin parsing by theories.

                                                                  type builtin_res = [
                                                                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                  6. | `Infer of string * var_infer * sym_infer
                                                                  ]

                                                                  The result of parsing a symbol by the theory

                                                                  type not_found = [
                                                                  1. | `Not_found
                                                                  ]

                                                                  Not bound bindings

                                                                  type reason =
                                                                  1. | Builtin
                                                                  2. | Reserved of string
                                                                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                    (*

                                                                    The type of reasons for constant typing

                                                                    *)
                                                                  type binding = [
                                                                  1. | `Not_found
                                                                  2. | `Reserved of string
                                                                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                    Type definitions

                                                                    type order =
                                                                    1. | First_order
                                                                      (*

                                                                      First-oreder typechecking

                                                                      *)
                                                                    2. | Higher_order
                                                                      (*

                                                                      Higher-order typechecking

                                                                      *)

                                                                    Control whether the typechecker should type

                                                                    type poly =
                                                                    1. | Explicit
                                                                      (*

                                                                      Type arguments must be explicitly given in funciton applications

                                                                      *)
                                                                    2. | Implicit
                                                                      (*

                                                                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                      *)
                                                                    3. | Flexible
                                                                      (*

                                                                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                      *)

                                                                    The various polymorphism mode for the typechecker

                                                                    type sym_inference_source = {
                                                                    1. symbol : Dolmen.Std.Id.t;
                                                                    2. symbol_loc : Dolmen.Std.Loc.t;
                                                                    3. mutable inferred_ty : Ty.t;
                                                                    }
                                                                    type var_inference_source = {
                                                                    1. variable : Dolmen.Std.Id.t;
                                                                    2. variable_loc : Dolmen.Std.Loc.t;
                                                                    3. mutable inferred_ty : Ty.t;
                                                                    }
                                                                    type wildcard_source =
                                                                    1. | Arg_of of wildcard_source
                                                                    2. | Ret_of of wildcard_source
                                                                    3. | From_source of Dolmen.Std.Term.t
                                                                    4. | Added_type_argument of Dolmen.Std.Term.t
                                                                    5. | Symbol_inference of sym_inference_source
                                                                    6. | Variable_inference of var_inference_source
                                                                    type wildcard_shape =
                                                                    1. | Forbidden
                                                                    2. | Any_in_scope
                                                                    3. | Any_base of {
                                                                      1. allowed : Ty.t list;
                                                                      2. preferred : Ty.t;
                                                                      }
                                                                    4. | Arrow of {
                                                                      1. arg_shape : wildcard_shape;
                                                                      2. ret_shape : wildcard_shape;
                                                                      }
                                                                    type infer_unbound_var_scheme =
                                                                    1. | No_inference
                                                                    2. | Unification_type_variable
                                                                    type infer_term_scheme =
                                                                    1. | No_inference
                                                                    2. | Wildcard of wildcard_shape
                                                                    type var_infer = {
                                                                    1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                    2. infer_type_vars_in_binding_pos : bool;
                                                                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                    }

                                                                    Specification of how to infer variables.

                                                                    type sym_infer = {
                                                                    1. infer_type_csts : bool;
                                                                    2. infer_term_csts : infer_term_scheme;
                                                                    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                    }

                                                                    Specification of how to infer symbols.

                                                                    type free_wildcards =
                                                                    1. | Forbidden
                                                                    2. | Implicitly_universally_quantified
                                                                    type expect =
                                                                    1. | Type
                                                                    2. | Term
                                                                    3. | Anything
                                                                    type tag =
                                                                    1. | Set : 'a Tag.t * 'a -> tag
                                                                    2. | Add : 'a list Tag.t * 'a -> tag
                                                                      (*

                                                                      Existencial wrapper around tags

                                                                      *)
                                                                    type res =
                                                                    1. | Ttype
                                                                    2. | Ty of Ty.t
                                                                    3. | Term of T.t
                                                                    4. | Tags of tag list

                                                                    The results of parsing an untyped term.

                                                                    type reservation =
                                                                    1. | Strict
                                                                      (*

                                                                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                      *)
                                                                    2. | Model_completion
                                                                      (*

                                                                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                      *)

                                                                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                    type reason =
                                                                    1. | Builtin
                                                                    2. | Reserved of reservation * string
                                                                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                      (*

                                                                      The type of reasons for constant typing

                                                                      *)
                                                                    type binding = [
                                                                    1. | `Not_found
                                                                    2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                    ]

                                                                    The bindings that can occur.

                                                                    type var_kind = [
                                                                    1. | `Let_bound
                                                                    2. | `Quantified
                                                                    3. | `Function_param
                                                                    4. | `Type_alias_param
                                                                    ]

                                                                    The type of kinds of variables

                                                                    type nonrec symbol = Intf.symbol =
                                                                    1. | Id of Dolmen.Std.Id.t
                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                    Errors and warnings

                                                                    type _ warn = ..

                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                    type warn +=
                                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      Unused quantified type variable

                                                                      *)
                                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      Unused quantified term variable

                                                                      *)
                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      An error occurred wile parsing an attribute

                                                                      *)
                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                    ]
                                                                    type builtin_meta_ttype = unit

                                                                    The bindings that can occur.

                                                                    type builtin_meta_ty = unit
                                                                    type builtin_meta_tags = unit

                                                                    Some type aliases

                                                                    type partial_semantics = [
                                                                    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                    ]
                                                                    type term_semantics = [
                                                                    1. | partial_semantics
                                                                    2. | `Total
                                                                    ]

                                                                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                    type builtin_meta_term = term_semantics

                                                                    Meta data for term builtins.

                                                                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                    Small record to hold the results of builtin parsing by theories.

                                                                    type builtin_res = [
                                                                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                    6. | `Infer of binding * var_infer * sym_infer
                                                                    ]

                                                                    The result of parsing a symbol by the theory

                                                                    type not_found = [
                                                                    1. | `Not_found
                                                                    ]

                                                                    Not bound bindings

                                                                    type var_kind = [
                                                                    1. | `Let_bound
                                                                    2. | `Quantified
                                                                    3. | `Function_param
                                                                    4. | `Type_alias_param
                                                                    ]

                                                                    The type of kinds of variables

                                                                    type nonrec symbol = Intf.symbol =
                                                                    1. | Id of Dolmen.Std.Id.t
                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                    Errors and warnings

                                                                    type _ warn = ..

                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                    type warn +=
                                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      Unused quantified type variable

                                                                      *)
                                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      Unused quantified term variable

                                                                      *)
                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      An error occurred wile parsing an attribute

                                                                      *)
                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                      *)
                                                                    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                      (*

                                                                      Redundant cases in pattern matching

                                                                      *)

                                                                    Warnings that cna trigger on regular parsed terms.

                                                                    type warn +=
                                                                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                      (*

                                                                      Shadowing of the given identifier, together with the old and current binding.

                                                                      *)

                                                                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                    type _ err = ..

                                                                    The type of errors, parameterized by the type of fragment they can trigger on

                                                                    type err +=
                                                                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                      (*

                                                                      Not well-dounded datatypes definitions.

                                                                      *)

                                                                    Errors that occur on declaration(s)

                                                                    type err +=
                                                                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      The parsed term didn't match the expected shape

                                                                      *)
                                                                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                      *)
                                                                    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                      *)
                                                                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                      *)
                                                                    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                      *)
                                                                    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                      *)
                                                                    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                      (*

                                                                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Def/Declare/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Def/Declare/argument-1-Type/index.html index c9495cb4d..61c37b3f3 100644 --- a/dev/dolmen_type/Dolmen_type/Def/Declare/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Def/Declare/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                      Type definitions

                                                                      type order =
                                                                      1. | First_order
                                                                        (*

                                                                        First-oreder typechecking

                                                                        *)
                                                                      2. | Higher_order
                                                                        (*

                                                                        Higher-order typechecking

                                                                        *)

                                                                      Control whether the typechecker should type

                                                                      type poly =
                                                                      1. | Explicit
                                                                        (*

                                                                        Type arguments must be explicitly given in funciton applications

                                                                        *)
                                                                      2. | Implicit
                                                                        (*

                                                                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                        *)
                                                                      3. | Flexible
                                                                        (*

                                                                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                        *)

                                                                      The various polymorphism mode for the typechecker

                                                                      type sym_inference_source = {
                                                                      1. symbol : Dolmen.Std.Id.t;
                                                                      2. symbol_loc : Dolmen.Std.Loc.t;
                                                                      3. mutable inferred_ty : Ty.t;
                                                                      }
                                                                      type var_inference_source = {
                                                                      1. variable : Dolmen.Std.Id.t;
                                                                      2. variable_loc : Dolmen.Std.Loc.t;
                                                                      3. mutable inferred_ty : Ty.t;
                                                                      }
                                                                      type wildcard_source =
                                                                      1. | Arg_of of wildcard_source
                                                                      2. | Ret_of of wildcard_source
                                                                      3. | From_source of Dolmen.Std.Term.t
                                                                      4. | Added_type_argument of Dolmen.Std.Term.t
                                                                      5. | Symbol_inference of sym_inference_source
                                                                      6. | Variable_inference of var_inference_source
                                                                      type wildcard_shape =
                                                                      1. | Forbidden
                                                                      2. | Any_in_scope
                                                                      3. | Any_base of {
                                                                        1. allowed : Ty.t list;
                                                                        2. preferred : Ty.t;
                                                                        }
                                                                      4. | Arrow of {
                                                                        1. arg_shape : wildcard_shape;
                                                                        2. ret_shape : wildcard_shape;
                                                                        }
                                                                      type infer_unbound_var_scheme =
                                                                      1. | No_inference
                                                                      2. | Unification_type_variable
                                                                      type infer_term_scheme =
                                                                      1. | No_inference
                                                                      2. | Wildcard of wildcard_shape
                                                                      type var_infer = {
                                                                      1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                      2. infer_type_vars_in_binding_pos : bool;
                                                                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                      }

                                                                      Specification of how to infer variables.

                                                                      type sym_infer = {
                                                                      1. infer_type_csts : bool;
                                                                      2. infer_term_csts : infer_term_scheme;
                                                                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                      }

                                                                      Specification of how to infer symbols.

                                                                      type free_wildcards =
                                                                      1. | Forbidden
                                                                      2. | Implicitly_universally_quantified
                                                                      type expect =
                                                                      1. | Type
                                                                      2. | Term
                                                                      3. | Anything
                                                                      type tag =
                                                                      1. | Set : 'a Tag.t * 'a -> tag
                                                                      2. | Add : 'a list Tag.t * 'a -> tag
                                                                        (*

                                                                        Existencial wrapper around tags

                                                                        *)
                                                                      type res =
                                                                      1. | Ttype
                                                                      2. | Ty of Ty.t
                                                                      3. | Term of T.t
                                                                      4. | Tags of tag list

                                                                      The results of parsing an untyped term.

                                                                      type builtin_meta_ttype = unit
                                                                      type builtin_meta_ty = unit
                                                                      type builtin_meta_tags = unit

                                                                      Some type aliases

                                                                      type term_semantics = [
                                                                      1. | `Total
                                                                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                      ]

                                                                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                      type builtin_meta_term = term_semantics

                                                                      Meta data for term builtins.

                                                                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                      Small record to hold the results of builtin parsing by theories.

                                                                      type builtin_res = [
                                                                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                      6. | `Infer of string * var_infer * sym_infer
                                                                      ]

                                                                      The result of parsing a symbol by the theory

                                                                      type not_found = [
                                                                      1. | `Not_found
                                                                      ]

                                                                      Not bound bindings

                                                                      type reason =
                                                                      1. | Builtin
                                                                      2. | Reserved of string
                                                                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                        (*

                                                                        The type of reasons for constant typing

                                                                        *)
                                                                      type binding = [
                                                                      1. | `Not_found
                                                                      2. | `Reserved of string
                                                                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                        Type definitions

                                                                        type order =
                                                                        1. | First_order
                                                                          (*

                                                                          First-oreder typechecking

                                                                          *)
                                                                        2. | Higher_order
                                                                          (*

                                                                          Higher-order typechecking

                                                                          *)

                                                                        Control whether the typechecker should type

                                                                        type poly =
                                                                        1. | Explicit
                                                                          (*

                                                                          Type arguments must be explicitly given in funciton applications

                                                                          *)
                                                                        2. | Implicit
                                                                          (*

                                                                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                          *)
                                                                        3. | Flexible
                                                                          (*

                                                                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                          *)

                                                                        The various polymorphism mode for the typechecker

                                                                        type sym_inference_source = {
                                                                        1. symbol : Dolmen.Std.Id.t;
                                                                        2. symbol_loc : Dolmen.Std.Loc.t;
                                                                        3. mutable inferred_ty : Ty.t;
                                                                        }
                                                                        type var_inference_source = {
                                                                        1. variable : Dolmen.Std.Id.t;
                                                                        2. variable_loc : Dolmen.Std.Loc.t;
                                                                        3. mutable inferred_ty : Ty.t;
                                                                        }
                                                                        type wildcard_source =
                                                                        1. | Arg_of of wildcard_source
                                                                        2. | Ret_of of wildcard_source
                                                                        3. | From_source of Dolmen.Std.Term.t
                                                                        4. | Added_type_argument of Dolmen.Std.Term.t
                                                                        5. | Symbol_inference of sym_inference_source
                                                                        6. | Variable_inference of var_inference_source
                                                                        type wildcard_shape =
                                                                        1. | Forbidden
                                                                        2. | Any_in_scope
                                                                        3. | Any_base of {
                                                                          1. allowed : Ty.t list;
                                                                          2. preferred : Ty.t;
                                                                          }
                                                                        4. | Arrow of {
                                                                          1. arg_shape : wildcard_shape;
                                                                          2. ret_shape : wildcard_shape;
                                                                          }
                                                                        type infer_unbound_var_scheme =
                                                                        1. | No_inference
                                                                        2. | Unification_type_variable
                                                                        type infer_term_scheme =
                                                                        1. | No_inference
                                                                        2. | Wildcard of wildcard_shape
                                                                        type var_infer = {
                                                                        1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                        2. infer_type_vars_in_binding_pos : bool;
                                                                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                        }

                                                                        Specification of how to infer variables.

                                                                        type sym_infer = {
                                                                        1. infer_type_csts : bool;
                                                                        2. infer_term_csts : infer_term_scheme;
                                                                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                        }

                                                                        Specification of how to infer symbols.

                                                                        type free_wildcards =
                                                                        1. | Forbidden
                                                                        2. | Implicitly_universally_quantified
                                                                        type expect =
                                                                        1. | Type
                                                                        2. | Term
                                                                        3. | Anything
                                                                        type tag =
                                                                        1. | Set : 'a Tag.t * 'a -> tag
                                                                        2. | Add : 'a list Tag.t * 'a -> tag
                                                                          (*

                                                                          Existencial wrapper around tags

                                                                          *)
                                                                        type res =
                                                                        1. | Ttype
                                                                        2. | Ty of Ty.t
                                                                        3. | Term of T.t
                                                                        4. | Tags of tag list

                                                                        The results of parsing an untyped term.

                                                                        type reservation =
                                                                        1. | Strict
                                                                          (*

                                                                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                          *)
                                                                        2. | Model_completion
                                                                          (*

                                                                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                          *)

                                                                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                        type reason =
                                                                        1. | Builtin
                                                                        2. | Reserved of reservation * string
                                                                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                          (*

                                                                          The type of reasons for constant typing

                                                                          *)
                                                                        type binding = [
                                                                        1. | `Not_found
                                                                        2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                        ]

                                                                        The bindings that can occur.

                                                                        type var_kind = [
                                                                        1. | `Let_bound
                                                                        2. | `Quantified
                                                                        3. | `Function_param
                                                                        4. | `Type_alias_param
                                                                        ]

                                                                        The type of kinds of variables

                                                                        type nonrec symbol = Intf.symbol =
                                                                        1. | Id of Dolmen.Std.Id.t
                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                        Errors and warnings

                                                                        type _ warn = ..

                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                        type warn +=
                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          Unused quantified type variable

                                                                          *)
                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          Unused quantified term variable

                                                                          *)
                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          An error occurred wile parsing an attribute

                                                                          *)
                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                        ]
                                                                        type builtin_meta_ttype = unit

                                                                        The bindings that can occur.

                                                                        type builtin_meta_ty = unit
                                                                        type builtin_meta_tags = unit

                                                                        Some type aliases

                                                                        type partial_semantics = [
                                                                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                        ]
                                                                        type term_semantics = [
                                                                        1. | partial_semantics
                                                                        2. | `Total
                                                                        ]

                                                                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                        type builtin_meta_term = term_semantics

                                                                        Meta data for term builtins.

                                                                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                        Small record to hold the results of builtin parsing by theories.

                                                                        type builtin_res = [
                                                                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                        6. | `Infer of binding * var_infer * sym_infer
                                                                        ]

                                                                        The result of parsing a symbol by the theory

                                                                        type not_found = [
                                                                        1. | `Not_found
                                                                        ]

                                                                        Not bound bindings

                                                                        type var_kind = [
                                                                        1. | `Let_bound
                                                                        2. | `Quantified
                                                                        3. | `Function_param
                                                                        4. | `Type_alias_param
                                                                        ]

                                                                        The type of kinds of variables

                                                                        type nonrec symbol = Intf.symbol =
                                                                        1. | Id of Dolmen.Std.Id.t
                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                        Errors and warnings

                                                                        type _ warn = ..

                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                        type warn +=
                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          Unused quantified type variable

                                                                          *)
                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          Unused quantified term variable

                                                                          *)
                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          An error occurred wile parsing an attribute

                                                                          *)
                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                          *)
                                                                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                          (*

                                                                          Redundant cases in pattern matching

                                                                          *)

                                                                        Warnings that cna trigger on regular parsed terms.

                                                                        type warn +=
                                                                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                          (*

                                                                          Shadowing of the given identifier, together with the old and current binding.

                                                                          *)

                                                                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                        type _ err = ..

                                                                        The type of errors, parameterized by the type of fragment they can trigger on

                                                                        type err +=
                                                                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                          (*

                                                                          Not well-dounded datatypes definitions.

                                                                          *)

                                                                        Errors that occur on declaration(s)

                                                                        type err +=
                                                                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          The parsed term didn't match the expected shape

                                                                          *)
                                                                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                          *)
                                                                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                          *)
                                                                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                          *)
                                                                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                          *)
                                                                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                          *)
                                                                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                          (*

                                                                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Def/Subst/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Def/Subst/argument-1-Type/index.html index 87cbb8d92..7ad9fd645 100644 --- a/dev/dolmen_type/Dolmen_type/Def/Subst/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Def/Subst/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                          Type definitions

                                                                          type order =
                                                                          1. | First_order
                                                                            (*

                                                                            First-oreder typechecking

                                                                            *)
                                                                          2. | Higher_order
                                                                            (*

                                                                            Higher-order typechecking

                                                                            *)

                                                                          Control whether the typechecker should type

                                                                          type poly =
                                                                          1. | Explicit
                                                                            (*

                                                                            Type arguments must be explicitly given in funciton applications

                                                                            *)
                                                                          2. | Implicit
                                                                            (*

                                                                            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                            *)
                                                                          3. | Flexible
                                                                            (*

                                                                            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                            *)

                                                                          The various polymorphism mode for the typechecker

                                                                          type sym_inference_source = {
                                                                          1. symbol : Dolmen.Std.Id.t;
                                                                          2. symbol_loc : Dolmen.Std.Loc.t;
                                                                          3. mutable inferred_ty : Ty.t;
                                                                          }
                                                                          type var_inference_source = {
                                                                          1. variable : Dolmen.Std.Id.t;
                                                                          2. variable_loc : Dolmen.Std.Loc.t;
                                                                          3. mutable inferred_ty : Ty.t;
                                                                          }
                                                                          type wildcard_source =
                                                                          1. | Arg_of of wildcard_source
                                                                          2. | Ret_of of wildcard_source
                                                                          3. | From_source of Dolmen.Std.Term.t
                                                                          4. | Added_type_argument of Dolmen.Std.Term.t
                                                                          5. | Symbol_inference of sym_inference_source
                                                                          6. | Variable_inference of var_inference_source
                                                                          type wildcard_shape =
                                                                          1. | Forbidden
                                                                          2. | Any_in_scope
                                                                          3. | Any_base of {
                                                                            1. allowed : Ty.t list;
                                                                            2. preferred : Ty.t;
                                                                            }
                                                                          4. | Arrow of {
                                                                            1. arg_shape : wildcard_shape;
                                                                            2. ret_shape : wildcard_shape;
                                                                            }
                                                                          type infer_unbound_var_scheme =
                                                                          1. | No_inference
                                                                          2. | Unification_type_variable
                                                                          type infer_term_scheme =
                                                                          1. | No_inference
                                                                          2. | Wildcard of wildcard_shape
                                                                          type var_infer = {
                                                                          1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                          2. infer_type_vars_in_binding_pos : bool;
                                                                          3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                          }

                                                                          Specification of how to infer variables.

                                                                          type sym_infer = {
                                                                          1. infer_type_csts : bool;
                                                                          2. infer_term_csts : infer_term_scheme;
                                                                          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                          }

                                                                          Specification of how to infer symbols.

                                                                          type free_wildcards =
                                                                          1. | Forbidden
                                                                          2. | Implicitly_universally_quantified
                                                                          type expect =
                                                                          1. | Type
                                                                          2. | Term
                                                                          3. | Anything
                                                                          type tag =
                                                                          1. | Set : 'a Tag.t * 'a -> tag
                                                                          2. | Add : 'a list Tag.t * 'a -> tag
                                                                            (*

                                                                            Existencial wrapper around tags

                                                                            *)
                                                                          type res =
                                                                          1. | Ttype
                                                                          2. | Ty of Ty.t
                                                                          3. | Term of T.t
                                                                          4. | Tags of tag list

                                                                          The results of parsing an untyped term.

                                                                          type builtin_meta_ttype = unit
                                                                          type builtin_meta_ty = unit
                                                                          type builtin_meta_tags = unit

                                                                          Some type aliases

                                                                          type term_semantics = [
                                                                          1. | `Total
                                                                          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                          ]

                                                                          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                          type builtin_meta_term = term_semantics

                                                                          Meta data for term builtins.

                                                                          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                          Small record to hold the results of builtin parsing by theories.

                                                                          type builtin_res = [
                                                                          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                          6. | `Infer of string * var_infer * sym_infer
                                                                          ]

                                                                          The result of parsing a symbol by the theory

                                                                          type not_found = [
                                                                          1. | `Not_found
                                                                          ]

                                                                          Not bound bindings

                                                                          type reason =
                                                                          1. | Builtin
                                                                          2. | Reserved of string
                                                                          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                            (*

                                                                            The type of reasons for constant typing

                                                                            *)
                                                                          type binding = [
                                                                          1. | `Not_found
                                                                          2. | `Reserved of string
                                                                          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                            Type definitions

                                                                            type order =
                                                                            1. | First_order
                                                                              (*

                                                                              First-oreder typechecking

                                                                              *)
                                                                            2. | Higher_order
                                                                              (*

                                                                              Higher-order typechecking

                                                                              *)

                                                                            Control whether the typechecker should type

                                                                            type poly =
                                                                            1. | Explicit
                                                                              (*

                                                                              Type arguments must be explicitly given in funciton applications

                                                                              *)
                                                                            2. | Implicit
                                                                              (*

                                                                              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                              *)
                                                                            3. | Flexible
                                                                              (*

                                                                              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                              *)

                                                                            The various polymorphism mode for the typechecker

                                                                            type sym_inference_source = {
                                                                            1. symbol : Dolmen.Std.Id.t;
                                                                            2. symbol_loc : Dolmen.Std.Loc.t;
                                                                            3. mutable inferred_ty : Ty.t;
                                                                            }
                                                                            type var_inference_source = {
                                                                            1. variable : Dolmen.Std.Id.t;
                                                                            2. variable_loc : Dolmen.Std.Loc.t;
                                                                            3. mutable inferred_ty : Ty.t;
                                                                            }
                                                                            type wildcard_source =
                                                                            1. | Arg_of of wildcard_source
                                                                            2. | Ret_of of wildcard_source
                                                                            3. | From_source of Dolmen.Std.Term.t
                                                                            4. | Added_type_argument of Dolmen.Std.Term.t
                                                                            5. | Symbol_inference of sym_inference_source
                                                                            6. | Variable_inference of var_inference_source
                                                                            type wildcard_shape =
                                                                            1. | Forbidden
                                                                            2. | Any_in_scope
                                                                            3. | Any_base of {
                                                                              1. allowed : Ty.t list;
                                                                              2. preferred : Ty.t;
                                                                              }
                                                                            4. | Arrow of {
                                                                              1. arg_shape : wildcard_shape;
                                                                              2. ret_shape : wildcard_shape;
                                                                              }
                                                                            type infer_unbound_var_scheme =
                                                                            1. | No_inference
                                                                            2. | Unification_type_variable
                                                                            type infer_term_scheme =
                                                                            1. | No_inference
                                                                            2. | Wildcard of wildcard_shape
                                                                            type var_infer = {
                                                                            1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                            2. infer_type_vars_in_binding_pos : bool;
                                                                            3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                            }

                                                                            Specification of how to infer variables.

                                                                            type sym_infer = {
                                                                            1. infer_type_csts : bool;
                                                                            2. infer_term_csts : infer_term_scheme;
                                                                            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                            }

                                                                            Specification of how to infer symbols.

                                                                            type free_wildcards =
                                                                            1. | Forbidden
                                                                            2. | Implicitly_universally_quantified
                                                                            type expect =
                                                                            1. | Type
                                                                            2. | Term
                                                                            3. | Anything
                                                                            type tag =
                                                                            1. | Set : 'a Tag.t * 'a -> tag
                                                                            2. | Add : 'a list Tag.t * 'a -> tag
                                                                              (*

                                                                              Existencial wrapper around tags

                                                                              *)
                                                                            type res =
                                                                            1. | Ttype
                                                                            2. | Ty of Ty.t
                                                                            3. | Term of T.t
                                                                            4. | Tags of tag list

                                                                            The results of parsing an untyped term.

                                                                            type reservation =
                                                                            1. | Strict
                                                                              (*

                                                                              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                              *)
                                                                            2. | Model_completion
                                                                              (*

                                                                              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                              *)

                                                                            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                            type reason =
                                                                            1. | Builtin
                                                                            2. | Reserved of reservation * string
                                                                            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                              (*

                                                                              The type of reasons for constant typing

                                                                              *)
                                                                            type binding = [
                                                                            1. | `Not_found
                                                                            2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                            ]

                                                                            The bindings that can occur.

                                                                            type var_kind = [
                                                                            1. | `Let_bound
                                                                            2. | `Quantified
                                                                            3. | `Function_param
                                                                            4. | `Type_alias_param
                                                                            ]

                                                                            The type of kinds of variables

                                                                            type nonrec symbol = Intf.symbol =
                                                                            1. | Id of Dolmen.Std.Id.t
                                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                                            Errors and warnings

                                                                            type _ warn = ..

                                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                                            type warn +=
                                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              Unused quantified type variable

                                                                              *)
                                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              Unused quantified term variable

                                                                              *)
                                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              An error occurred wile parsing an attribute

                                                                              *)
                                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                            ]
                                                                            type builtin_meta_ttype = unit

                                                                            The bindings that can occur.

                                                                            type builtin_meta_ty = unit
                                                                            type builtin_meta_tags = unit

                                                                            Some type aliases

                                                                            type partial_semantics = [
                                                                            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                            ]
                                                                            type term_semantics = [
                                                                            1. | partial_semantics
                                                                            2. | `Total
                                                                            ]

                                                                            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                            type builtin_meta_term = term_semantics

                                                                            Meta data for term builtins.

                                                                            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                            Small record to hold the results of builtin parsing by theories.

                                                                            type builtin_res = [
                                                                            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                            6. | `Infer of binding * var_infer * sym_infer
                                                                            ]

                                                                            The result of parsing a symbol by the theory

                                                                            type not_found = [
                                                                            1. | `Not_found
                                                                            ]

                                                                            Not bound bindings

                                                                            type var_kind = [
                                                                            1. | `Let_bound
                                                                            2. | `Quantified
                                                                            3. | `Function_param
                                                                            4. | `Type_alias_param
                                                                            ]

                                                                            The type of kinds of variables

                                                                            type nonrec symbol = Intf.symbol =
                                                                            1. | Id of Dolmen.Std.Id.t
                                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                                            Errors and warnings

                                                                            type _ warn = ..

                                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                                            type warn +=
                                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              Unused quantified type variable

                                                                              *)
                                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              Unused quantified term variable

                                                                              *)
                                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              An error occurred wile parsing an attribute

                                                                              *)
                                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                              *)
                                                                            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                              (*

                                                                              Redundant cases in pattern matching

                                                                              *)

                                                                            Warnings that cna trigger on regular parsed terms.

                                                                            type warn +=
                                                                            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                              (*

                                                                              Shadowing of the given identifier, together with the old and current binding.

                                                                              *)

                                                                            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                            type _ err = ..

                                                                            The type of errors, parameterized by the type of fragment they can trigger on

                                                                            type err +=
                                                                            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                              (*

                                                                              Not well-dounded datatypes definitions.

                                                                              *)

                                                                            Errors that occur on declaration(s)

                                                                            type err +=
                                                                            1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              The parsed term didn't match the expected shape

                                                                              *)
                                                                            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                              *)
                                                                            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                              *)
                                                                            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                              *)
                                                                            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                              *)
                                                                            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                              *)
                                                                            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                              (*

                                                                              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Float/Smtlib2/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Float/Smtlib2/Tff/argument-1-Type/index.html index 166b3c7f4..0ca078e23 100644 --- a/dev/dolmen_type/Dolmen_type/Float/Smtlib2/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Float/Smtlib2/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                              Type definitions

                                                                              type order =
                                                                              1. | First_order
                                                                                (*

                                                                                First-oreder typechecking

                                                                                *)
                                                                              2. | Higher_order
                                                                                (*

                                                                                Higher-order typechecking

                                                                                *)

                                                                              Control whether the typechecker should type

                                                                              type poly =
                                                                              1. | Explicit
                                                                                (*

                                                                                Type arguments must be explicitly given in funciton applications

                                                                                *)
                                                                              2. | Implicit
                                                                                (*

                                                                                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                *)
                                                                              3. | Flexible
                                                                                (*

                                                                                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                *)

                                                                              The various polymorphism mode for the typechecker

                                                                              type sym_inference_source = {
                                                                              1. symbol : Dolmen.Std.Id.t;
                                                                              2. symbol_loc : Dolmen.Std.Loc.t;
                                                                              3. mutable inferred_ty : Ty.t;
                                                                              }
                                                                              type var_inference_source = {
                                                                              1. variable : Dolmen.Std.Id.t;
                                                                              2. variable_loc : Dolmen.Std.Loc.t;
                                                                              3. mutable inferred_ty : Ty.t;
                                                                              }
                                                                              type wildcard_source =
                                                                              1. | Arg_of of wildcard_source
                                                                              2. | Ret_of of wildcard_source
                                                                              3. | From_source of Dolmen.Std.Term.t
                                                                              4. | Added_type_argument of Dolmen.Std.Term.t
                                                                              5. | Symbol_inference of sym_inference_source
                                                                              6. | Variable_inference of var_inference_source
                                                                              type wildcard_shape =
                                                                              1. | Forbidden
                                                                              2. | Any_in_scope
                                                                              3. | Any_base of {
                                                                                1. allowed : Ty.t list;
                                                                                2. preferred : Ty.t;
                                                                                }
                                                                              4. | Arrow of {
                                                                                1. arg_shape : wildcard_shape;
                                                                                2. ret_shape : wildcard_shape;
                                                                                }
                                                                              type infer_unbound_var_scheme =
                                                                              1. | No_inference
                                                                              2. | Unification_type_variable
                                                                              type infer_term_scheme =
                                                                              1. | No_inference
                                                                              2. | Wildcard of wildcard_shape
                                                                              type var_infer = {
                                                                              1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                              2. infer_type_vars_in_binding_pos : bool;
                                                                              3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                              }

                                                                              Specification of how to infer variables.

                                                                              type sym_infer = {
                                                                              1. infer_type_csts : bool;
                                                                              2. infer_term_csts : infer_term_scheme;
                                                                              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                              }

                                                                              Specification of how to infer symbols.

                                                                              type free_wildcards =
                                                                              1. | Forbidden
                                                                              2. | Implicitly_universally_quantified
                                                                              type expect =
                                                                              1. | Type
                                                                              2. | Term
                                                                              3. | Anything
                                                                              type tag =
                                                                              1. | Set : 'a Tag.t * 'a -> tag
                                                                              2. | Add : 'a list Tag.t * 'a -> tag
                                                                                (*

                                                                                Existencial wrapper around tags

                                                                                *)
                                                                              type res =
                                                                              1. | Ttype
                                                                              2. | Ty of Ty.t
                                                                              3. | Term of T.t
                                                                              4. | Tags of tag list

                                                                              The results of parsing an untyped term.

                                                                              type builtin_meta_ttype = unit
                                                                              type builtin_meta_ty = unit
                                                                              type builtin_meta_tags = unit

                                                                              Some type aliases

                                                                              type term_semantics = [
                                                                              1. | `Total
                                                                              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                              ]

                                                                              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                              type builtin_meta_term = term_semantics

                                                                              Meta data for term builtins.

                                                                              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                              Small record to hold the results of builtin parsing by theories.

                                                                              type builtin_res = [
                                                                              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                              6. | `Infer of string * var_infer * sym_infer
                                                                              ]

                                                                              The result of parsing a symbol by the theory

                                                                              type not_found = [
                                                                              1. | `Not_found
                                                                              ]

                                                                              Not bound bindings

                                                                              type reason =
                                                                              1. | Builtin
                                                                              2. | Reserved of string
                                                                              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                (*

                                                                                The type of reasons for constant typing

                                                                                *)
                                                                              type binding = [
                                                                              1. | `Not_found
                                                                              2. | `Reserved of string
                                                                              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                Type definitions

                                                                                type order =
                                                                                1. | First_order
                                                                                  (*

                                                                                  First-oreder typechecking

                                                                                  *)
                                                                                2. | Higher_order
                                                                                  (*

                                                                                  Higher-order typechecking

                                                                                  *)

                                                                                Control whether the typechecker should type

                                                                                type poly =
                                                                                1. | Explicit
                                                                                  (*

                                                                                  Type arguments must be explicitly given in funciton applications

                                                                                  *)
                                                                                2. | Implicit
                                                                                  (*

                                                                                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                  *)
                                                                                3. | Flexible
                                                                                  (*

                                                                                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                  *)

                                                                                The various polymorphism mode for the typechecker

                                                                                type sym_inference_source = {
                                                                                1. symbol : Dolmen.Std.Id.t;
                                                                                2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                3. mutable inferred_ty : Ty.t;
                                                                                }
                                                                                type var_inference_source = {
                                                                                1. variable : Dolmen.Std.Id.t;
                                                                                2. variable_loc : Dolmen.Std.Loc.t;
                                                                                3. mutable inferred_ty : Ty.t;
                                                                                }
                                                                                type wildcard_source =
                                                                                1. | Arg_of of wildcard_source
                                                                                2. | Ret_of of wildcard_source
                                                                                3. | From_source of Dolmen.Std.Term.t
                                                                                4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                5. | Symbol_inference of sym_inference_source
                                                                                6. | Variable_inference of var_inference_source
                                                                                type wildcard_shape =
                                                                                1. | Forbidden
                                                                                2. | Any_in_scope
                                                                                3. | Any_base of {
                                                                                  1. allowed : Ty.t list;
                                                                                  2. preferred : Ty.t;
                                                                                  }
                                                                                4. | Arrow of {
                                                                                  1. arg_shape : wildcard_shape;
                                                                                  2. ret_shape : wildcard_shape;
                                                                                  }
                                                                                type infer_unbound_var_scheme =
                                                                                1. | No_inference
                                                                                2. | Unification_type_variable
                                                                                type infer_term_scheme =
                                                                                1. | No_inference
                                                                                2. | Wildcard of wildcard_shape
                                                                                type var_infer = {
                                                                                1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                2. infer_type_vars_in_binding_pos : bool;
                                                                                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                }

                                                                                Specification of how to infer variables.

                                                                                type sym_infer = {
                                                                                1. infer_type_csts : bool;
                                                                                2. infer_term_csts : infer_term_scheme;
                                                                                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                }

                                                                                Specification of how to infer symbols.

                                                                                type free_wildcards =
                                                                                1. | Forbidden
                                                                                2. | Implicitly_universally_quantified
                                                                                type expect =
                                                                                1. | Type
                                                                                2. | Term
                                                                                3. | Anything
                                                                                type tag =
                                                                                1. | Set : 'a Tag.t * 'a -> tag
                                                                                2. | Add : 'a list Tag.t * 'a -> tag
                                                                                  (*

                                                                                  Existencial wrapper around tags

                                                                                  *)
                                                                                type res =
                                                                                1. | Ttype
                                                                                2. | Ty of Ty.t
                                                                                3. | Term of T.t
                                                                                4. | Tags of tag list

                                                                                The results of parsing an untyped term.

                                                                                type reservation =
                                                                                1. | Strict
                                                                                  (*

                                                                                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                  *)
                                                                                2. | Model_completion
                                                                                  (*

                                                                                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                  *)

                                                                                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                type reason =
                                                                                1. | Builtin
                                                                                2. | Reserved of reservation * string
                                                                                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                  (*

                                                                                  The type of reasons for constant typing

                                                                                  *)
                                                                                type binding = [
                                                                                1. | `Not_found
                                                                                2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                ]

                                                                                The bindings that can occur.

                                                                                type var_kind = [
                                                                                1. | `Let_bound
                                                                                2. | `Quantified
                                                                                3. | `Function_param
                                                                                4. | `Type_alias_param
                                                                                ]

                                                                                The type of kinds of variables

                                                                                type nonrec symbol = Intf.symbol =
                                                                                1. | Id of Dolmen.Std.Id.t
                                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                                Errors and warnings

                                                                                type _ warn = ..

                                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                type warn +=
                                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  Unused quantified type variable

                                                                                  *)
                                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  Unused quantified term variable

                                                                                  *)
                                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  An error occurred wile parsing an attribute

                                                                                  *)
                                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                ]
                                                                                type builtin_meta_ttype = unit

                                                                                The bindings that can occur.

                                                                                type builtin_meta_ty = unit
                                                                                type builtin_meta_tags = unit

                                                                                Some type aliases

                                                                                type partial_semantics = [
                                                                                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                ]
                                                                                type term_semantics = [
                                                                                1. | partial_semantics
                                                                                2. | `Total
                                                                                ]

                                                                                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                type builtin_meta_term = term_semantics

                                                                                Meta data for term builtins.

                                                                                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                Small record to hold the results of builtin parsing by theories.

                                                                                type builtin_res = [
                                                                                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                6. | `Infer of binding * var_infer * sym_infer
                                                                                ]

                                                                                The result of parsing a symbol by the theory

                                                                                type not_found = [
                                                                                1. | `Not_found
                                                                                ]

                                                                                Not bound bindings

                                                                                type var_kind = [
                                                                                1. | `Let_bound
                                                                                2. | `Quantified
                                                                                3. | `Function_param
                                                                                4. | `Type_alias_param
                                                                                ]

                                                                                The type of kinds of variables

                                                                                type nonrec symbol = Intf.symbol =
                                                                                1. | Id of Dolmen.Std.Id.t
                                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                                Errors and warnings

                                                                                type _ warn = ..

                                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                type warn +=
                                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  Unused quantified type variable

                                                                                  *)
                                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  Unused quantified term variable

                                                                                  *)
                                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  An error occurred wile parsing an attribute

                                                                                  *)
                                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                  *)
                                                                                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                  (*

                                                                                  Redundant cases in pattern matching

                                                                                  *)

                                                                                Warnings that cna trigger on regular parsed terms.

                                                                                type warn +=
                                                                                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                  (*

                                                                                  Shadowing of the given identifier, together with the old and current binding.

                                                                                  *)

                                                                                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                type _ err = ..

                                                                                The type of errors, parameterized by the type of fragment they can trigger on

                                                                                type err +=
                                                                                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                  (*

                                                                                  Not well-dounded datatypes definitions.

                                                                                  *)

                                                                                Errors that occur on declaration(s)

                                                                                type err +=
                                                                                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  The parsed term didn't match the expected shape

                                                                                  *)
                                                                                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                  *)
                                                                                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                  *)
                                                                                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                  *)
                                                                                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                  *)
                                                                                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                  *)
                                                                                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                  (*

                                                                                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Intf/module-type-Formulas/index.html b/dev/dolmen_type/Dolmen_type/Intf/module-type-Formulas/index.html index 4a3b6fcd6..8be188720 100644 --- a/dev/dolmen_type/Dolmen_type/Intf/module-type-Formulas/index.html +++ b/dev/dolmen_type/Dolmen_type/Intf/module-type-Formulas/index.html @@ -1,14 +1,12 @@ -Formulas (dolmen_type.Dolmen_type.Intf.Formulas)

                                                                                  Module type Intf.Formulas

                                                                                  Typechecker interface

                                                                                  type ty

                                                                                  types

                                                                                  type ty_var
                                                                                  type ty_cst
                                                                                  type ty_def
                                                                                  type term
                                                                                  type term_var
                                                                                  type term_cst
                                                                                  type term_cstr
                                                                                  type term_field
                                                                                  type 'a ast_tag

                                                                                  Type definitions

                                                                                  type order =
                                                                                  1. | First_order
                                                                                    (*

                                                                                    First-oreder typechecking

                                                                                    *)
                                                                                  2. | Higher_order
                                                                                    (*

                                                                                    Higher-order typechecking

                                                                                    *)

                                                                                  Control whether the typechecker should type

                                                                                  type poly =
                                                                                  1. | Explicit
                                                                                    (*

                                                                                    Type arguments must be explicitly given in funciton applications

                                                                                    *)
                                                                                  2. | Implicit
                                                                                    (*

                                                                                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                    *)
                                                                                  3. | Flexible
                                                                                    (*

                                                                                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                    *)

                                                                                  The various polymorphism mode for the typechecker

                                                                                  type sym_inference_source = {
                                                                                  1. symbol : Dolmen.Std.Id.t;
                                                                                  2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                  3. mutable inferred_ty : ty;
                                                                                  }
                                                                                  type var_inference_source = {
                                                                                  1. variable : Dolmen.Std.Id.t;
                                                                                  2. variable_loc : Dolmen.Std.Loc.t;
                                                                                  3. mutable inferred_ty : ty;
                                                                                  }
                                                                                  type wildcard_source =
                                                                                  1. | Arg_of of wildcard_source
                                                                                  2. | Ret_of of wildcard_source
                                                                                  3. | From_source of Dolmen.Std.Term.t
                                                                                  4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                  5. | Symbol_inference of sym_inference_source
                                                                                  6. | Variable_inference of var_inference_source
                                                                                  type wildcard_shape =
                                                                                  1. | Forbidden
                                                                                  2. | Any_in_scope
                                                                                  3. | Any_base of {
                                                                                    1. allowed : ty list;
                                                                                    2. preferred : ty;
                                                                                    }
                                                                                  4. | Arrow of {
                                                                                    1. arg_shape : wildcard_shape;
                                                                                    2. ret_shape : wildcard_shape;
                                                                                    }
                                                                                  type infer_unbound_var_scheme =
                                                                                  1. | No_inference
                                                                                  2. | Unification_type_variable
                                                                                  type infer_term_scheme =
                                                                                  1. | No_inference
                                                                                  2. | Wildcard of wildcard_shape
                                                                                  type var_infer = {
                                                                                  1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                  2. infer_type_vars_in_binding_pos : bool;
                                                                                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                  4. var_hook : [ `Ty_var of ty_var | `Term_var of term_var ] -> unit;
                                                                                  }

                                                                                  Specification of how to infer variables.

                                                                                  type sym_infer = {
                                                                                  1. infer_type_csts : bool;
                                                                                  2. infer_term_csts : infer_term_scheme;
                                                                                  3. sym_hook : [ `Ty_cst of ty_cst | `Term_cst of term_cst ] -> unit;
                                                                                  }

                                                                                  Specification of how to infer symbols.

                                                                                  type free_wildcards =
                                                                                  1. | Forbidden
                                                                                  2. | Implicitly_universally_quantified
                                                                                  type expect =
                                                                                  1. | Type
                                                                                  2. | Term
                                                                                  3. | Anything
                                                                                  type tag =
                                                                                  1. | Set : 'a ast_tag * 'a -> tag
                                                                                  2. | Add : 'a list ast_tag * 'a -> tag
                                                                                    (*

                                                                                    Existencial wrapper around tags

                                                                                    *)
                                                                                  type res =
                                                                                  1. | Ttype
                                                                                  2. | Ty of ty
                                                                                  3. | Term of term
                                                                                  4. | Tags of tag list

                                                                                  The results of parsing an untyped term.

                                                                                  type builtin_meta_ttype = unit
                                                                                  type builtin_meta_ty = unit
                                                                                  type builtin_meta_tags = unit

                                                                                  Some type aliases

                                                                                  type term_semantics = [
                                                                                  1. | `Total
                                                                                  2. | `Partial of ty_var list -> term_var list -> ty -> term_cst
                                                                                  ]

                                                                                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                  type builtin_meta_term = term_semantics

                                                                                  Meta data for term builtins.

                                                                                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                  Small record to hold the results of builtin parsing by theories.

                                                                                  type builtin_res = [
                                                                                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                  2. | `Ty of (ty, builtin_meta_ty) builtin_common_res
                                                                                  3. | `Term of (term, builtin_meta_term) builtin_common_res
                                                                                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                  5. | `Reserved of - string - * [ `Solver | `Term_cst of ty_var list -> term_var list -> ty -> term_cst ]
                                                                                  6. | `Infer of string * var_infer * sym_infer
                                                                                  ]

                                                                                  The result of parsing a symbol by the theory

                                                                                  type not_found = [
                                                                                  1. | `Not_found
                                                                                  ]

                                                                                  Not bound bindings

                                                                                  type reason =
                                                                                  1. | Builtin
                                                                                  2. | Reserved of string
                                                                                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                    (*

                                                                                    The type of reasons for constant typing

                                                                                    *)
                                                                                  type binding = [
                                                                                  1. | `Not_found
                                                                                  2. | `Reserved of string
                                                                                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                  4. | `Variable of +Formulas (dolmen_type.Dolmen_type.Intf.Formulas)

                                                                                    Module type Intf.Formulas

                                                                                    Typechecker interface

                                                                                    type ty

                                                                                    types

                                                                                    type ty_var
                                                                                    type ty_cst
                                                                                    type ty_def
                                                                                    type term
                                                                                    type term_var
                                                                                    type term_cst
                                                                                    type term_cstr
                                                                                    type term_field
                                                                                    type 'a ast_tag

                                                                                    Type definitions

                                                                                    type order =
                                                                                    1. | First_order
                                                                                      (*

                                                                                      First-oreder typechecking

                                                                                      *)
                                                                                    2. | Higher_order
                                                                                      (*

                                                                                      Higher-order typechecking

                                                                                      *)

                                                                                    Control whether the typechecker should type

                                                                                    type poly =
                                                                                    1. | Explicit
                                                                                      (*

                                                                                      Type arguments must be explicitly given in funciton applications

                                                                                      *)
                                                                                    2. | Implicit
                                                                                      (*

                                                                                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                      *)
                                                                                    3. | Flexible
                                                                                      (*

                                                                                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                      *)

                                                                                    The various polymorphism mode for the typechecker

                                                                                    type sym_inference_source = {
                                                                                    1. symbol : Dolmen.Std.Id.t;
                                                                                    2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                    3. mutable inferred_ty : ty;
                                                                                    }
                                                                                    type var_inference_source = {
                                                                                    1. variable : Dolmen.Std.Id.t;
                                                                                    2. variable_loc : Dolmen.Std.Loc.t;
                                                                                    3. mutable inferred_ty : ty;
                                                                                    }
                                                                                    type wildcard_source =
                                                                                    1. | Arg_of of wildcard_source
                                                                                    2. | Ret_of of wildcard_source
                                                                                    3. | From_source of Dolmen.Std.Term.t
                                                                                    4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                    5. | Symbol_inference of sym_inference_source
                                                                                    6. | Variable_inference of var_inference_source
                                                                                    type wildcard_shape =
                                                                                    1. | Forbidden
                                                                                    2. | Any_in_scope
                                                                                    3. | Any_base of {
                                                                                      1. allowed : ty list;
                                                                                      2. preferred : ty;
                                                                                      }
                                                                                    4. | Arrow of {
                                                                                      1. arg_shape : wildcard_shape;
                                                                                      2. ret_shape : wildcard_shape;
                                                                                      }
                                                                                    type infer_unbound_var_scheme =
                                                                                    1. | No_inference
                                                                                    2. | Unification_type_variable
                                                                                    type infer_term_scheme =
                                                                                    1. | No_inference
                                                                                    2. | Wildcard of wildcard_shape
                                                                                    type var_infer = {
                                                                                    1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                    2. infer_type_vars_in_binding_pos : bool;
                                                                                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                    4. var_hook : [ `Ty_var of ty_var | `Term_var of term_var ] -> unit;
                                                                                    }

                                                                                    Specification of how to infer variables.

                                                                                    type sym_infer = {
                                                                                    1. infer_type_csts : bool;
                                                                                    2. infer_term_csts : infer_term_scheme;
                                                                                    3. sym_hook : [ `Ty_cst of ty_cst | `Term_cst of term_cst ] -> unit;
                                                                                    }

                                                                                    Specification of how to infer symbols.

                                                                                    type free_wildcards =
                                                                                    1. | Forbidden
                                                                                    2. | Implicitly_universally_quantified
                                                                                    type expect =
                                                                                    1. | Type
                                                                                    2. | Term
                                                                                    3. | Anything
                                                                                    type tag =
                                                                                    1. | Set : 'a ast_tag * 'a -> tag
                                                                                    2. | Add : 'a list ast_tag * 'a -> tag
                                                                                      (*

                                                                                      Existencial wrapper around tags

                                                                                      *)
                                                                                    type res =
                                                                                    1. | Ttype
                                                                                    2. | Ty of ty
                                                                                    3. | Term of term
                                                                                    4. | Tags of tag list

                                                                                    The results of parsing an untyped term.

                                                                                    type reservation =
                                                                                    1. | Strict
                                                                                      (*

                                                                                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                      *)
                                                                                    2. | Model_completion
                                                                                      (*

                                                                                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                      *)

                                                                                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                    type reason =
                                                                                    1. | Builtin
                                                                                    2. | Reserved of reservation * string
                                                                                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                      (*

                                                                                      The type of reasons for constant typing

                                                                                      *)
                                                                                    type binding = [
                                                                                    1. | `Not_found
                                                                                    2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                    4. | `Variable of [ `Ty of ty_var * reason option | `Term of term_var * reason option ]
                                                                                    5. | `Constant of [ `Ty of ty_cst * reason option | `Cstr of term_cstr * reason option | `Dstr of term_cst * reason option | `Term of term_cst * reason option - | `Field of term_field * reason option ]
                                                                                    ]

                                                                                    The bindings that can occur.

                                                                                    type var_kind = [
                                                                                    1. | `Let_bound
                                                                                    2. | `Quantified
                                                                                    3. | `Function_param
                                                                                    4. | `Type_alias_param
                                                                                    ]

                                                                                    The type of kinds of variables

                                                                                    type nonrec symbol = symbol =
                                                                                    1. | Id of Dolmen.Std.Id.t
                                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                                    Errors and warnings

                                                                                    type _ warn = ..

                                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                    type warn +=
                                                                                    1. | Unused_type_variable : var_kind * ty_var -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      Unused quantified type variable

                                                                                      *)
                                                                                    2. | Unused_term_variable : var_kind * term_var -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      Unused quantified term variable

                                                                                      *)
                                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      An error occurred wile parsing an attribute

                                                                                      *)
                                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of term_field * reason option ]
                                                                                    ]
                                                                                    type builtin_meta_ttype = unit

                                                                                    The bindings that can occur.

                                                                                    type builtin_meta_ty = unit
                                                                                    type builtin_meta_tags = unit

                                                                                    Some type aliases

                                                                                    type partial_semantics = [
                                                                                    1. | `Partial of ty_var list -> term_var list -> ty -> term_cst
                                                                                    ]
                                                                                    type term_semantics = [
                                                                                    1. | partial_semantics
                                                                                    2. | `Total
                                                                                    ]

                                                                                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                    type builtin_meta_term = term_semantics

                                                                                    Meta data for term builtins.

                                                                                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                    Small record to hold the results of builtin parsing by theories.

                                                                                    type builtin_res = [
                                                                                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                    2. | `Ty of (ty, builtin_meta_ty) builtin_common_res
                                                                                    3. | `Term of (term, builtin_meta_term) builtin_common_res
                                                                                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                    6. | `Infer of binding * var_infer * sym_infer
                                                                                    ]

                                                                                    The result of parsing a symbol by the theory

                                                                                    type not_found = [
                                                                                    1. | `Not_found
                                                                                    ]

                                                                                    Not bound bindings

                                                                                    type var_kind = [
                                                                                    1. | `Let_bound
                                                                                    2. | `Quantified
                                                                                    3. | `Function_param
                                                                                    4. | `Type_alias_param
                                                                                    ]

                                                                                    The type of kinds of variables

                                                                                    type nonrec symbol = symbol =
                                                                                    1. | Id of Dolmen.Std.Id.t
                                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                                    Errors and warnings

                                                                                    type _ warn = ..

                                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                    type warn +=
                                                                                    1. | Unused_type_variable : var_kind * ty_var -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      Unused quantified type variable

                                                                                      *)
                                                                                    2. | Unused_term_variable : var_kind * term_var -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      Unused quantified term variable

                                                                                      *)
                                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      An error occurred wile parsing an attribute

                                                                                      *)
                                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * term_cst -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                      *)
                                                                                    5. | Redundant_pattern : term -> Dolmen.Std.Term.t warn
                                                                                      (*

                                                                                      Redundant cases in pattern matching

                                                                                      *)

                                                                                    Warnings that cna trigger on regular parsed terms.

                                                                                    type warn +=
                                                                                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                      (*

                                                                                      Shadowing of the given identifier, together with the old and current binding.

                                                                                      *)

                                                                                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                    type _ err = ..

                                                                                    The type of errors, parameterized by the type of fragment they can trigger on

                                                                                    type err +=
                                                                                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                      (*

                                                                                      Not well-dounded datatypes definitions.

                                                                                      *)

                                                                                    Errors that occur on declaration(s)

                                                                                    type err +=
                                                                                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      The parsed term didn't match the expected shape

                                                                                      *)
                                                                                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                      *)
                                                                                    3. | Bad_ty_arity : ty_cst * int -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                      *)
                                                                                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                      *)
                                                                                    5. | Bad_cstr_arity : term_cstr * int list * int -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                      *)
                                                                                    6. | Bad_term_arity : term_cst * int list * int -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                      *)
                                                                                    7. | Bad_poly_arity : ty_var list * ty list -> Dolmen.Std.Term.t err
                                                                                      (*

                                                                                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Strings/Smtlib2/Tff/argument-1-Type/index.html b/dev/dolmen_type/Dolmen_type/Strings/Smtlib2/Tff/argument-1-Type/index.html index 4f5a9f061..c17a73c25 100644 --- a/dev/dolmen_type/Dolmen_type/Strings/Smtlib2/Tff/argument-1-Type/index.html +++ b/dev/dolmen_type/Dolmen_type/Strings/Smtlib2/Tff/argument-1-Type/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                                      Type definitions

                                                                                      type order =
                                                                                      1. | First_order
                                                                                        (*

                                                                                        First-oreder typechecking

                                                                                        *)
                                                                                      2. | Higher_order
                                                                                        (*

                                                                                        Higher-order typechecking

                                                                                        *)

                                                                                      Control whether the typechecker should type

                                                                                      type poly =
                                                                                      1. | Explicit
                                                                                        (*

                                                                                        Type arguments must be explicitly given in funciton applications

                                                                                        *)
                                                                                      2. | Implicit
                                                                                        (*

                                                                                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                        *)
                                                                                      3. | Flexible
                                                                                        (*

                                                                                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                        *)

                                                                                      The various polymorphism mode for the typechecker

                                                                                      type sym_inference_source = {
                                                                                      1. symbol : Dolmen.Std.Id.t;
                                                                                      2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                      3. mutable inferred_ty : Ty.t;
                                                                                      }
                                                                                      type var_inference_source = {
                                                                                      1. variable : Dolmen.Std.Id.t;
                                                                                      2. variable_loc : Dolmen.Std.Loc.t;
                                                                                      3. mutable inferred_ty : Ty.t;
                                                                                      }
                                                                                      type wildcard_source =
                                                                                      1. | Arg_of of wildcard_source
                                                                                      2. | Ret_of of wildcard_source
                                                                                      3. | From_source of Dolmen.Std.Term.t
                                                                                      4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                      5. | Symbol_inference of sym_inference_source
                                                                                      6. | Variable_inference of var_inference_source
                                                                                      type wildcard_shape =
                                                                                      1. | Forbidden
                                                                                      2. | Any_in_scope
                                                                                      3. | Any_base of {
                                                                                        1. allowed : Ty.t list;
                                                                                        2. preferred : Ty.t;
                                                                                        }
                                                                                      4. | Arrow of {
                                                                                        1. arg_shape : wildcard_shape;
                                                                                        2. ret_shape : wildcard_shape;
                                                                                        }
                                                                                      type infer_unbound_var_scheme =
                                                                                      1. | No_inference
                                                                                      2. | Unification_type_variable
                                                                                      type infer_term_scheme =
                                                                                      1. | No_inference
                                                                                      2. | Wildcard of wildcard_shape
                                                                                      type var_infer = {
                                                                                      1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                      2. infer_type_vars_in_binding_pos : bool;
                                                                                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                      }

                                                                                      Specification of how to infer variables.

                                                                                      type sym_infer = {
                                                                                      1. infer_type_csts : bool;
                                                                                      2. infer_term_csts : infer_term_scheme;
                                                                                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                      }

                                                                                      Specification of how to infer symbols.

                                                                                      type free_wildcards =
                                                                                      1. | Forbidden
                                                                                      2. | Implicitly_universally_quantified
                                                                                      type expect =
                                                                                      1. | Type
                                                                                      2. | Term
                                                                                      3. | Anything
                                                                                      type tag =
                                                                                      1. | Set : 'a Tag.t * 'a -> tag
                                                                                      2. | Add : 'a list Tag.t * 'a -> tag
                                                                                        (*

                                                                                        Existencial wrapper around tags

                                                                                        *)
                                                                                      type res =
                                                                                      1. | Ttype
                                                                                      2. | Ty of Ty.t
                                                                                      3. | Term of T.t
                                                                                      4. | Tags of tag list

                                                                                      The results of parsing an untyped term.

                                                                                      type builtin_meta_ttype = unit
                                                                                      type builtin_meta_ty = unit
                                                                                      type builtin_meta_tags = unit

                                                                                      Some type aliases

                                                                                      type term_semantics = [
                                                                                      1. | `Total
                                                                                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                      ]

                                                                                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                      type builtin_meta_term = term_semantics

                                                                                      Meta data for term builtins.

                                                                                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                      Small record to hold the results of builtin parsing by theories.

                                                                                      type builtin_res = [
                                                                                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                                      6. | `Infer of string * var_infer * sym_infer
                                                                                      ]

                                                                                      The result of parsing a symbol by the theory

                                                                                      type not_found = [
                                                                                      1. | `Not_found
                                                                                      ]

                                                                                      Not bound bindings

                                                                                      type reason =
                                                                                      1. | Builtin
                                                                                      2. | Reserved of string
                                                                                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                        (*

                                                                                        The type of reasons for constant typing

                                                                                        *)
                                                                                      type binding = [
                                                                                      1. | `Not_found
                                                                                      2. | `Reserved of string
                                                                                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                        Type definitions

                                                                                        type order =
                                                                                        1. | First_order
                                                                                          (*

                                                                                          First-oreder typechecking

                                                                                          *)
                                                                                        2. | Higher_order
                                                                                          (*

                                                                                          Higher-order typechecking

                                                                                          *)

                                                                                        Control whether the typechecker should type

                                                                                        type poly =
                                                                                        1. | Explicit
                                                                                          (*

                                                                                          Type arguments must be explicitly given in funciton applications

                                                                                          *)
                                                                                        2. | Implicit
                                                                                          (*

                                                                                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                          *)
                                                                                        3. | Flexible
                                                                                          (*

                                                                                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                          *)

                                                                                        The various polymorphism mode for the typechecker

                                                                                        type sym_inference_source = {
                                                                                        1. symbol : Dolmen.Std.Id.t;
                                                                                        2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                        3. mutable inferred_ty : Ty.t;
                                                                                        }
                                                                                        type var_inference_source = {
                                                                                        1. variable : Dolmen.Std.Id.t;
                                                                                        2. variable_loc : Dolmen.Std.Loc.t;
                                                                                        3. mutable inferred_ty : Ty.t;
                                                                                        }
                                                                                        type wildcard_source =
                                                                                        1. | Arg_of of wildcard_source
                                                                                        2. | Ret_of of wildcard_source
                                                                                        3. | From_source of Dolmen.Std.Term.t
                                                                                        4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                        5. | Symbol_inference of sym_inference_source
                                                                                        6. | Variable_inference of var_inference_source
                                                                                        type wildcard_shape =
                                                                                        1. | Forbidden
                                                                                        2. | Any_in_scope
                                                                                        3. | Any_base of {
                                                                                          1. allowed : Ty.t list;
                                                                                          2. preferred : Ty.t;
                                                                                          }
                                                                                        4. | Arrow of {
                                                                                          1. arg_shape : wildcard_shape;
                                                                                          2. ret_shape : wildcard_shape;
                                                                                          }
                                                                                        type infer_unbound_var_scheme =
                                                                                        1. | No_inference
                                                                                        2. | Unification_type_variable
                                                                                        type infer_term_scheme =
                                                                                        1. | No_inference
                                                                                        2. | Wildcard of wildcard_shape
                                                                                        type var_infer = {
                                                                                        1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                        2. infer_type_vars_in_binding_pos : bool;
                                                                                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                        }

                                                                                        Specification of how to infer variables.

                                                                                        type sym_infer = {
                                                                                        1. infer_type_csts : bool;
                                                                                        2. infer_term_csts : infer_term_scheme;
                                                                                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                        }

                                                                                        Specification of how to infer symbols.

                                                                                        type free_wildcards =
                                                                                        1. | Forbidden
                                                                                        2. | Implicitly_universally_quantified
                                                                                        type expect =
                                                                                        1. | Type
                                                                                        2. | Term
                                                                                        3. | Anything
                                                                                        type tag =
                                                                                        1. | Set : 'a Tag.t * 'a -> tag
                                                                                        2. | Add : 'a list Tag.t * 'a -> tag
                                                                                          (*

                                                                                          Existencial wrapper around tags

                                                                                          *)
                                                                                        type res =
                                                                                        1. | Ttype
                                                                                        2. | Ty of Ty.t
                                                                                        3. | Term of T.t
                                                                                        4. | Tags of tag list

                                                                                        The results of parsing an untyped term.

                                                                                        type reservation =
                                                                                        1. | Strict
                                                                                          (*

                                                                                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                          *)
                                                                                        2. | Model_completion
                                                                                          (*

                                                                                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                          *)

                                                                                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                        type reason =
                                                                                        1. | Builtin
                                                                                        2. | Reserved of reservation * string
                                                                                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                          (*

                                                                                          The type of reasons for constant typing

                                                                                          *)
                                                                                        type binding = [
                                                                                        1. | `Not_found
                                                                                        2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                        ]

                                                                                        The bindings that can occur.

                                                                                        type var_kind = [
                                                                                        1. | `Let_bound
                                                                                        2. | `Quantified
                                                                                        3. | `Function_param
                                                                                        4. | `Type_alias_param
                                                                                        ]

                                                                                        The type of kinds of variables

                                                                                        type nonrec symbol = Intf.symbol =
                                                                                        1. | Id of Dolmen.Std.Id.t
                                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                                        Errors and warnings

                                                                                        type _ warn = ..

                                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                        type warn +=
                                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          Unused quantified type variable

                                                                                          *)
                                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          Unused quantified term variable

                                                                                          *)
                                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          An error occurred wile parsing an attribute

                                                                                          *)
                                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                        ]
                                                                                        type builtin_meta_ttype = unit

                                                                                        The bindings that can occur.

                                                                                        type builtin_meta_ty = unit
                                                                                        type builtin_meta_tags = unit

                                                                                        Some type aliases

                                                                                        type partial_semantics = [
                                                                                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                        ]
                                                                                        type term_semantics = [
                                                                                        1. | partial_semantics
                                                                                        2. | `Total
                                                                                        ]

                                                                                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                        type builtin_meta_term = term_semantics

                                                                                        Meta data for term builtins.

                                                                                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                        Small record to hold the results of builtin parsing by theories.

                                                                                        type builtin_res = [
                                                                                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                        6. | `Infer of binding * var_infer * sym_infer
                                                                                        ]

                                                                                        The result of parsing a symbol by the theory

                                                                                        type not_found = [
                                                                                        1. | `Not_found
                                                                                        ]

                                                                                        Not bound bindings

                                                                                        type var_kind = [
                                                                                        1. | `Let_bound
                                                                                        2. | `Quantified
                                                                                        3. | `Function_param
                                                                                        4. | `Type_alias_param
                                                                                        ]

                                                                                        The type of kinds of variables

                                                                                        type nonrec symbol = Intf.symbol =
                                                                                        1. | Id of Dolmen.Std.Id.t
                                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                                        Errors and warnings

                                                                                        type _ warn = ..

                                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                        type warn +=
                                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          Unused quantified type variable

                                                                                          *)
                                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          Unused quantified term variable

                                                                                          *)
                                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          An error occurred wile parsing an attribute

                                                                                          *)
                                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                          *)
                                                                                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                          (*

                                                                                          Redundant cases in pattern matching

                                                                                          *)

                                                                                        Warnings that cna trigger on regular parsed terms.

                                                                                        type warn +=
                                                                                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                          (*

                                                                                          Shadowing of the given identifier, together with the old and current binding.

                                                                                          *)

                                                                                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                        type _ err = ..

                                                                                        The type of errors, parameterized by the type of fragment they can trigger on

                                                                                        type err +=
                                                                                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                          (*

                                                                                          Not well-dounded datatypes definitions.

                                                                                          *)

                                                                                        Errors that occur on declaration(s)

                                                                                        type err +=
                                                                                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          The parsed term didn't match the expected shape

                                                                                          *)
                                                                                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                          *)
                                                                                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                          *)
                                                                                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                          *)
                                                                                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                          *)
                                                                                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                          *)
                                                                                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                          (*

                                                                                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Tff/Make/index.html b/dev/dolmen_type/Dolmen_type/Tff/Make/index.html index 33acfd1d3..791071d77 100644 --- a/dev/dolmen_type/Dolmen_type/Tff/Make/index.html +++ b/dev/dolmen_type/Dolmen_type/Tff/Make/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                                          Type definitions

                                                                                          type order =
                                                                                          1. | First_order
                                                                                            (*

                                                                                            First-oreder typechecking

                                                                                            *)
                                                                                          2. | Higher_order
                                                                                            (*

                                                                                            Higher-order typechecking

                                                                                            *)

                                                                                          Control whether the typechecker should type

                                                                                          type poly =
                                                                                          1. | Explicit
                                                                                            (*

                                                                                            Type arguments must be explicitly given in funciton applications

                                                                                            *)
                                                                                          2. | Implicit
                                                                                            (*

                                                                                            Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                            *)
                                                                                          3. | Flexible
                                                                                            (*

                                                                                            Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                            *)

                                                                                          The various polymorphism mode for the typechecker

                                                                                          type sym_inference_source = {
                                                                                          1. symbol : Dolmen.Std.Id.t;
                                                                                          2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                          3. mutable inferred_ty : Ty.t;
                                                                                          }
                                                                                          type var_inference_source = {
                                                                                          1. variable : Dolmen.Std.Id.t;
                                                                                          2. variable_loc : Dolmen.Std.Loc.t;
                                                                                          3. mutable inferred_ty : Ty.t;
                                                                                          }
                                                                                          type wildcard_source =
                                                                                          1. | Arg_of of wildcard_source
                                                                                          2. | Ret_of of wildcard_source
                                                                                          3. | From_source of Dolmen.Std.Term.t
                                                                                          4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                          5. | Symbol_inference of sym_inference_source
                                                                                          6. | Variable_inference of var_inference_source
                                                                                          type wildcard_shape =
                                                                                          1. | Forbidden
                                                                                          2. | Any_in_scope
                                                                                          3. | Any_base of {
                                                                                            1. allowed : Ty.t list;
                                                                                            2. preferred : Ty.t;
                                                                                            }
                                                                                          4. | Arrow of {
                                                                                            1. arg_shape : wildcard_shape;
                                                                                            2. ret_shape : wildcard_shape;
                                                                                            }
                                                                                          type infer_unbound_var_scheme =
                                                                                          1. | No_inference
                                                                                          2. | Unification_type_variable
                                                                                          type infer_term_scheme =
                                                                                          1. | No_inference
                                                                                          2. | Wildcard of wildcard_shape
                                                                                          type var_infer = {
                                                                                          1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                          2. infer_type_vars_in_binding_pos : bool;
                                                                                          3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                          4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                          }

                                                                                          Specification of how to infer variables.

                                                                                          type sym_infer = {
                                                                                          1. infer_type_csts : bool;
                                                                                          2. infer_term_csts : infer_term_scheme;
                                                                                          3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                          }

                                                                                          Specification of how to infer symbols.

                                                                                          type free_wildcards =
                                                                                          1. | Forbidden
                                                                                          2. | Implicitly_universally_quantified
                                                                                          type expect =
                                                                                          1. | Type
                                                                                          2. | Term
                                                                                          3. | Anything
                                                                                          type tag =
                                                                                          1. | Set : 'a Tag.t * 'a -> tag
                                                                                          2. | Add : 'a list Tag.t * 'a -> tag
                                                                                            (*

                                                                                            Existencial wrapper around tags

                                                                                            *)
                                                                                          type res =
                                                                                          1. | Ttype
                                                                                          2. | Ty of Ty.t
                                                                                          3. | Term of T.t
                                                                                          4. | Tags of tag list

                                                                                          The results of parsing an untyped term.

                                                                                          type builtin_meta_ttype = unit
                                                                                          type builtin_meta_ty = unit
                                                                                          type builtin_meta_tags = unit

                                                                                          Some type aliases

                                                                                          type term_semantics = [
                                                                                          1. | `Total
                                                                                          2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                          ]

                                                                                          Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                          type builtin_meta_term = term_semantics

                                                                                          Meta data for term builtins.

                                                                                          type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                          Small record to hold the results of builtin parsing by theories.

                                                                                          type builtin_res = [
                                                                                          1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                          2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                          3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                          4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                          5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                                          6. | `Infer of string * var_infer * sym_infer
                                                                                          ]

                                                                                          The result of parsing a symbol by the theory

                                                                                          type not_found = [
                                                                                          1. | `Not_found
                                                                                          ]

                                                                                          Not bound bindings

                                                                                          type reason =
                                                                                          1. | Builtin
                                                                                          2. | Reserved of string
                                                                                          3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                          4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                          5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                          6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                          7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                          8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                          9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                            (*

                                                                                            The type of reasons for constant typing

                                                                                            *)
                                                                                          type binding = [
                                                                                          1. | `Not_found
                                                                                          2. | `Reserved of string
                                                                                          3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                          4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                            Type definitions

                                                                                            type order =
                                                                                            1. | First_order
                                                                                              (*

                                                                                              First-oreder typechecking

                                                                                              *)
                                                                                            2. | Higher_order
                                                                                              (*

                                                                                              Higher-order typechecking

                                                                                              *)

                                                                                            Control whether the typechecker should type

                                                                                            type poly =
                                                                                            1. | Explicit
                                                                                              (*

                                                                                              Type arguments must be explicitly given in funciton applications

                                                                                              *)
                                                                                            2. | Implicit
                                                                                              (*

                                                                                              Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                              *)
                                                                                            3. | Flexible
                                                                                              (*

                                                                                              Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                              *)

                                                                                            The various polymorphism mode for the typechecker

                                                                                            type sym_inference_source = {
                                                                                            1. symbol : Dolmen.Std.Id.t;
                                                                                            2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                            3. mutable inferred_ty : Ty.t;
                                                                                            }
                                                                                            type var_inference_source = {
                                                                                            1. variable : Dolmen.Std.Id.t;
                                                                                            2. variable_loc : Dolmen.Std.Loc.t;
                                                                                            3. mutable inferred_ty : Ty.t;
                                                                                            }
                                                                                            type wildcard_source =
                                                                                            1. | Arg_of of wildcard_source
                                                                                            2. | Ret_of of wildcard_source
                                                                                            3. | From_source of Dolmen.Std.Term.t
                                                                                            4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                            5. | Symbol_inference of sym_inference_source
                                                                                            6. | Variable_inference of var_inference_source
                                                                                            type wildcard_shape =
                                                                                            1. | Forbidden
                                                                                            2. | Any_in_scope
                                                                                            3. | Any_base of {
                                                                                              1. allowed : Ty.t list;
                                                                                              2. preferred : Ty.t;
                                                                                              }
                                                                                            4. | Arrow of {
                                                                                              1. arg_shape : wildcard_shape;
                                                                                              2. ret_shape : wildcard_shape;
                                                                                              }
                                                                                            type infer_unbound_var_scheme =
                                                                                            1. | No_inference
                                                                                            2. | Unification_type_variable
                                                                                            type infer_term_scheme =
                                                                                            1. | No_inference
                                                                                            2. | Wildcard of wildcard_shape
                                                                                            type var_infer = {
                                                                                            1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                            2. infer_type_vars_in_binding_pos : bool;
                                                                                            3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                            4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                            }

                                                                                            Specification of how to infer variables.

                                                                                            type sym_infer = {
                                                                                            1. infer_type_csts : bool;
                                                                                            2. infer_term_csts : infer_term_scheme;
                                                                                            3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                            }

                                                                                            Specification of how to infer symbols.

                                                                                            type free_wildcards =
                                                                                            1. | Forbidden
                                                                                            2. | Implicitly_universally_quantified
                                                                                            type expect =
                                                                                            1. | Type
                                                                                            2. | Term
                                                                                            3. | Anything
                                                                                            type tag =
                                                                                            1. | Set : 'a Tag.t * 'a -> tag
                                                                                            2. | Add : 'a list Tag.t * 'a -> tag
                                                                                              (*

                                                                                              Existencial wrapper around tags

                                                                                              *)
                                                                                            type res =
                                                                                            1. | Ttype
                                                                                            2. | Ty of Ty.t
                                                                                            3. | Term of T.t
                                                                                            4. | Tags of tag list

                                                                                            The results of parsing an untyped term.

                                                                                            type reservation =
                                                                                            1. | Strict
                                                                                              (*

                                                                                              Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                              *)
                                                                                            2. | Model_completion
                                                                                              (*

                                                                                              Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                              *)

                                                                                            Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                            type reason =
                                                                                            1. | Builtin
                                                                                            2. | Reserved of reservation * string
                                                                                            3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                            4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                            5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                            6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                            7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                            8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                            9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                              (*

                                                                                              The type of reasons for constant typing

                                                                                              *)
                                                                                            type binding = [
                                                                                            1. | `Not_found
                                                                                            2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                            3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                            4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                            5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                            ]

                                                                                            The bindings that can occur.

                                                                                            type var_kind = [
                                                                                            1. | `Let_bound
                                                                                            2. | `Quantified
                                                                                            3. | `Function_param
                                                                                            4. | `Type_alias_param
                                                                                            ]

                                                                                            The type of kinds of variables

                                                                                            type nonrec symbol = Intf.symbol =
                                                                                            1. | Id of Dolmen.Std.Id.t
                                                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                                                            Errors and warnings

                                                                                            type _ warn = ..

                                                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                            type warn +=
                                                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              Unused quantified type variable

                                                                                              *)
                                                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              Unused quantified term variable

                                                                                              *)
                                                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              An error occurred wile parsing an attribute

                                                                                              *)
                                                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                            ]
                                                                                            type builtin_meta_ttype = unit

                                                                                            The bindings that can occur.

                                                                                            type builtin_meta_ty = unit
                                                                                            type builtin_meta_tags = unit

                                                                                            Some type aliases

                                                                                            type partial_semantics = [
                                                                                            1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                            ]
                                                                                            type term_semantics = [
                                                                                            1. | partial_semantics
                                                                                            2. | `Total
                                                                                            ]

                                                                                            Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                            type builtin_meta_term = term_semantics

                                                                                            Meta data for term builtins.

                                                                                            type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                            Small record to hold the results of builtin parsing by theories.

                                                                                            type builtin_res = [
                                                                                            1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                            2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                            3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                            4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                            5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                            6. | `Infer of binding * var_infer * sym_infer
                                                                                            ]

                                                                                            The result of parsing a symbol by the theory

                                                                                            type not_found = [
                                                                                            1. | `Not_found
                                                                                            ]

                                                                                            Not bound bindings

                                                                                            type var_kind = [
                                                                                            1. | `Let_bound
                                                                                            2. | `Quantified
                                                                                            3. | `Function_param
                                                                                            4. | `Type_alias_param
                                                                                            ]

                                                                                            The type of kinds of variables

                                                                                            type nonrec symbol = Intf.symbol =
                                                                                            1. | Id of Dolmen.Std.Id.t
                                                                                            2. | Builtin of Dolmen.Std.Term.builtin

                                                                                            Wrapper around potential function symbols from the Dolmen AST.

                                                                                            Errors and warnings

                                                                                            type _ warn = ..

                                                                                            The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                            type warn +=
                                                                                            1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              Unused quantified type variable

                                                                                              *)
                                                                                            2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              Unused quantified term variable

                                                                                              *)
                                                                                            3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              An error occurred wile parsing an attribute

                                                                                              *)
                                                                                            4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                              *)
                                                                                            5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                              (*

                                                                                              Redundant cases in pattern matching

                                                                                              *)

                                                                                            Warnings that cna trigger on regular parsed terms.

                                                                                            type warn +=
                                                                                            1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                              (*

                                                                                              Shadowing of the given identifier, together with the old and current binding.

                                                                                              *)

                                                                                            Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                            type _ err = ..

                                                                                            The type of errors, parameterized by the type of fragment they can trigger on

                                                                                            type err +=
                                                                                            1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                              (*

                                                                                              Not well-dounded datatypes definitions.

                                                                                              *)

                                                                                            Errors that occur on declaration(s)

                                                                                            type err +=
                                                                                            1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              The parsed term didn't match the expected shape

                                                                                              *)
                                                                                            2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                              *)
                                                                                            3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                              *)
                                                                                            4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                              *)
                                                                                            5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                              *)
                                                                                            6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                              *)
                                                                                            7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                              (*

                                                                                              Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Tff_intf/module-type-S/index.html b/dev/dolmen_type/Dolmen_type/Tff_intf/module-type-S/index.html index c4604587a..ba8e54889 100644 --- a/dev/dolmen_type/Dolmen_type/Tff_intf/module-type-S/index.html +++ b/dev/dolmen_type/Dolmen_type/Tff_intf/module-type-S/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                                              Type definitions

                                                                                              type order =
                                                                                              1. | First_order
                                                                                                (*

                                                                                                First-oreder typechecking

                                                                                                *)
                                                                                              2. | Higher_order
                                                                                                (*

                                                                                                Higher-order typechecking

                                                                                                *)

                                                                                              Control whether the typechecker should type

                                                                                              type poly =
                                                                                              1. | Explicit
                                                                                                (*

                                                                                                Type arguments must be explicitly given in funciton applications

                                                                                                *)
                                                                                              2. | Implicit
                                                                                                (*

                                                                                                Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                *)
                                                                                              3. | Flexible
                                                                                                (*

                                                                                                Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                *)

                                                                                              The various polymorphism mode for the typechecker

                                                                                              type sym_inference_source = {
                                                                                              1. symbol : Dolmen.Std.Id.t;
                                                                                              2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                              3. mutable inferred_ty : Ty.t;
                                                                                              }
                                                                                              type var_inference_source = {
                                                                                              1. variable : Dolmen.Std.Id.t;
                                                                                              2. variable_loc : Dolmen.Std.Loc.t;
                                                                                              3. mutable inferred_ty : Ty.t;
                                                                                              }
                                                                                              type wildcard_source =
                                                                                              1. | Arg_of of wildcard_source
                                                                                              2. | Ret_of of wildcard_source
                                                                                              3. | From_source of Dolmen.Std.Term.t
                                                                                              4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                              5. | Symbol_inference of sym_inference_source
                                                                                              6. | Variable_inference of var_inference_source
                                                                                              type wildcard_shape =
                                                                                              1. | Forbidden
                                                                                              2. | Any_in_scope
                                                                                              3. | Any_base of {
                                                                                                1. allowed : Ty.t list;
                                                                                                2. preferred : Ty.t;
                                                                                                }
                                                                                              4. | Arrow of {
                                                                                                1. arg_shape : wildcard_shape;
                                                                                                2. ret_shape : wildcard_shape;
                                                                                                }
                                                                                              type infer_unbound_var_scheme =
                                                                                              1. | No_inference
                                                                                              2. | Unification_type_variable
                                                                                              type infer_term_scheme =
                                                                                              1. | No_inference
                                                                                              2. | Wildcard of wildcard_shape
                                                                                              type var_infer = {
                                                                                              1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                              2. infer_type_vars_in_binding_pos : bool;
                                                                                              3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                              4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                              }

                                                                                              Specification of how to infer variables.

                                                                                              type sym_infer = {
                                                                                              1. infer_type_csts : bool;
                                                                                              2. infer_term_csts : infer_term_scheme;
                                                                                              3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                              }

                                                                                              Specification of how to infer symbols.

                                                                                              type free_wildcards =
                                                                                              1. | Forbidden
                                                                                              2. | Implicitly_universally_quantified
                                                                                              type expect =
                                                                                              1. | Type
                                                                                              2. | Term
                                                                                              3. | Anything
                                                                                              type tag =
                                                                                              1. | Set : 'a Tag.t * 'a -> tag
                                                                                              2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                (*

                                                                                                Existencial wrapper around tags

                                                                                                *)
                                                                                              type res =
                                                                                              1. | Ttype
                                                                                              2. | Ty of Ty.t
                                                                                              3. | Term of T.t
                                                                                              4. | Tags of tag list

                                                                                              The results of parsing an untyped term.

                                                                                              type builtin_meta_ttype = unit
                                                                                              type builtin_meta_ty = unit
                                                                                              type builtin_meta_tags = unit

                                                                                              Some type aliases

                                                                                              type term_semantics = [
                                                                                              1. | `Total
                                                                                              2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                              ]

                                                                                              Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                              type builtin_meta_term = term_semantics

                                                                                              Meta data for term builtins.

                                                                                              type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                              Small record to hold the results of builtin parsing by theories.

                                                                                              type builtin_res = [
                                                                                              1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                              2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                              3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                              4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                              5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                                              6. | `Infer of string * var_infer * sym_infer
                                                                                              ]

                                                                                              The result of parsing a symbol by the theory

                                                                                              type not_found = [
                                                                                              1. | `Not_found
                                                                                              ]

                                                                                              Not bound bindings

                                                                                              type reason =
                                                                                              1. | Builtin
                                                                                              2. | Reserved of string
                                                                                              3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                              4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                              5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                              6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                              7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                              8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                              9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                (*

                                                                                                The type of reasons for constant typing

                                                                                                *)
                                                                                              type binding = [
                                                                                              1. | `Not_found
                                                                                              2. | `Reserved of string
                                                                                              3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                              4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                                Type definitions

                                                                                                type order =
                                                                                                1. | First_order
                                                                                                  (*

                                                                                                  First-oreder typechecking

                                                                                                  *)
                                                                                                2. | Higher_order
                                                                                                  (*

                                                                                                  Higher-order typechecking

                                                                                                  *)

                                                                                                Control whether the typechecker should type

                                                                                                type poly =
                                                                                                1. | Explicit
                                                                                                  (*

                                                                                                  Type arguments must be explicitly given in funciton applications

                                                                                                  *)
                                                                                                2. | Implicit
                                                                                                  (*

                                                                                                  Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                  *)
                                                                                                3. | Flexible
                                                                                                  (*

                                                                                                  Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                  *)

                                                                                                The various polymorphism mode for the typechecker

                                                                                                type sym_inference_source = {
                                                                                                1. symbol : Dolmen.Std.Id.t;
                                                                                                2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                                3. mutable inferred_ty : Ty.t;
                                                                                                }
                                                                                                type var_inference_source = {
                                                                                                1. variable : Dolmen.Std.Id.t;
                                                                                                2. variable_loc : Dolmen.Std.Loc.t;
                                                                                                3. mutable inferred_ty : Ty.t;
                                                                                                }
                                                                                                type wildcard_source =
                                                                                                1. | Arg_of of wildcard_source
                                                                                                2. | Ret_of of wildcard_source
                                                                                                3. | From_source of Dolmen.Std.Term.t
                                                                                                4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                                5. | Symbol_inference of sym_inference_source
                                                                                                6. | Variable_inference of var_inference_source
                                                                                                type wildcard_shape =
                                                                                                1. | Forbidden
                                                                                                2. | Any_in_scope
                                                                                                3. | Any_base of {
                                                                                                  1. allowed : Ty.t list;
                                                                                                  2. preferred : Ty.t;
                                                                                                  }
                                                                                                4. | Arrow of {
                                                                                                  1. arg_shape : wildcard_shape;
                                                                                                  2. ret_shape : wildcard_shape;
                                                                                                  }
                                                                                                type infer_unbound_var_scheme =
                                                                                                1. | No_inference
                                                                                                2. | Unification_type_variable
                                                                                                type infer_term_scheme =
                                                                                                1. | No_inference
                                                                                                2. | Wildcard of wildcard_shape
                                                                                                type var_infer = {
                                                                                                1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                                2. infer_type_vars_in_binding_pos : bool;
                                                                                                3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                                4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                                }

                                                                                                Specification of how to infer variables.

                                                                                                type sym_infer = {
                                                                                                1. infer_type_csts : bool;
                                                                                                2. infer_term_csts : infer_term_scheme;
                                                                                                3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                                }

                                                                                                Specification of how to infer symbols.

                                                                                                type free_wildcards =
                                                                                                1. | Forbidden
                                                                                                2. | Implicitly_universally_quantified
                                                                                                type expect =
                                                                                                1. | Type
                                                                                                2. | Term
                                                                                                3. | Anything
                                                                                                type tag =
                                                                                                1. | Set : 'a Tag.t * 'a -> tag
                                                                                                2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                  (*

                                                                                                  Existencial wrapper around tags

                                                                                                  *)
                                                                                                type res =
                                                                                                1. | Ttype
                                                                                                2. | Ty of Ty.t
                                                                                                3. | Term of T.t
                                                                                                4. | Tags of tag list

                                                                                                The results of parsing an untyped term.

                                                                                                type reservation =
                                                                                                1. | Strict
                                                                                                  (*

                                                                                                  Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                                  *)
                                                                                                2. | Model_completion
                                                                                                  (*

                                                                                                  Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                                  *)

                                                                                                Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                                type reason =
                                                                                                1. | Builtin
                                                                                                2. | Reserved of reservation * string
                                                                                                3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                  (*

                                                                                                  The type of reasons for constant typing

                                                                                                  *)
                                                                                                type binding = [
                                                                                                1. | `Not_found
                                                                                                2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                                3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                                4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                                5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                                ]

                                                                                                The bindings that can occur.

                                                                                                type var_kind = [
                                                                                                1. | `Let_bound
                                                                                                2. | `Quantified
                                                                                                3. | `Function_param
                                                                                                4. | `Type_alias_param
                                                                                                ]

                                                                                                The type of kinds of variables

                                                                                                type nonrec symbol = Intf.symbol =
                                                                                                1. | Id of Dolmen.Std.Id.t
                                                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                                                Errors and warnings

                                                                                                type _ warn = ..

                                                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                type warn +=
                                                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  Unused quantified type variable

                                                                                                  *)
                                                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  Unused quantified term variable

                                                                                                  *)
                                                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  An error occurred wile parsing an attribute

                                                                                                  *)
                                                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                                ]
                                                                                                type builtin_meta_ttype = unit

                                                                                                The bindings that can occur.

                                                                                                type builtin_meta_ty = unit
                                                                                                type builtin_meta_tags = unit

                                                                                                Some type aliases

                                                                                                type partial_semantics = [
                                                                                                1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                                ]
                                                                                                type term_semantics = [
                                                                                                1. | partial_semantics
                                                                                                2. | `Total
                                                                                                ]

                                                                                                Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                                type builtin_meta_term = term_semantics

                                                                                                Meta data for term builtins.

                                                                                                type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                                Small record to hold the results of builtin parsing by theories.

                                                                                                type builtin_res = [
                                                                                                1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                                2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                                3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                                4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                                5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                                6. | `Infer of binding * var_infer * sym_infer
                                                                                                ]

                                                                                                The result of parsing a symbol by the theory

                                                                                                type not_found = [
                                                                                                1. | `Not_found
                                                                                                ]

                                                                                                Not bound bindings

                                                                                                type var_kind = [
                                                                                                1. | `Let_bound
                                                                                                2. | `Quantified
                                                                                                3. | `Function_param
                                                                                                4. | `Type_alias_param
                                                                                                ]

                                                                                                The type of kinds of variables

                                                                                                type nonrec symbol = Intf.symbol =
                                                                                                1. | Id of Dolmen.Std.Id.t
                                                                                                2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                Wrapper around potential function symbols from the Dolmen AST.

                                                                                                Errors and warnings

                                                                                                type _ warn = ..

                                                                                                The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                type warn +=
                                                                                                1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  Unused quantified type variable

                                                                                                  *)
                                                                                                2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  Unused quantified term variable

                                                                                                  *)
                                                                                                3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  An error occurred wile parsing an attribute

                                                                                                  *)
                                                                                                4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                                  *)
                                                                                                5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                                  (*

                                                                                                  Redundant cases in pattern matching

                                                                                                  *)

                                                                                                Warnings that cna trigger on regular parsed terms.

                                                                                                type warn +=
                                                                                                1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                                  (*

                                                                                                  Shadowing of the given identifier, together with the old and current binding.

                                                                                                  *)

                                                                                                Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                                type _ err = ..

                                                                                                The type of errors, parameterized by the type of fragment they can trigger on

                                                                                                type err +=
                                                                                                1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                                  (*

                                                                                                  Not well-dounded datatypes definitions.

                                                                                                  *)

                                                                                                Errors that occur on declaration(s)

                                                                                                type err +=
                                                                                                1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  The parsed term didn't match the expected shape

                                                                                                  *)
                                                                                                2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                                  *)
                                                                                                3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                                  *)
                                                                                                4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                                  *)
                                                                                                5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                  *)
                                                                                                6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                  *)
                                                                                                7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                                  (*

                                                                                                  Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Thf/Make/index.html b/dev/dolmen_type/Dolmen_type/Thf/Make/index.html index 9627c68b7..075c16048 100644 --- a/dev/dolmen_type/Dolmen_type/Thf/Make/index.html +++ b/dev/dolmen_type/Dolmen_type/Thf/Make/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                                                  Type definitions

                                                                                                  type order =
                                                                                                  1. | First_order
                                                                                                    (*

                                                                                                    First-oreder typechecking

                                                                                                    *)
                                                                                                  2. | Higher_order
                                                                                                    (*

                                                                                                    Higher-order typechecking

                                                                                                    *)

                                                                                                  Control whether the typechecker should type

                                                                                                  type poly =
                                                                                                  1. | Explicit
                                                                                                    (*

                                                                                                    Type arguments must be explicitly given in funciton applications

                                                                                                    *)
                                                                                                  2. | Implicit
                                                                                                    (*

                                                                                                    Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                    *)
                                                                                                  3. | Flexible
                                                                                                    (*

                                                                                                    Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                    *)

                                                                                                  The various polymorphism mode for the typechecker

                                                                                                  type sym_inference_source = {
                                                                                                  1. symbol : Dolmen.Std.Id.t;
                                                                                                  2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                                  3. mutable inferred_ty : Ty.t;
                                                                                                  }
                                                                                                  type var_inference_source = {
                                                                                                  1. variable : Dolmen.Std.Id.t;
                                                                                                  2. variable_loc : Dolmen.Std.Loc.t;
                                                                                                  3. mutable inferred_ty : Ty.t;
                                                                                                  }
                                                                                                  type wildcard_source =
                                                                                                  1. | Arg_of of wildcard_source
                                                                                                  2. | Ret_of of wildcard_source
                                                                                                  3. | From_source of Dolmen.Std.Term.t
                                                                                                  4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                                  5. | Symbol_inference of sym_inference_source
                                                                                                  6. | Variable_inference of var_inference_source
                                                                                                  type wildcard_shape =
                                                                                                  1. | Forbidden
                                                                                                  2. | Any_in_scope
                                                                                                  3. | Any_base of {
                                                                                                    1. allowed : Ty.t list;
                                                                                                    2. preferred : Ty.t;
                                                                                                    }
                                                                                                  4. | Arrow of {
                                                                                                    1. arg_shape : wildcard_shape;
                                                                                                    2. ret_shape : wildcard_shape;
                                                                                                    }
                                                                                                  type infer_unbound_var_scheme =
                                                                                                  1. | No_inference
                                                                                                  2. | Unification_type_variable
                                                                                                  type infer_term_scheme =
                                                                                                  1. | No_inference
                                                                                                  2. | Wildcard of wildcard_shape
                                                                                                  type var_infer = {
                                                                                                  1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                                  2. infer_type_vars_in_binding_pos : bool;
                                                                                                  3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                                  4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                                  }

                                                                                                  Specification of how to infer variables.

                                                                                                  type sym_infer = {
                                                                                                  1. infer_type_csts : bool;
                                                                                                  2. infer_term_csts : infer_term_scheme;
                                                                                                  3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                                  }

                                                                                                  Specification of how to infer symbols.

                                                                                                  type free_wildcards =
                                                                                                  1. | Forbidden
                                                                                                  2. | Implicitly_universally_quantified
                                                                                                  type expect =
                                                                                                  1. | Type
                                                                                                  2. | Term
                                                                                                  3. | Anything
                                                                                                  type tag =
                                                                                                  1. | Set : 'a Tag.t * 'a -> tag
                                                                                                  2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                    (*

                                                                                                    Existencial wrapper around tags

                                                                                                    *)
                                                                                                  type res =
                                                                                                  1. | Ttype
                                                                                                  2. | Ty of Ty.t
                                                                                                  3. | Term of T.t
                                                                                                  4. | Tags of tag list

                                                                                                  The results of parsing an untyped term.

                                                                                                  type builtin_meta_ttype = unit
                                                                                                  type builtin_meta_ty = unit
                                                                                                  type builtin_meta_tags = unit

                                                                                                  Some type aliases

                                                                                                  type term_semantics = [
                                                                                                  1. | `Total
                                                                                                  2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                                  ]

                                                                                                  Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                                  type builtin_meta_term = term_semantics

                                                                                                  Meta data for term builtins.

                                                                                                  type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                                  Small record to hold the results of builtin parsing by theories.

                                                                                                  type builtin_res = [
                                                                                                  1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                                  2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                                  3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                                  4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                                  5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                                                  6. | `Infer of string * var_infer * sym_infer
                                                                                                  ]

                                                                                                  The result of parsing a symbol by the theory

                                                                                                  type not_found = [
                                                                                                  1. | `Not_found
                                                                                                  ]

                                                                                                  Not bound bindings

                                                                                                  type reason =
                                                                                                  1. | Builtin
                                                                                                  2. | Reserved of string
                                                                                                  3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                  4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                  5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                  6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                  7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                  8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                  9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                    (*

                                                                                                    The type of reasons for constant typing

                                                                                                    *)
                                                                                                  type binding = [
                                                                                                  1. | `Not_found
                                                                                                  2. | `Reserved of string
                                                                                                  3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                                  4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                                    Type definitions

                                                                                                    type order =
                                                                                                    1. | First_order
                                                                                                      (*

                                                                                                      First-oreder typechecking

                                                                                                      *)
                                                                                                    2. | Higher_order
                                                                                                      (*

                                                                                                      Higher-order typechecking

                                                                                                      *)

                                                                                                    Control whether the typechecker should type

                                                                                                    type poly =
                                                                                                    1. | Explicit
                                                                                                      (*

                                                                                                      Type arguments must be explicitly given in funciton applications

                                                                                                      *)
                                                                                                    2. | Implicit
                                                                                                      (*

                                                                                                      Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                      *)
                                                                                                    3. | Flexible
                                                                                                      (*

                                                                                                      Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                      *)

                                                                                                    The various polymorphism mode for the typechecker

                                                                                                    type sym_inference_source = {
                                                                                                    1. symbol : Dolmen.Std.Id.t;
                                                                                                    2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                                    3. mutable inferred_ty : Ty.t;
                                                                                                    }
                                                                                                    type var_inference_source = {
                                                                                                    1. variable : Dolmen.Std.Id.t;
                                                                                                    2. variable_loc : Dolmen.Std.Loc.t;
                                                                                                    3. mutable inferred_ty : Ty.t;
                                                                                                    }
                                                                                                    type wildcard_source =
                                                                                                    1. | Arg_of of wildcard_source
                                                                                                    2. | Ret_of of wildcard_source
                                                                                                    3. | From_source of Dolmen.Std.Term.t
                                                                                                    4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                                    5. | Symbol_inference of sym_inference_source
                                                                                                    6. | Variable_inference of var_inference_source
                                                                                                    type wildcard_shape =
                                                                                                    1. | Forbidden
                                                                                                    2. | Any_in_scope
                                                                                                    3. | Any_base of {
                                                                                                      1. allowed : Ty.t list;
                                                                                                      2. preferred : Ty.t;
                                                                                                      }
                                                                                                    4. | Arrow of {
                                                                                                      1. arg_shape : wildcard_shape;
                                                                                                      2. ret_shape : wildcard_shape;
                                                                                                      }
                                                                                                    type infer_unbound_var_scheme =
                                                                                                    1. | No_inference
                                                                                                    2. | Unification_type_variable
                                                                                                    type infer_term_scheme =
                                                                                                    1. | No_inference
                                                                                                    2. | Wildcard of wildcard_shape
                                                                                                    type var_infer = {
                                                                                                    1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                                    2. infer_type_vars_in_binding_pos : bool;
                                                                                                    3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                                    4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                                    }

                                                                                                    Specification of how to infer variables.

                                                                                                    type sym_infer = {
                                                                                                    1. infer_type_csts : bool;
                                                                                                    2. infer_term_csts : infer_term_scheme;
                                                                                                    3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                                    }

                                                                                                    Specification of how to infer symbols.

                                                                                                    type free_wildcards =
                                                                                                    1. | Forbidden
                                                                                                    2. | Implicitly_universally_quantified
                                                                                                    type expect =
                                                                                                    1. | Type
                                                                                                    2. | Term
                                                                                                    3. | Anything
                                                                                                    type tag =
                                                                                                    1. | Set : 'a Tag.t * 'a -> tag
                                                                                                    2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                      (*

                                                                                                      Existencial wrapper around tags

                                                                                                      *)
                                                                                                    type res =
                                                                                                    1. | Ttype
                                                                                                    2. | Ty of Ty.t
                                                                                                    3. | Term of T.t
                                                                                                    4. | Tags of tag list

                                                                                                    The results of parsing an untyped term.

                                                                                                    type reservation =
                                                                                                    1. | Strict
                                                                                                      (*

                                                                                                      Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                                      *)
                                                                                                    2. | Model_completion
                                                                                                      (*

                                                                                                      Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                                      *)

                                                                                                    Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                                    type reason =
                                                                                                    1. | Builtin
                                                                                                    2. | Reserved of reservation * string
                                                                                                    3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                    4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                    5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                    6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                    7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                    8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                    9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                      (*

                                                                                                      The type of reasons for constant typing

                                                                                                      *)
                                                                                                    type binding = [
                                                                                                    1. | `Not_found
                                                                                                    2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                                    3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                                    4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                                    5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                                    ]

                                                                                                    The bindings that can occur.

                                                                                                    type var_kind = [
                                                                                                    1. | `Let_bound
                                                                                                    2. | `Quantified
                                                                                                    3. | `Function_param
                                                                                                    4. | `Type_alias_param
                                                                                                    ]

                                                                                                    The type of kinds of variables

                                                                                                    type nonrec symbol = Intf.symbol =
                                                                                                    1. | Id of Dolmen.Std.Id.t
                                                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                                                    Errors and warnings

                                                                                                    type _ warn = ..

                                                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                    type warn +=
                                                                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      Unused quantified type variable

                                                                                                      *)
                                                                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      Unused quantified term variable

                                                                                                      *)
                                                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      An error occurred wile parsing an attribute

                                                                                                      *)
                                                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                                    ]
                                                                                                    type builtin_meta_ttype = unit

                                                                                                    The bindings that can occur.

                                                                                                    type builtin_meta_ty = unit
                                                                                                    type builtin_meta_tags = unit

                                                                                                    Some type aliases

                                                                                                    type partial_semantics = [
                                                                                                    1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                                    ]
                                                                                                    type term_semantics = [
                                                                                                    1. | partial_semantics
                                                                                                    2. | `Total
                                                                                                    ]

                                                                                                    Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                                    type builtin_meta_term = term_semantics

                                                                                                    Meta data for term builtins.

                                                                                                    type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                                    Small record to hold the results of builtin parsing by theories.

                                                                                                    type builtin_res = [
                                                                                                    1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                                    2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                                    3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                                    4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                                    5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                                    6. | `Infer of binding * var_infer * sym_infer
                                                                                                    ]

                                                                                                    The result of parsing a symbol by the theory

                                                                                                    type not_found = [
                                                                                                    1. | `Not_found
                                                                                                    ]

                                                                                                    Not bound bindings

                                                                                                    type var_kind = [
                                                                                                    1. | `Let_bound
                                                                                                    2. | `Quantified
                                                                                                    3. | `Function_param
                                                                                                    4. | `Type_alias_param
                                                                                                    ]

                                                                                                    The type of kinds of variables

                                                                                                    type nonrec symbol = Intf.symbol =
                                                                                                    1. | Id of Dolmen.Std.Id.t
                                                                                                    2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                    Wrapper around potential function symbols from the Dolmen AST.

                                                                                                    Errors and warnings

                                                                                                    type _ warn = ..

                                                                                                    The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                    type warn +=
                                                                                                    1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      Unused quantified type variable

                                                                                                      *)
                                                                                                    2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      Unused quantified term variable

                                                                                                      *)
                                                                                                    3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      An error occurred wile parsing an attribute

                                                                                                      *)
                                                                                                    4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                                      *)
                                                                                                    5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                                      (*

                                                                                                      Redundant cases in pattern matching

                                                                                                      *)

                                                                                                    Warnings that cna trigger on regular parsed terms.

                                                                                                    type warn +=
                                                                                                    1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                                      (*

                                                                                                      Shadowing of the given identifier, together with the old and current binding.

                                                                                                      *)

                                                                                                    Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                                    type _ err = ..

                                                                                                    The type of errors, parameterized by the type of fragment they can trigger on

                                                                                                    type err +=
                                                                                                    1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                                      (*

                                                                                                      Not well-dounded datatypes definitions.

                                                                                                      *)

                                                                                                    Errors that occur on declaration(s)

                                                                                                    type err +=
                                                                                                    1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      The parsed term didn't match the expected shape

                                                                                                      *)
                                                                                                    2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                                      *)
                                                                                                    3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                                      *)
                                                                                                    4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                                      *)
                                                                                                    5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                      *)
                                                                                                    6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                      *)
                                                                                                    7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                                      (*

                                                                                                      Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term diff --git a/dev/dolmen_type/Dolmen_type/Thf_intf/module-type-S/index.html b/dev/dolmen_type/Dolmen_type/Thf_intf/module-type-S/index.html index fea8f54df..cff03b269 100644 --- a/dev/dolmen_type/Dolmen_type/Thf_intf/module-type-S/index.html +++ b/dev/dolmen_type/Dolmen_type/Thf_intf/module-type-S/index.html @@ -19,17 +19,14 @@ and type term_cst := T.Const.t and type term_cstr := T.Cstr.t and type term_field := T.Field.t - and type 'a ast_tag := 'a Tag.t

                                                                                                      Type definitions

                                                                                                      type order =
                                                                                                      1. | First_order
                                                                                                        (*

                                                                                                        First-oreder typechecking

                                                                                                        *)
                                                                                                      2. | Higher_order
                                                                                                        (*

                                                                                                        Higher-order typechecking

                                                                                                        *)

                                                                                                      Control whether the typechecker should type

                                                                                                      type poly =
                                                                                                      1. | Explicit
                                                                                                        (*

                                                                                                        Type arguments must be explicitly given in funciton applications

                                                                                                        *)
                                                                                                      2. | Implicit
                                                                                                        (*

                                                                                                        Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                        *)
                                                                                                      3. | Flexible
                                                                                                        (*

                                                                                                        Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                        *)

                                                                                                      The various polymorphism mode for the typechecker

                                                                                                      type sym_inference_source = {
                                                                                                      1. symbol : Dolmen.Std.Id.t;
                                                                                                      2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                                      3. mutable inferred_ty : Ty.t;
                                                                                                      }
                                                                                                      type var_inference_source = {
                                                                                                      1. variable : Dolmen.Std.Id.t;
                                                                                                      2. variable_loc : Dolmen.Std.Loc.t;
                                                                                                      3. mutable inferred_ty : Ty.t;
                                                                                                      }
                                                                                                      type wildcard_source =
                                                                                                      1. | Arg_of of wildcard_source
                                                                                                      2. | Ret_of of wildcard_source
                                                                                                      3. | From_source of Dolmen.Std.Term.t
                                                                                                      4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                                      5. | Symbol_inference of sym_inference_source
                                                                                                      6. | Variable_inference of var_inference_source
                                                                                                      type wildcard_shape =
                                                                                                      1. | Forbidden
                                                                                                      2. | Any_in_scope
                                                                                                      3. | Any_base of {
                                                                                                        1. allowed : Ty.t list;
                                                                                                        2. preferred : Ty.t;
                                                                                                        }
                                                                                                      4. | Arrow of {
                                                                                                        1. arg_shape : wildcard_shape;
                                                                                                        2. ret_shape : wildcard_shape;
                                                                                                        }
                                                                                                      type infer_unbound_var_scheme =
                                                                                                      1. | No_inference
                                                                                                      2. | Unification_type_variable
                                                                                                      type infer_term_scheme =
                                                                                                      1. | No_inference
                                                                                                      2. | Wildcard of wildcard_shape
                                                                                                      type var_infer = {
                                                                                                      1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                                      2. infer_type_vars_in_binding_pos : bool;
                                                                                                      3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                                      4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                                      }

                                                                                                      Specification of how to infer variables.

                                                                                                      type sym_infer = {
                                                                                                      1. infer_type_csts : bool;
                                                                                                      2. infer_term_csts : infer_term_scheme;
                                                                                                      3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                                      }

                                                                                                      Specification of how to infer symbols.

                                                                                                      type free_wildcards =
                                                                                                      1. | Forbidden
                                                                                                      2. | Implicitly_universally_quantified
                                                                                                      type expect =
                                                                                                      1. | Type
                                                                                                      2. | Term
                                                                                                      3. | Anything
                                                                                                      type tag =
                                                                                                      1. | Set : 'a Tag.t * 'a -> tag
                                                                                                      2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                        (*

                                                                                                        Existencial wrapper around tags

                                                                                                        *)
                                                                                                      type res =
                                                                                                      1. | Ttype
                                                                                                      2. | Ty of Ty.t
                                                                                                      3. | Term of T.t
                                                                                                      4. | Tags of tag list

                                                                                                      The results of parsing an untyped term.

                                                                                                      type builtin_meta_ttype = unit
                                                                                                      type builtin_meta_ty = unit
                                                                                                      type builtin_meta_tags = unit

                                                                                                      Some type aliases

                                                                                                      type term_semantics = [
                                                                                                      1. | `Total
                                                                                                      2. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                                      ]

                                                                                                      Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                                      type builtin_meta_term = term_semantics

                                                                                                      Meta data for term builtins.

                                                                                                      type ('res, 'meta) builtin_common_res = - 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                                      Small record to hold the results of builtin parsing by theories.

                                                                                                      type builtin_res = [
                                                                                                      1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                                      2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                                      3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                                      4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                                      5. | `Reserved of - string - * [ `Solver - | `Term_cst of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t ]
                                                                                                      6. | `Infer of string * var_infer * sym_infer
                                                                                                      ]

                                                                                                      The result of parsing a symbol by the theory

                                                                                                      type not_found = [
                                                                                                      1. | `Not_found
                                                                                                      ]

                                                                                                      Not bound bindings

                                                                                                      type reason =
                                                                                                      1. | Builtin
                                                                                                      2. | Reserved of string
                                                                                                      3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                      4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                      5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                      6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                      7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                      8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                      9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                        (*

                                                                                                        The type of reasons for constant typing

                                                                                                        *)
                                                                                                      type binding = [
                                                                                                      1. | `Not_found
                                                                                                      2. | `Reserved of string
                                                                                                      3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                                      4. | `Variable of + and type 'a ast_tag := 'a Tag.t

                                                                                                        Type definitions

                                                                                                        type order =
                                                                                                        1. | First_order
                                                                                                          (*

                                                                                                          First-oreder typechecking

                                                                                                          *)
                                                                                                        2. | Higher_order
                                                                                                          (*

                                                                                                          Higher-order typechecking

                                                                                                          *)

                                                                                                        Control whether the typechecker should type

                                                                                                        type poly =
                                                                                                        1. | Explicit
                                                                                                          (*

                                                                                                          Type arguments must be explicitly given in funciton applications

                                                                                                          *)
                                                                                                        2. | Implicit
                                                                                                          (*

                                                                                                          Type arguments are not given in funciton applications, and instead type annotations/coercions are used to disambiguate applications of polymorphic symbols.

                                                                                                          *)
                                                                                                        3. | Flexible
                                                                                                          (*

                                                                                                          Mix between explicit and implicit: depending on the arity of a symbol and the number of arguments provided, either the provided type arguments are used, or wildcards are generated for all of them, and later instantiated when needed.

                                                                                                          *)

                                                                                                        The various polymorphism mode for the typechecker

                                                                                                        type sym_inference_source = {
                                                                                                        1. symbol : Dolmen.Std.Id.t;
                                                                                                        2. symbol_loc : Dolmen.Std.Loc.t;
                                                                                                        3. mutable inferred_ty : Ty.t;
                                                                                                        }
                                                                                                        type var_inference_source = {
                                                                                                        1. variable : Dolmen.Std.Id.t;
                                                                                                        2. variable_loc : Dolmen.Std.Loc.t;
                                                                                                        3. mutable inferred_ty : Ty.t;
                                                                                                        }
                                                                                                        type wildcard_source =
                                                                                                        1. | Arg_of of wildcard_source
                                                                                                        2. | Ret_of of wildcard_source
                                                                                                        3. | From_source of Dolmen.Std.Term.t
                                                                                                        4. | Added_type_argument of Dolmen.Std.Term.t
                                                                                                        5. | Symbol_inference of sym_inference_source
                                                                                                        6. | Variable_inference of var_inference_source
                                                                                                        type wildcard_shape =
                                                                                                        1. | Forbidden
                                                                                                        2. | Any_in_scope
                                                                                                        3. | Any_base of {
                                                                                                          1. allowed : Ty.t list;
                                                                                                          2. preferred : Ty.t;
                                                                                                          }
                                                                                                        4. | Arrow of {
                                                                                                          1. arg_shape : wildcard_shape;
                                                                                                          2. ret_shape : wildcard_shape;
                                                                                                          }
                                                                                                        type infer_unbound_var_scheme =
                                                                                                        1. | No_inference
                                                                                                        2. | Unification_type_variable
                                                                                                        type infer_term_scheme =
                                                                                                        1. | No_inference
                                                                                                        2. | Wildcard of wildcard_shape
                                                                                                        type var_infer = {
                                                                                                        1. infer_unbound_vars : infer_unbound_var_scheme;
                                                                                                        2. infer_type_vars_in_binding_pos : bool;
                                                                                                        3. infer_term_vars_in_binding_pos : infer_term_scheme;
                                                                                                        4. var_hook : [ `Ty_var of Ty.Var.t | `Term_var of T.Var.t ] -> unit;
                                                                                                        }

                                                                                                        Specification of how to infer variables.

                                                                                                        type sym_infer = {
                                                                                                        1. infer_type_csts : bool;
                                                                                                        2. infer_term_csts : infer_term_scheme;
                                                                                                        3. sym_hook : [ `Ty_cst of Ty.Const.t | `Term_cst of T.Const.t ] -> unit;
                                                                                                        }

                                                                                                        Specification of how to infer symbols.

                                                                                                        type free_wildcards =
                                                                                                        1. | Forbidden
                                                                                                        2. | Implicitly_universally_quantified
                                                                                                        type expect =
                                                                                                        1. | Type
                                                                                                        2. | Term
                                                                                                        3. | Anything
                                                                                                        type tag =
                                                                                                        1. | Set : 'a Tag.t * 'a -> tag
                                                                                                        2. | Add : 'a list Tag.t * 'a -> tag
                                                                                                          (*

                                                                                                          Existencial wrapper around tags

                                                                                                          *)
                                                                                                        type res =
                                                                                                        1. | Ttype
                                                                                                        2. | Ty of Ty.t
                                                                                                        3. | Term of T.t
                                                                                                        4. | Tags of tag list

                                                                                                        The results of parsing an untyped term.

                                                                                                        type reservation =
                                                                                                        1. | Strict
                                                                                                          (*

                                                                                                          Strict reservation: the language dictates that the corresponding id is reserved for another use, and therefore cannot appear in its position.

                                                                                                          *)
                                                                                                        2. | Model_completion
                                                                                                          (*

                                                                                                          Soft reservation: the id is not technically reserved by the language, but it happens that it is used in models to complete the interpretation of a partial symbol (for isntance division by zero).

                                                                                                          *)

                                                                                                        Types of reservation of symbols: some symbols/id are reserved for some uses, and therefore cannot/should not occur at some positions. This type tries and explain the reason for such restrictions.

                                                                                                        type reason =
                                                                                                        1. | Builtin
                                                                                                        2. | Reserved of reservation * string
                                                                                                        3. | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                        4. | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                        5. | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                        6. | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                        7. | Implicit_in_def of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
                                                                                                        8. | Implicit_in_decl of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
                                                                                                        9. | Implicit_in_term of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
                                                                                                          (*

                                                                                                          The type of reasons for constant typing

                                                                                                          *)
                                                                                                        type binding = [
                                                                                                        1. | `Not_found
                                                                                                        2. | `Reserved of [ `Model of string | `Solver of string ]
                                                                                                        3. | `Builtin of [ `Ttype | `Ty | `Term | `Tag ]
                                                                                                        4. | `Variable of [ `Ty of Ty.Var.t * reason option | `Term of T.Var.t * reason option ]
                                                                                                        5. | `Constant of [ `Ty of Ty.Const.t * reason option | `Cstr of T.Cstr.t * reason option | `Dstr of T.Const.t * reason option | `Term of T.Const.t * reason option - | `Field of T.Field.t * reason option ]
                                                                                                        ]

                                                                                                        The bindings that can occur.

                                                                                                        type var_kind = [
                                                                                                        1. | `Let_bound
                                                                                                        2. | `Quantified
                                                                                                        3. | `Function_param
                                                                                                        4. | `Type_alias_param
                                                                                                        ]

                                                                                                        The type of kinds of variables

                                                                                                        type nonrec symbol = Intf.symbol =
                                                                                                        1. | Id of Dolmen.Std.Id.t
                                                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                                                        Errors and warnings

                                                                                                        type _ warn = ..

                                                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                        type warn +=
                                                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          Unused quantified type variable

                                                                                                          *)
                                                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          Unused quantified term variable

                                                                                                          *)
                                                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          An error occurred wile parsing an attribute

                                                                                                          *)
                                                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t + | `Field of T.Field.t * reason option ]
                                                                                                        ]
                                                                                                        type builtin_meta_ttype = unit

                                                                                                        The bindings that can occur.

                                                                                                        type builtin_meta_ty = unit
                                                                                                        type builtin_meta_tags = unit

                                                                                                        Some type aliases

                                                                                                        type partial_semantics = [
                                                                                                        1. | `Partial of Ty.Var.t list -> T.Var.t list -> Ty.t -> T.Const.t
                                                                                                        ]
                                                                                                        type term_semantics = [
                                                                                                        1. | partial_semantics
                                                                                                        2. | `Total
                                                                                                        ]

                                                                                                        Semantics of term constants. Some term constants have only partially defined semantics (for instance division by zero), and these constants can have their semantics/interpretation extended/completed by later definitions.

                                                                                                        type builtin_meta_term = term_semantics

                                                                                                        Meta data for term builtins.

                                                                                                        type ('res, 'meta) builtin_common_res = + 'meta * (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'res)

                                                                                                        Small record to hold the results of builtin parsing by theories.

                                                                                                        type builtin_res = [
                                                                                                        1. | `Ttype of (unit, builtin_meta_ttype) builtin_common_res
                                                                                                        2. | `Ty of (Ty.t, builtin_meta_ty) builtin_common_res
                                                                                                        3. | `Term of (T.t, builtin_meta_term) builtin_common_res
                                                                                                        4. | `Tags of (tag list, builtin_meta_tags) builtin_common_res
                                                                                                        5. | `Reserved of [ `Solver of string | `Model of string * partial_semantics ]
                                                                                                        6. | `Infer of binding * var_infer * sym_infer
                                                                                                        ]

                                                                                                        The result of parsing a symbol by the theory

                                                                                                        type not_found = [
                                                                                                        1. | `Not_found
                                                                                                        ]

                                                                                                        Not bound bindings

                                                                                                        type var_kind = [
                                                                                                        1. | `Let_bound
                                                                                                        2. | `Quantified
                                                                                                        3. | `Function_param
                                                                                                        4. | `Type_alias_param
                                                                                                        ]

                                                                                                        The type of kinds of variables

                                                                                                        type nonrec symbol = Intf.symbol =
                                                                                                        1. | Id of Dolmen.Std.Id.t
                                                                                                        2. | Builtin of Dolmen.Std.Term.builtin

                                                                                                        Wrapper around potential function symbols from the Dolmen AST.

                                                                                                        Errors and warnings

                                                                                                        type _ warn = ..

                                                                                                        The type of warnings, parameterized by the type of fragment they can trigger on

                                                                                                        type warn +=
                                                                                                        1. | Unused_type_variable : var_kind * Ty.Var.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          Unused quantified type variable

                                                                                                          *)
                                                                                                        2. | Unused_term_variable : var_kind * T.Var.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          Unused quantified term variable

                                                                                                          *)
                                                                                                        3. | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          An error occurred wile parsing an attribute

                                                                                                          *)
                                                                                                        4. | Superfluous_destructor : Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          The user implementation of typed terms returned a destructor where was asked for. This warning can very safely be ignored.

                                                                                                          *)
                                                                                                        5. | Redundant_pattern : T.t -> Dolmen.Std.Term.t warn
                                                                                                          (*

                                                                                                          Redundant cases in pattern matching

                                                                                                          *)

                                                                                                        Warnings that cna trigger on regular parsed terms.

                                                                                                        type warn +=
                                                                                                        1. | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
                                                                                                          (*

                                                                                                          Shadowing of the given identifier, together with the old and current binding.

                                                                                                          *)

                                                                                                        Special case of warnings for shadowing, as it can happen both from a term but also a declaration, hence why the type variable of warn is left wild.

                                                                                                        type _ err = ..

                                                                                                        The type of errors, parameterized by the type of fragment they can trigger on

                                                                                                        type err +=
                                                                                                        1. | Not_well_founded_datatypes : Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
                                                                                                          (*

                                                                                                          Not well-dounded datatypes definitions.

                                                                                                          *)

                                                                                                        Errors that occur on declaration(s)

                                                                                                        type err +=
                                                                                                        1. | Expected : string * res option -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          The parsed term didn't match the expected shape

                                                                                                          *)
                                                                                                        2. | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_index_arity (name, expected, actual) denotes an error where an indexed family of operators (based on name) expect to be indexed by expected arguments but got actual instead.

                                                                                                          *)
                                                                                                        3. | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_ty_arity (cst, actual) denotes a type constant that was applied to actual arguments, but which has a different arity (which should be accessible by getting its type/sort/arity).

                                                                                                          *)
                                                                                                        4. | Bad_op_arity : symbol * int list * int -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_op_arity (symbol, expected, actual) denotes a named operator (which may be a builtin operator, a top-level defined constant which is being substituted, etc...) expecting a number of arguments among the expected list, but instead got actual number of arguments.

                                                                                                          *)
                                                                                                        5. | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_cstr_arity (cstr, expected, actual) denotes an ADT constructor, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                          *)
                                                                                                        6. | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_term_arity (func, expected, actual) denotes a function symbol, which was expecting one of expected arguments, but which was applied to actual arguments.

                                                                                                          *)
                                                                                                        7. | Bad_poly_arity : Ty.Var.t list * Ty.t list -> Dolmen.Std.Term.t err
                                                                                                          (*

                                                                                                          Bad_poly_arity (ty_vars, ty_args) denotes a polymorphic term