Nominal Anti-Unification
This paper addresses nominal anti-unification—the computation of a least general generalization (LGG) of given terms within contexts containing binding structures. Standard first-order anti-unification fails for bound variables, and this work establishes, for the first time in the nominal syntax framework, that an LGG exists and is unique up to variable renaming and α-equivalence when the underlying atom set is finite. To compute it, we propose the first sound and complete constructive algorithm, integrating nominal logic, equivariance checking, α-equivalence handling, and context-sensitive generalization. We formally prove its polynomial-time complexity. Our approach provides a rigorous and efficient foundation for binding-aware inductive learning and code clone detection.