The Satisfiability of Word Equations: Decidable and Undecidable Theories

  • Joel D. DayEmail author
  • Vijay Ganesh
  • Paul He
  • Florin Manea
  • Dirk Nowotka
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11123)


The study of word equations is a central topic in mathematics and theoretical computer science. Recently, the question of whether a given word equation, augmented with various constraints/extensions, has a solution has gained critical importance in the context of string SMT solvers for security analysis. We consider the decidability of this question in several natural variants and thus shed light on the boundary between decidability and undecidability for many fragments of the first order theory of word equations and their extensions. In particular, we show that when extended with several natural predicates on words, the existential fragment becomes undecidable. On the other hand, the positive \(\varSigma _2\) fragment is decidable, and in the case that at most one terminal symbol appears in the equations, remains so even when length constraints are added. Moreover, if negation is allowed, it is possible to model arbitrary equations with length constraints using only equations containing a single terminal symbol and length constraints. Finally, we show that deciding whether solutions exist for a restricted class of equations, augmented with many of the predicates leading to undecidability in the general case, is possible in non-deterministic polynomial time.


Word equations Decidability Satisfiability 


  1. 1.
    Abdulla, P.A., Atig, M.F., Chen, Y., Holík, L., Rezine, A., Rümmer, P., Stenman, J.: Norn: an SMT solver for string constraints. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 462–469. Springer, Cham (2015). Scholar
  2. 2.
    Aydin, A., Bang, L., Bultan, T.: Automata-based model counting for string constraints. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 255–272. Springer, Cham (2015). Scholar
  3. 3.
    Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 171–177. Springer, Heidelberg (2011). Scholar
  4. 4.
    Berzish, M., Ganesh, V., Zheng, Y.: Z3str3: a string solver with theory-aware heuristics. In: Proceedings of the FMCAD 2017, pp. 55–59. IEEE (2017)Google Scholar
  5. 5.
    Bremer, J., Freydenberger, D.D.: Inclusion problems for patterns with a bounded number of variables. Inf. Comput. 220, 15–43 (2012)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Büchi, J.R., Senger, S.: Definability in the existential theory of concatenation and undecidable extensions of this theory. Z. für math. Logik Grundlagen d. Math. 47, 337–342 (1988)MathSciNetzbMATHGoogle Scholar
  7. 7.
    Day, J.D., Manea, F., Nowotka, D.: The hardness of solving simple word equations. In: Proceedings of the MFCS 2017. LIPIcs, vol. 83, pp. 18:1–18:14 (2017)Google Scholar
  8. 8.
    Diekert, V., Jeż, A., Plandowski, W.: Finding all solutions of equations in free groups and monoids with involution. Inf. Comput. 251, 263–286 (2016)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Diekert, V., Lohrey, M.: Existential and positive theories of equations in graph products. Theory Comput. Syst. 37(1), 133–156 (2004)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Durnev, V.G.: Undecidability of the positive \(\forall \exists \)-theory of a free semigroup. Sib. Math. J. 36(5), 917–929 (1995)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Freydenberger, D.D., Reidenbach, D.: Bad news on decision problems for patterns. Inf. Comput. 208(1), 83–96 (2010)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Ganesh, V., Minnes, M., Solar-Lezama, A., Rinard, M.: Word equations with length constraints: what’s decidable? In: Biere, A., Nahir, A., Vos, T. (eds.) HVC 2012. LNCS, vol. 7857, pp. 209–226. Springer, Heidelberg (2013). Scholar
  13. 13.
    Halfon, S., Schnoebelen, P., Zetzsche, G.: Decidability, complexity, and expressiveness of first-order logic over the subword ordering. In: Proceedings of the LICS 2017, pp. 1–12. IEEE Computer Society (2017)Google Scholar
  14. 14.
    Hilbert, D.: Mathematische probleme. Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse 1900, 253–297 (1900)zbMATHGoogle Scholar
  15. 15.
    Jeż, A.: Recompression: a simple and powerful technique for word equations. In: Proceedings of the STACS 2013. LIPIcs, vol. 20, pp. 233–244 (2013)Google Scholar
  16. 16.
    Jeż, A.: Word equations in nondeterministic linear space. In: Proceedings of the ICALP 2017. LIPIcs, vol. 80, pp. 95:1–95:13 (2017)Google Scholar
  17. 17.
    Jiang, T., Salomaa, A., Salomaa, K., Yu, S.: Decision problems for patterns. J. Comput. Syst. Sci. 50(1), 53–63 (1995)MathSciNetCrossRefGoogle Scholar
  18. 18.
    Karhumäki, J., Mignosi, F., Plandowski, W.: The expressibility of languages and relations by word equations. J. ACM (JACM) 47(3), 483–505 (2000)MathSciNetCrossRefGoogle Scholar
  19. 19.
    Kiezun, A., Ganesh, V., Guo, P.J., Hooimeijer, P., Ernst, M.D.: HAMPI: a solver for string constraints. In: Proceedings of the ISSTA 2009, pp. 105–116. ACM (2009)Google Scholar
  20. 20.
    Lin, A.W., Barceló, P.: String solving with word equations and transducers: towards a logic for analysing mutation XSS. In: ACM SIGPLAN Notices. vol. 51, pp. 123–136. ACM (2016)Google Scholar
  21. 21.
    Lothaire, M.: Combinatorics on Words. Addison-Wesley, Boston (1983)zbMATHGoogle Scholar
  22. 22.
    Makanin, G.S.: The problem of solvability of equations in a free semigroup. Sb.: Math. 32(2), 129–198 (1977)MathSciNetzbMATHGoogle Scholar
  23. 23.
    Makanin, G.S.: Decidability of the universal and positive theories of a free group. Math. USSR-Izv. 25(1), 75 (1985)CrossRefGoogle Scholar
  24. 24.
    Manea, F., Nowotka, D., Schmid, M.L.: On the solvability problem for restricted classes of word equations. In: Brlek, S., Reutenauer, C. (eds.) DLT 2016. LNCS, vol. 9840, pp. 306–318. Springer, Heidelberg (2016). Scholar
  25. 25.
    Matiyasevich, Y.V.: A connection between systems of words-and-lengths equations and hilbert’s tenth problem. Zapiski Nauchnykh Seminarov POMI 8, 132–144 (1968)MathSciNetzbMATHGoogle Scholar
  26. 26.
    Papadimitriou, C.H.: On the complexity of integer programming. J. ACM (JACM) 28(4), 765–768 (1981)MathSciNetCrossRefGoogle Scholar
  27. 27.
    Plandowski, W.: Satisfiability of word equations with constants is in PSPACE. In: Proceedings of the FOCS 1999, pp. 495–500. IEEE (1999)Google Scholar
  28. 28.
    Quine, W.V.: Concatenation as a basis for arithmetic. J. Symb. Log. 11(4), 105–114 (1946)MathSciNetCrossRefGoogle Scholar
  29. 29.
    Trinh, M.-T., Chu, D.-H., Jaffar, J.: Progressive reasoning over recursively-defined strings. In: Chaudhuri, S., Farzan, A. (eds.) CAV 2016. LNCS, vol. 9779, pp. 218–240. Springer, Cham (2016). Scholar
  30. 30.
    Vazenin, J.M., Rozenblat, B.V.: Decidability of the positive theory of a free countably generated semigroup. Math. USSR Sb. 44(1), 109–116 (1983)CrossRefGoogle Scholar
  31. 31.
    Yu, F., Alkhalaf, M., Bultan, T.: Stranger: an automata-based string analysis tool for PHP. In: Esparza, J., Majumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015, pp. 154–157. Springer, Heidelberg (2010). Scholar
  32. 32.
    Zheng, Y., Ganesh, V., Subramanian, S., Tripp, O., Berzish, M., Dolby, J., Zhang, X.: Z3str2: an efficient solver for strings, regular expressions, and length constraints. Form. Methods Syst. Des. 50(2–3), 249–288 (2017)CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  • Joel D. Day
    • 1
    Email author
  • Vijay Ganesh
    • 2
  • Paul He
    • 2
  • Florin Manea
    • 1
  • Dirk Nowotka
    • 1
  1. 1.Kiel UniversityKielGermany
  2. 2.University of WaterlooWaterlooCanada

Personalised recommendations