# Ivannikov Institute for System Programming of the RAS

## Anti-unification algorithms and their applications in program analysis.

#### Authors

Bulychev P.E., Kostylev E.V., Zakharov V.A.

#### Abstract

A term $t$ is called a \emph{template} of terms $t_1$ and $t_2$ iff $t_1=t\eta_1$ and $t_2=t\eta_2$, for some substitutions $\eta_1$ and $\eta_2$. A template $t$ of $t_1$ and $t_2$ is called \emph{the most specific} iff for any template $t'$ of $t_1$ and $t_2$ there exists a substitution $\xi$ such that $t=t'\xi$. The anti-unification problem is that of computing the most specific template of two given terms. This problem is dual to the well-known unification problem, which is the computing of the most general instance of terms. Unification is used extensively in automatic theorem proving and logic programming. We believe that anti-unification algorithms may have wide applications in program analysis. In this paper we present an efficient algorithm for computing the most specific templates of terms represented by labeled directed acyclic graphs and estimate the complexity of the anti-unification problem. We also describe techniques for invariant generation and software clone detection, which are based on the concepts of the most specific templates and anti-unification.

Text of article

#### Keywords

antiunification, invariant, program, clone, refactoring

#### Edition

Proceedings of the 7th International Conference "Perspectives of System Informatics", June 15-19, 2009, Novosibirsk, серия Lecture Notes in Computer Science, 2014, vol. 5947, pp. 413-424.

### Research Group

All publications during 2009 All publications