Nominal anti-unification
Alexander Baumgartner, Temur Kutsia, Jordi Levy, Mateu Villaret
TL;DR
This work studies nominal anti-unification for terms-in-context, aiming to compute least general generalizations when a finite base of atoms is used. A central challenge is equivariance: determining a permutation of atoms that makes two terms $\alpha$-equivalent within a freshness context. The authors prove existence and uniqueness of the $A$-based lgg (modulo $\alpha$-equivalence and renaming) and present a rule-based algorithm running in $O(n^5)$ time with $O(n^4)$ space, avoiding translations to higher-order unification. The approach yields a practical solution with a implemented library, and the results have potential applications in inductive learning and cloning detection where bindings are essential.
Abstract
We study nominal anti-unification, which is concerned with computing least general generalizations for given terms-in-context. In general, the problem does not have a least general solution, but if the set of atoms permitted in generalizations is finite, then there exists a least general generalization which is unique modulo variable renaming and $α$-equivalence. We present an algorithm that computes it. The algorithm relies on a subalgorithm that constructively decides equivariance between two terms-in-context. We prove soundness and completeness properties of both algorithms and analyze their complexity. Nominal anti-unification can be applied to problems were generalization of first-order terms is needed (inductive learning, clone detection, etc.), but bindings are involved.
