package logtk
Module Unif.Ty
include S with type term = Type.t and type ty = Type.t
type ty = Type.ttype term = Type.tval bind :
?check:bool ->
Unif_intf.subst ->
ty HVar.t Scoped.t ->
term Scoped.t ->
Unif_intf.substbind subst v t binds v to t, but fails if v occurs in t (performs an occur-check first)
val update :
?check:bool ->
Unif_intf.subst ->
ty HVar.t Scoped.t ->
term Scoped.t ->
Unif_intf.substbind subst v t replaces the binding of v to t, but fails if v occurs in t (performs an occur-check first)
val unify_syn :
?subst:Unif_intf.subst ->
term Scoped.t ->
term Scoped.t ->
Unif_intf.substUnify terms syntictally, returns a subst
val unify_full :
?subst:Unif_intf.unif_subst ->
term Scoped.t ->
term Scoped.t ->
Unif_intf.unif_substUnify terms, returns a subst + constraints or
val matching :
?subst:Unif_intf.subst ->
pattern:term Scoped.t ->
term Scoped.t ->
Unif_intf.substmatching ~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.
val matching_same_scope :
?protect:ty HVar.t Iter.t ->
?subst:Unif_intf.subst ->
scope:int ->
pattern:term ->
term ->
Unif_intf.substmatches 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.
val matching_adapt_scope :
?protect:ty HVar.t Iter.t ->
?subst:Unif_intf.subst ->
pattern:term Scoped.t ->
term Scoped.t ->
Unif_intf.substCall either matching or matching_same_scope depending on whether the given scopes are the same or not.
val variant :
?subst:Unif_intf.subst ->
term Scoped.t ->
term Scoped.t ->
Unif_intf.substSucceeds iff the first term is a variant of the second, ie if they are alpha-equivalent
val equal : subst:Unif_intf.subst -> term Scoped.t -> term Scoped.t -> boolval type_is_unifiable : term -> boolCan we (syntactically) unify terms of this type?