[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article

Deciding Context Unification

Published: 16 October 2019 Publication History

Abstract

In first-order term unification, variables represent well-formed terms over a given signature, and we are to solve equations built using function symbols from the signature and such variables; this problem is well-known to be decidable (in linear time). In second-order term unification, the variables take arguments (i.e., other terms) and a substitution uses those arguments an arbitrary number of times; for instance, an equation f(X(c),X(c)) = X(f(c,c)) has a solution X = •, where • is a special symbol denoting the place in which the argument is substituted. Under this substitution, both sides evaluate to f(c,c). There are other solutions, for instance X = f(•,•), which evaluates both sides tof(f(c,c),f(c,c)); in general, a solution that evaluates both sides to full binary tree of arbitrary height is easy to construct. Second-order unification is in general undecidable. Context unification is a natural problem in between first- and second-order unification—we deal with equations over terms, the variables take arguments, but we restrict the set of solutions: The argument is used exactly once. Formally, contexts are terms with exactly one occurrence of the special symbol • and in context unification, we are given an equation over terms with variables representing contexts and ask about the satisfiability of this equation. For instance, when the aforementioned equation f(X(c),X(c)) = X(f(c,c)) is treated as a context unification problem, then it has exactly one solution: X = •. Other substitutions that are solutions of it as an instance of the second-unification problem, say X = f(•, •), are not valid, as • is used more than once. Context unification also generalizes satisfiability of word equations, which is decidable (in PSPACE). The decidability status of context unification remained unknown for almost two decades. In this article, we show that context unification is in PSPACE (in EXPTIME, when tree regular constraints are also allowed). Those results are obtained by extending the recently developed recompression technique, which was previously defined for strings and used to obtain a new PSPACE algorithm for satisfiability of word equations. In this article, the technique is generalized to trees, and the corresponding algorithm is generalized from word equations to context unification. The idea of recompression is to apply simple compression rules (replacing pairs of neighboring function symbols) to the solution of the context equation; to this end, we appropriately modify the equation (without the knowledge of the actual solution) so compressing the solution can be simulated by compressing parts of the equation. It is shown that if the compression operations are appropriately chosen, then the size of the instance is polynomial during the whole algorithm, thus giving a PSPACE-upper bound.

References

[1]
Marek Chrobak. 1986. Finite automata and unary languages. Theor. Comput. Sci. 47, 3 (1986), 149--158.
[2]
Hubert Comon. 1998. Completion of rewrite systems with membership constraints. Part I: Deduction rules. J. Symb. Comput. 25, 4 (1998), 397--419.
[3]
Hubert Comon. 1998. Completion of rewrite systems with membership constraints. Part II: Constraint solving. J. Symb. Comput. 25, 4 (1998), 421--453.
[4]
Volker Diekert, Claudio Gutiérrez, and Christian Hagenah. 2005. The existential theory of equations with rational constraints in free groups is PSPACE-complete. Inf. Comput. 202, 2 (2005), 105--140.
[5]
Volker Diekert, Artur Jeż, and Wojciech Plandowski. 2016. Finding all solutions of equations in free groups and monoids with involution. Inf. Comput. 251 (2016), 263--286.
[6]
William M. Farmer. 1991. Simple second-order languages for which unification is undecidable. Theor. Comput. Sci. 87, 1 (1991), 25--41.
[7]
Thom W. Frühwirth, Ehud Y. Shapiro, Moshe Y. Vardi, and Eyal Yardeni. 1991. Logic programs as types for logic programs. In Proceedings of the LICS. IEEE Computer Society, 300--309.
[8]
Adria Gascón, Guillem Godoy, Manfred Schmidt-Schauß, and Ashish Tiwari. 2010. Context unification with one context variable. J. Symb. Comput. 45, 2 (2010), 173--193.
[9]
Adria Gascón, Manfred Schmidt-Schauß, and Ashish Tiwari. 2015. Two-restricted one context unification is in polynomial time. In Proceedings of the CSL (LIPIcs), Stephan Kreutzer (Ed.), Vol. 41. Schloss Dagstuhl—Leibniz-Zentrum fuer Informatik, 405--422.
[10]
Adria Gascón, Ashish Tiwari, and Manfred Schmidt-Schauß. 2015. One context unification problems solvable in polynomial time. In Proceedings of the LICS. IEEE, 499--510.
[11]
Pawel Gawrychowski. 2011. Chrobak normal form revisited, with applications. In Proceedings of the CIAA (Lecture Notes in Computer Science), Béatrice Bouchou-Markhoff, Pascal Caron, Jean-Marc Champarnaud, and Denis Maurel (Eds.), Vol. 6807. Springer, 142--153.
[12]
Warren D. Goldfarb. 1981. The undecidability of the second-order unification problem. Theor. Comput. Sci. 13 (1981), 225--230.
[13]
Artur Jeż. 2014. The complexity of compressed membership problems for finite automata. Theor. Comput. Syst. 55 (2014), 685--718.
[14]
Artur Jeż. 2014. Context unification is in PSPACE. In Proceedings of the ICALP (LNCS), Elias Koutsoupias, Javier Esparza, and Pierre Fraigniaud (Eds.), Vol. 8573. Springer, 244--255. full version at http://arxiv.org/abs/1310.4367.
[15]
Artur Jeż. 2015. Approximation of grammar-based compression via recompression. Theor. Comput. Sci. 592 (2015), 115--134.
[16]
Artur Jeż. 2015. Faster fully compressed pattern matching by recompression. ACM Trans. Algor. 11, 3 (Jan. 2015), 20:1--20:43.
[17]
Artur Jeż. 2016. One-variable word equations in linear time. Algorithmica 74 (2016), 1--48.
[18]
Artur Jeż. 2016. Recompression: A simple and powerful technique for word equations. J. ACM 63, 1 (Mar. 2016), 4:1--4:51.
[19]
Artur Jeż. 2017. Word equations in nondeterministic linear space. In Proceedings of the ICALP (LIPIcs), Ioannis Chatzigiannakis, Piotr Indyk, Fabian Kuhn, and Anca Muscholl (Eds.), Vol. 80. Schloss Dagstuhl—Leibniz-Zentrum fuer Informatik, 95:1--95:13.
[20]
Artur Jeż and Markus Lohrey. 2016. Approximation of smallest linear tree grammar. Inform. Comput. 251 (2016), 215--251.
[21]
Antoni Kościelski and Leszek Pacholski. 1996. Complexity of Makanin’s algorithm. J. ACM 43, 4 (1996), 670--684.
[22]
Jordi Levy. 1996. Linear second-order unification. In Proceedings of the RTA (LNCS), Harald Ganzinger (Ed.), Vol. 1103. Springer, 332--346.
[23]
Jordi Levy and Jaume Agustí-Cullell. 1996. Bi-rewrite systems. J. Symb. Comput. 22, 3 (1996), 279--314.
[24]
Jordi Levy, Manfred Schmidt-Schauß, and Mateu Villaret. 2008. The complexity of monadic second-order unification. SIAM J. Comput. 38, 3 (2008), 1113--1140.
[25]
Jordi Levy, Manfred Schmidt-Schauß, and Mateu Villaret. 2011. On the complexity of bounded second-order unification and stratified context unification. Log. J. IGPL 19, 6 (2011), 763--789.
[26]
Jordi Levy and Margus Veanes. 2000. On the undecidability of second-order unification. Inf. Comput. 159, 1--2 (2000), 125--150.
[27]
Jordi Levy and Mateu Villaret. 2000. Linear second-order unification and context unification with tree-regular constraints. In Proceedings of the RTA (LNCS), Leo Bachmair (Ed.), Vol. 1833. Springer, 156--171.
[28]
Jordi Levy and Mateu Villaret. 2002. Currying second-order unification problems. In Proceedings of the RTA (LNCS), Sophie Tison (Ed.), Vol. 2378. Springer, 326--339.
[29]
Gennadií Makanin. 1977. The problem of solvability of equations in a free semigroup. Matemat. Sbor. 2, 103 (1977), 147--236. (in Russian).
[30]
Jerzy Marcinkowski. 1997. Undecidability of the first order theory of one-step right ground rewriting. In Proceedings of the RTA (LNCS), Hubert Comon (Ed.), Vol. 1232. Springer, 241--253.
[31]
Gary L. Miller and John H. Reif. 1989. Parallel tree contraction, Part 1: Fundamentals. In Randomness and Computation, Silvio Micali (Ed.). Vol. 5. JAI Press, Greenwich, Connecticut, 47--72.
[32]
Gary L. Miller and John H. Reif. 1991. Parallel tree contraction, Part 2: Further applications. SIAM J. Comput. 20, 6 (1991), 1128--1147.
[33]
Joachim Niehren, Manfred Pinkal, and Peter Ruhrberg. 1997. On equality up-to constraints over finite trees, context unification, and one-step rewriting. In Proceedings of the CADE (LNCS), William McCune (Ed.), Vol. 1249. Springer, 34--48.
[34]
Joachim Niehren, Manfred Pinkal, and Peter Ruhrberg. 1997. A uniform approach to underspecification and parallelism. In Proceedings of the ACL, Philip R. Cohen and Wolfgang Wahlster (Eds.). Morgan Kaufmann Publishers/ACL, 410--417.
[35]
Wojciech Plandowski. 1999. Satisfiability of word equations with constants is in NEXPTIME. In Proceedings of the STOC. ACM, 721--725.
[36]
Wojciech Plandowski. 2004. Satisfiability of word equations with constants is in PSPACE. J. ACM 51, 3 (2004), 483--496.
[37]
Wojciech Plandowski and Wojciech Rytter. 1998. Application of Lempel-Ziv encodings to the solution of word equations. In Proceedings of the ICALP (LNCS), Kim Guldstrand Larsen, Sven Skyum, and Glynn Winskel (Eds.), Vol. 1443. Springer, 731--742.
[38]
RTA problem list. 1990. Problem 90. (1990). Retrieved from: http://rtaloop.mancoosi.univ-paris-diderot.fr/problems/90.html.
[39]
Manfred Schmidt-Schauß. 1994. Unification of stratified second-order terms. (1994). Internal Report 12/94, Johann-Wolfgang-Goethe-Universität.
[40]
Manfred Schmidt-Schauß. 1998. A decision algorithm for distributive unification. Theor. Comput. Sci. 208, 1--2 (1998), 111--148.
[41]
Manfred Schmidt-Schauß. 2002. A decision algorithm for stratified context unification. J. Log. Comput. 12, 6 (2002), 929--953.
[42]
Manfred Schmidt-Schauß. 2004. Decidability of bounded second order unification. Inf. Comput. 188, 2 (2004), 143--178.
[43]
Manfred Schmidt-Schauß and Klaus U. Schulz. 1998. On the exponent of periodicity of minimal solutions of context equation. In Proceedings of the RTA (LNCS), Vol. 1379. Springer, 61--75.
[44]
Manfred Schmidt-Schauß and Klaus U. Schulz. 2002. Solvability of context equations with two context variables is decidable. J. Symb. Comput. 33, 1 (2002), 77--122.
[45]
Manfred Schmidt-Schauß and Klaus U. Schulz. 2005. Decidability of bounded higher-order unification. J. Symb. Comput. 40, 2 (2005), 905--954.
[46]
Klaus U. Schulz. 1990. Makanin’s algorithm for word equations—Two improvements and a generalization. In Proceedings of the IWWERT (LNCS), Klaus U. Schulz (Ed.), Vol. 572. Springer, 85--150.
[47]
Ralf Treinen. 1998. The first-order theory of linear one-step rewriting is undecidable. Theor. Comput. Sci. 208, 1--2 (1998), 179--190.
[48]
Sergei G. Vorobyov. 1997. The first-order theory of one step rewriting in linear Noetherian systems is undecidable. In Proceedings of the RTA (LNCS), Hubert Comon (Ed.), Vol. 1232. Springer, 254--268.
[49]
Sergei G. Vorobyov. 1998. ∀∃*-equational theory of context unification is Π10-hard. In Proceedings of the MFCS (LNCS), Lubos Brim, Jozef Gruska, and Jirí Zlatuska (Eds.), Vol. 1450. Springer, 597--606.

Cited By

View all
  • (2023)Some techniques for reasoning automatically on co-inductive data structuresJournal of Logic and Computation10.1093/logcom/exad02834:3(429-464)Online publication date: 6-Jun-2023
  • (2022)Word equations in non-deterministic linear spaceJournal of Computer and System Sciences10.1016/j.jcss.2021.08.001123:C(122-142)Online publication date: 1-Feb-2022

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Journal of the ACM
Journal of the ACM  Volume 66, Issue 6
December 2019
231 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/3368192
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 October 2019
Accepted: 01 July 2019
Revised: 01 April 2019
Received: 01 August 2017
Published in JACM Volume 66, Issue 6

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Context unification
  2. second order unification
  3. term rewriting

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)0
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Some techniques for reasoning automatically on co-inductive data structuresJournal of Logic and Computation10.1093/logcom/exad02834:3(429-464)Online publication date: 6-Jun-2023
  • (2022)Word equations in non-deterministic linear spaceJournal of Computer and System Sciences10.1016/j.jcss.2021.08.001123:C(122-142)Online publication date: 1-Feb-2022

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media