Abstract

It is generally accepted that to unify a pair of substitutions θ_1 and θ_2 means to find out a pair of substitutions η' and η'' such that the compositions θ_1 η' and θ_2 η'' are the same. Actually, unification is the problem of solving linear equations of the form θ_1 X=θ_2 Y in the semigroup of substitutions. But some other linear equations on substitutions may be also viewed as less common variants of unification problem. In this paper we introduce a two-sided unification as the process of bringing a given substitution θ_1 to another given substitution θ_2 from both sides by giving a solution to an equation Xθ_1 Y=θ_2. Two-sided unification finds some applications in software refactoring as a means for extracting instances of library subroutines in arbitrary pieces of program code. In this paper we study the complexity of two-sided unification for substitutions and programs. In Section 1 we discuss the concept of unification on substitutions and programs, outline the recent results on program equivalence checking that involve the concept of unification and anti-unification, and show that the problem of library subroutine extraction may be viewed as the problem of two-sided unification for programs. In Section 2 we formally define the concept of two-sided unification on substitutions and show that the problem of two-unifiability is NP-complete (in contrast to P-completeness of one-sided unifiability problem). NP-hardness of two-sided unifiability problem is established in Section 4 by reducing to it the bounded tiling problem which is known to be NP-complete; the latter problem is formally defined in Section 3. In Section 5 we define two-sided unification of sequential programs in the first-order model of programs supplied with strong equivalence (logic&term equivalence) of programs and proved that this problem is NP-complete. This is the main result of the paper.

Highlights

  • Данная статья продолжает серию работ [1,2,3,4], в которых исследуется применимость методов и алгоритмов теории унификации [5] для решения задач оптимизации и верификации программ

  • In this paper we introduce a two-sided unification as the process of bringing a given substitution θ1 to another given substitution θ2 from both sides by giving a solution to an equation Xθ1Y = θ2

  • In this paper we study the complexity of two-sided unification for substitutions and programs

Read more

Summary

Введение

Данная статья продолжает серию работ [1,2,3,4], в которых исследуется применимость методов и алгоритмов теории унификации [5] для решения задач оптимизации и верификации программ. П. В частности, одной из задач реорганизации программ является задача обнаружения и устранения клонов. Задача унификации выражений (формул, атомов, термов) языка предикатов первого порядка состоит в том, чтобы для заданной пары выражений E1(x1, ... В то же время, для эффективного решения задачи унификации необходимо, чтобы это выбранное отношение эквивалентности было разрешимым. Основным результатом статьи является теорема, показывающая, что задача проверки двусторонней унифицируемости программ относительно логико-термальной эквивалентности является NPполной задачей. Чтобы установить NP-полноту задачи двусторонней унификации подстановок, в третьем разделе рассмотрена задача о правильном расположении домино (мозаики) на ограниченной области плоскости. В четвертом разделе показано, что задача о правильном расположении домино сводится к задаче проверки двусторонней унифицируемости подстановок; тем самым устанавливается NP-полнота исследуемой задачи. На основании этого результата в пятом разделе статьи показано, что задача двусторонней унифицируемости в модели последовательных императивных программ с отношением логико-термальной эквивалентности также является NP–полной. В заключении статьи обсуждаются практические способы вычисления двусторонних унификаторов программ и методы выделения ядра у пар подобных программ

Двусторонняя унификация конечных подстановок
Проблема ограниченного домино
NP-полнота проблемы унифицируемости подстановок двусторонней
Двусторонняя унификация программ
Заключение
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call