Stratified Context Unification Is NP-Complete
Context Unification is the problem to decide for a given set of second-order equations E where all second-order variables are unary, whether there exists a unifier, such that for every second-order variable X, the abstraction λx. r instantiated for X has exactly one occurrence of the bound variable x in r. Stratified Context Unification is a specialization where the nesting of second-order variables in E is restricted.
It is already known that Stratified Context Unification is decidable, NP-hard, and in PSPACE, whereas the decidability and the complexity of Context Unification is unknown. We prove that Stratified Context Unification is in NP by proving that a size-minimal solution can be represented in a singleton tree grammar of polynomial size, and then applying a generalization of Plandowski’s polynomial algorithm that compares compacted terms in polynomial time. This also demonstrates the high potential of singleton tree grammars for optimizing programs maintaining large terms.
A corollary of our result is that solvability of rewrite constraints is NP-complete.
KeywordsContext Variable Function Symbol Decision Algorithm Surface Equation Main Path
Unable to display preview. Download preview PDF.
- [CDG+97]Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (1997) (release, October 1, 2002), available on http://www.grappa.univ-lille3.fr/tata
- [Lev96]Levy, J.: Linear second order unification. In: Ganzinger, H. (ed.) RTA 1996. LNCS, vol. 1103, pp. 332–346. Springer, Heidelberg (1996)Google Scholar
- [NPR97a]Niehren, J., Pinkal, M., Ruhrberg, P.: On equality up-to constraints over finite trees, context unification, and one-step rewriting. In: McCune, W. (ed.) CADE 1997. LNCS, vol. 1249, pp. 34–48. Springer, Heidelberg (1997)Google Scholar
- [NPR97b]Niehren, J., Pinkal, M., Ruhrberg, P.: A uniform approach to underspecification and parallelism. In: 35th ACL 1997, Madrid, pp. 410–417 (1997)Google Scholar
- [Pla95]Plandowski, W.: The Complexity of the Morphism Equivalence Problem for Context-Free Languages. PhD thesis, Dept. of Mathematics, Informatics and Mechanics, Warsaw University (1995)Google Scholar
- [SAT06]http://www.satlive.org/ (2006)Google Scholar
- [SS05]Schmidt-Schauß, M.: Polynomial equality testing for terms with shared substructures. Frank report 21, Institut für Informatik. FB Informatik und Mathematik. J. W. Goethe-Universität Frankfurt am Main (November 2005)Google Scholar