Expr.TermSourceSignature required by terms for typing first-order polymorphic terms.
The representation of term types, type variables, and type constants.
Printing function.
Get the list of values bound to a list tag, returning the empty list if no value is bound.
Optionally bind an additional value to a list tag.
Bind a list of additional values to a list tag.
Define a new record type.
val define_adt :
ty_const ->
ty_var list ->
(Path.t * (ty * Path.t option) list) list ->
Ty.def * (Cstr.t * (ty * Const.t option) list) listdefine_aft t vars cstrs defines the type constant t, parametrised over the type variables ty_vars as defining an algebraic datatypes with constructors cstrs. cstrs is a list where each elements of the form (name, l) defines a new constructor for the algebraic datatype, with the given name. The list l defines the arguments to said constructor, each element of the list giving the type ty of the argument expected by the constructor (which may contain any of the type variables in vars), as well as an optional destructor name. If the construcotr name is Some s, then the ADT definition also defines a function that acts as destructor for that particular field. This polymorphic function is expected to takes as arguments as many types as there are variables in vars, an element of the algebraic datatype being defined, and returns a value for the given field. For instance, consider the following definition for polymorphic lists: define_adt list [ty_var_a] [ "nil", []; "const", [ (Ty.of_var ty_var_a , Some "hd"); (ty_list_a , Some "tl"); ]; ] This definition defines the usual type of polymorphic linked lists, as well as two destructors "hd" and "tl". "hd" would have type forall alpha. alpha list -> a, and be the partial function returning the head of the list.
Exception raised in case of typing error during term construction. Wrong_type (t, ty) should be raised by term constructor functions when some term t is expected to have type ty, but does not have that type.
Raised when some constructor was expected to belong to some type but does not belong to the given type.
Exception raised in case of typing error during term construction. This should be raised when the returned field was expected to be a field for the returned record type constant, but it was of another record type.
A field was expected but the returned term constant is not a record field.
Raised when trying to create a pattern matching, but a non-pattern term was provided where a pattern was expected.
Raise when creating a pattern matching but an empty list of branches was provided
Raised when a partial pattern matching was created. A list of terms not covered by the patterns is provided.
Raised when trying to access the tester of an ADT constructor, but the constant provided was not a constructor.
Raised when an application was provided too many term arguments. The extraneous arguments are returned by the exception.
Raised when a polymorphic application does not have an adequate number of arguments.
Create a pattern match.
Create a local function. The first pair of arguments are the variables that are free in the resulting quantified formula, and the second pair are the variables bound.
Universally quantify the given formula over the type and terms variables. The first pair of arguments are the variables that are free in the resulting quantified formula, and the second pair are the variables bound.
Existencially quantify the given formula over the type and terms variables. The first pair of arguments are the variables that are free in the resulting quantified formula, and the second pair are the variables bound.
Tag the given variable with the term, to mark it has been let-bound. Views might use that information to transparently replace a let-bound variable with its defining term.
Sequential let-binding. Variables can be bound to either terms or formulas.
Parrallel let-binding. Variables can be bound to either terms or formulas.