Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file Unif_intf.ml
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182(* This file is free software, part of Logtk. See file "license" for more details. *)(** {1 Interface for unification} *)typeunif_subst=Unif_subst.ttypesubst=Subst.tmoduletypeS=sigtypetytypetermvalbind:?check:bool->subst->tyHVar.tScoped.t->termScoped.t->subst(** [bind subst v t] binds [v] to [t], but fails if [v] occurs in [t]
(performs an occur-check first)
@param check if true, perform occur check
@raise Fail if occurs-check fires or if the variable is bound already *)valupdate:?check:bool->subst->tyHVar.tScoped.t->termScoped.t->subst(** [bind subst v t] replaces the binding of [v] to [t], but fails if [v] occurs in [t]
(performs an occur-check first)
@param check if true, perform occur check
@raise Fail if occurs-check fires or if the variable is not yet bound *)valunify_syn:?subst:subst->termScoped.t->termScoped.t->subst(** Unify terms syntictally, returns a subst
@raise Fail if the terms are not unifiable *)valunify_full:?subst:unif_subst->termScoped.t->termScoped.t->unif_subst(** Unify terms, returns a subst + constraints or
@raise Fail if the terms are not unifiable *)valmatching:?subst:subst->pattern:termScoped.t->termScoped.t->subst(** [matching ~pattern scope_p b scope_b] returns
[sigma] such that [sigma pattern = b], or fails.
Only variables from the scope of [pattern] can be bound in the subst.
@param subst initial substitution (default empty)
@raise Fail if the terms do not match.
@raise Invalid_argument if the two scopes are equal *)valmatching_same_scope:?protect:(tyHVar.tIter.t)->?subst:subst->scope:int->pattern:term->term->subst(** matches [pattern] (more general) with the other term.
The two terms live in the same scope, which is passed as the
[scope] argument. It needs to gather the variables of the
other term to make sure they are not bound.
@param scope the common scope of both terms
@param protect a sequence of variables to protect (they cannot
be bound during matching!). Variables of the second term
are automatically protected. *)valmatching_adapt_scope:?protect:(tyHVar.tIter.t)->?subst:subst->pattern:termScoped.t->termScoped.t->subst(** Call either {!matching} or {!matching_same_scope} depending on
whether the given scopes are the same or not.
@param protect used if scopes are the same, see {!matching_same_scope} *)valvariant:?subst:subst->termScoped.t->termScoped.t->subst(** Succeeds iff the first term is a variant of the second, ie
if they are alpha-equivalent *)valequal:subst:subst->termScoped.t->termScoped.t->bool(** [equal subst t1 s1 t2 s2] returns [true] iff the two terms
are equal under the given substitution, i.e. if applying the
substitution will return the same term. *)valare_unifiable_full:term->term->bool(** Unifiable with some additional constraints? *)valare_unifiable_syn:term->term->bool(** Unifiable syntactically? *)valmatches:pattern:term->term->boolvalare_variant:term->term->boolend