Module type Unif_intf.S
val bind : ?check:bool -> subst -> ty HVar.t Scoped.t -> term Scoped.t -> substbind subst v tbindsvtot, but fails ifvoccurs int(performs an occur-check first)- parameter check
if true, perform occur check
- raises Fail
if occurs-check fires or if the variable is bound already
val update : ?check:bool -> subst -> ty HVar.t Scoped.t -> term Scoped.t -> substbind subst v treplaces the binding ofvtot, but fails ifvoccurs int(performs an occur-check first)- parameter check
if true, perform occur check
- raises Fail
if occurs-check fires or if the variable is not yet bound
val unify_syn : ?subst:subst -> term Scoped.t -> term Scoped.t -> substUnify terms syntictally, returns a subst
- raises Fail
if the terms are not unifiable
val unify_full : ?subst:unif_subst -> term Scoped.t -> term Scoped.t -> unif_substUnify terms, returns a subst + constraints or
- raises Fail
if the terms are not unifiable
val matching : ?subst:subst -> pattern:term Scoped.t -> term Scoped.t -> substmatching ~pattern scope_p b scope_breturnssigmasuch thatsigma pattern = b, or fails. Only variables from the scope ofpatterncan be bound in the subst.- parameter subst
initial substitution (default empty)
- raises Fail
if the terms do not match.
- raises Invalid_argument
if the two scopes are equal
val matching_same_scope : ?protect:ty HVar.t Iter.t -> ?subst:subst -> scope:int -> pattern:term -> term -> substmatches
pattern(more general) with the other term. The two terms live in the same scope, which is passed as thescopeargument. It needs to gather the variables of the other term to make sure they are not bound.- parameter scope
the common scope of both terms
- parameter protect
a sequence of variables to protect (they cannot be bound during matching!). Variables of the second term are automatically protected.
val matching_adapt_scope : ?protect:ty HVar.t Iter.t -> ?subst:subst -> pattern:term Scoped.t -> term Scoped.t -> substCall either
matchingormatching_same_scopedepending on whether the given scopes are the same or not.- parameter protect
used if scopes are the same, see
matching_same_scope
val variant : ?subst:subst -> term Scoped.t -> term Scoped.t -> substSucceeds iff the first term is a variant of the second, ie if they are alpha-equivalent