Alberto Martelli 2026-11-05
Alberto Martelli coauthored An Efficient Unification Algorithm by Alberto Martelli and Ugo Montanari in 1982. With Ugo Montanari, he developed a term-equation algorithm whose acyclicity check is built into the implementation rather than treated as an expensive separate afterthought.[ref]
Unification asks for a substitution making terms identical; the most general unifier captures every solution through further substitution. This is stronger than finding one arbitrary matching assignment. The paper's equation transformations preserve the solution set while detecting incompatible constructors and cyclic finite-term requirements, connecting a declarative specification to an efficient procedure.
First-order unification Created 2026-10-20 Updated 2026-11-05
First-order unification solves a finite system of equations between first-order terms. A useful rule presentation deletes , orients to when is a variable, decomposes equal outer function symbols into argument equations, and rejects unequal outer function symbols. For , reject a nontrivial occurrence of in by the occurs check; otherwise propagate the substitution through the other equations. A solved system assigns distinct variables that do not occur in its right sides.[ref]
For example,first becomes . Propagating gives , hence a most general unifier. Keeping without composing the later substitution would leave an unsolved dependency.
The rules preserve the possible unifiers, apart from explicitly rejecting impossible equations. Decomposition works because identical first-order terms have identical constructors and arguments. At a solved system, any other unifier is obtained by instantiating its remaining free variables; this proves the most general unifier property. Efficient implementations share term graphs rather than repeatedly copying growing first-order terms.
Term graph 2026-11-05
A term graph represents the structure of first-order terms with labelled nodes and ordered argument graph edges. For finite acyclic first-order terms, the representation can be a directed acyclic graph, allowing identical subterms to share nodes rather than being copied into separate branches of a tree.
The first-order term has five occurrences in its ordinary syntax tree: one , two and two . A shared term graph can use only three nodes, with the two argument graph edges of pointing to the same node. Sharing a variable node is also useful: identifications made by a unification algorithm can be represented once and followed from every occurrence.[ref]
An Efficient Unification Algorithm by Alberto Martelli and Ugo Montanari. Section2 and implementation discussion, sharing and the acyclicity test
Sharing changes storage, not the meaning of an acyclic finite first-order term. A cycle is different. A node labelled whose argument points back to itself unfolds to an infinite rational tree; it cannot represent a finite solution to . An implementation must therefore state whether it supports infinite rational trees or enforces the finite-term occurs check.
Ugo Montanari 2026-11-05
Ugo Montanari coauthored the 1982 unification algorithm with Alberto Martelli. Their paper treats first-order terms as equations and derives an efficient implementation from simpler transformation rules, integrating the acyclicity test needed for finite terms.[ref]
An Efficient Unification Algorithm by Alberto Martelli and Ugo Montanari. abstract, §2 and Algorithm1
For example, decomposing gives and , whereas has no finite-term solution and must be rejected. The point is to compute a most general unifier without expanding or repeatedly traversing shared term structure unnecessarily. Such unification supports automated deduction and logic programming.
Unifier 2026-11-05
A unifier of first-order terms is a first-order substitution for which . The first-order substitution replaces variables by first-order terms; it does not alter function symbols. For example, unifies with .
A most general unifier leaves every identification not forced by the original equations available for later choice. For , one solution is . The remaining variable is free. Replacing it by any finite first-order term gives a more specific unifier; arbitrarily choosing during the initial computation would discard that generality.
Not every pair is unifiable. Distinct constant symbols cannot be made equal by replacing variables, and the occurs check rejects for finite first-order terms. These are structural restrictions, not numerical inequalities. Unifiers allow a resolution step to align the relevant atomic formulas before the logical inference is performed.[ref]
An Efficient Unification Algorithm by Alberto Martelli and Ugo Montanari. Introduction and Section2, substitutions and solved equation systems