pub fn unify_exprs(e1: &ProofExpr, e2: &ProofExpr) -> ProofResult<Substitution>Expand description
Unify two expressions, returning the Most General Unifier.
Expression unification extends term unification with support for logical connectives, quantifiers, and alpha-equivalence for bound variables.
§Alpha-Equivalence
Bound variable names are considered arbitrary:
∀x P(x)unifies with∀y P(y)∃e Run(e)unifies with∃x Run(x)
This is achieved by substituting fresh constants for bound variables before comparing bodies.
§Beta-Reduction
Both expressions are beta-reduced before comparison, so
(λx. P(x))(a) will unify with P(a).
§Arguments
e1- The first expressione2- The second expression
§Returns
Ok(subst)- A substitution unifying the expressionsErr(ExprUnificationFailed)- If expressions cannot be unified
§See Also
unify_terms- Underlying term unificationbeta_reduce- Normalization applied before unificationunify_pattern- Higher-order pattern unification for holes