module Term:sig..end
type term =
| |
Term of |
(* | Head symbol, supertypes, subterms | *) |
| |
SVar of |
(* | Shared variable symbol, encoding depth, type, subterms | *) |
| |
TVar of |
(* | Type variable symbol | *) |
val fun_type_name : string
Substituting superclasses corresponding to sharing variable types
while rewriting: "Let f X be X := t" syntax.
val assign_name : stringval symbol_of_term : term -> stringval term_str : term -> string
Super concise super readable form.
val short_term : (term -> string) Pervasives.refval suffix : int -> term -> termval equal_mod_tvars : term -> term -> boolval size_up_to : int -> term -> intval s_vars_in_term : string list -> term -> string listval t_vars_in_term : string list -> term -> string listval has_s_var : term -> boolval has_t_var : term -> boolval fn_apply : int -> ('a -> 'a) -> 'a -> 'aval add_logic_name : string -> unitBuiltinLang.parsed_tvar_name and
BuiltinLang.universal_tvar_name. Logic names have to have
types.type t_subst
type s_subst
typesubsts =s_subst * t_subst
exception UNIFY
val empty_s_sb : s_substval empty_t_sb : t_substval empty_sbs : substsNot_found.val assoc_t_sb : string -> t_subst -> termval assoc_s_sb : string -> s_subst -> termval apply_sbs : substs -> term -> termval head_grounding : term -> termUNIFY on unbounded
type variables.
Return the supertypes of a term or type of a variable.
val types_of : term -> term arraytype position
val position_str : position -> stringval subst_t_pos : position -> subt:term -> term -> termval get_t_pos : position -> term -> termtype iter_s_subst
type iter_t_subst
typeisubsts =iter_s_subst * iter_t_subst
val empty_t_isb : iter_t_substval empty_s_isb : iter_s_substval empty_isbs : isubststype add_to_decls =
| |
Decls_OK |
(* | Declaration added. | *) |
| |
Decls_multi_glb of |
(* | The first two symbols already have the third symbol as a greatest lower bound, the proposed declaration would introduce alternative GLB for them. | *) |
| |
Decls_multi_lub of |
(* | The proposed declaration together with the third symbol would have the first two symbols both as least upper bounds. | *) |
| |
Decls_redundant_s of |
(* | Of proposed direct superclasses one ISA the second one. | *) |
| |
Decls_polyconflict |
(* | One of several supertypes is a type variable. | *) |
| |
Decls_var |
|||
| |
Decls_repeating of |
type decls_set
val create_decls : unit -> decls_setval get_superclasses : decls_set -> string -> Aux.Strings.tval get_subclasses : decls_set -> string -> string listval get_decl : decls_set -> string -> termexception EXC_Decls_multi_lub of string * string * string
val add_to_decls : decls_set -> term -> add_to_declsISA order relation. Return whether
the declaration was added or the reason it was not added.val glb : decls_set -> term -> term -> isubsts * termUNIFY. Shared variables are merged using GLB-unification and
type variables are merged using LUB-unification. The returned term
contains variables from the substitution.
Substitutions are never applied during glb-unification. It
is important to return this intermediate representation, because
parsing is a "distributed glb-unification" as it produces a
single term that ISA a declaration.
val aux_glb : decls_set ->
isubsts -> term -> term -> isubsts * termval lub : decls_set -> term -> term -> isubsts * termUNIFY. Shared variables are merged using GLB-unification and
type variables are merged using LUB-unification. See also Term.glb.val aux_lub : decls_set ->
isubsts -> term -> term -> isubsts * termval aux_glb_lub_cont : decls_set -> isubsts -> isubsts -> isubstsval isa_match : decls_set ->
?for_rewrite:bool ->
pattern:term -> term -> substs * positionUNIFY. First term is the
pattern. Shared variables are merged using MGU (eq-unification)
and type variables are merged using LUB-unification. See also
Term.glb. With for_rewrite=true, will ignore mismatches at purely
polymorphic supertypes. (A supertype of a class/functor is purely
polymorphic if in its position in the declaration is a type
variable, even if the variable is bounded.)
Similar to ISA-matching pattern against term and vice versa with
for_rewriting set to true, but treats sharing variables as
constants and does not produce substitutions.
val equal_for_rewriting : decls_set -> term -> term -> boolval isa_unify : decls_set -> pattern:term -> term -> isubstsTerm.isa_match.val aux_isa_unify : decls_set ->
isubsts -> pattern:term -> term -> isubstsval is_superclass_of : decls_set -> pattern:term -> term -> boolval mgu_iter : decls_set -> term -> term -> isubstsUNIFY if not unifiable. Both shared
variables and type variables are merged using MGU
(eq-unification).val aux_mgu_i : decls_set -> isubsts -> term -> term -> isubstsval aux_mgu_i_cont : decls_set -> isubsts -> isubsts -> isubstsval apply_isbs : isubsts -> term -> termval split_to_list : string -> Aux.split_result listval s_subst_str : s_subst -> stringval t_subst_str : t_subst -> stringval t_isubst_str : iter_t_subst -> stringval substs_str : substs -> stringval substs_fstr : (term -> string) -> substs -> stringval isubsts_str : isubsts -> stringval isubsts_fstr : (term -> string) -> isubsts -> stringval t_isubst_map : (term -> term) -> iter_t_subst -> iter_t_substval s_isubst_map_some : (string * (int * term) -> (string * (int * term)) option) ->
iter_s_subst -> iter_s_substval isubsts_map : (term -> term) -> isubsts -> isubstsmodule HashableTerm:sig..end
module TermHashtbl:sig..end