On Matching Generalised Repetitive Patterns

  • Joel D. Day
  • Pamela Fleischmann
  • Florin Manea
  • Dirk Nowotka
  • Markus L. Schmid
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11088)


A pattern is a string with terminals and variables (which can be uniformly replaced by terminal words). Given a class \(\mathcal {C}\) of patterns (with variables), we say a pattern \(\alpha \) is a \(\mathcal {C}\)-(pseudo-)repetition if its skeleton – the result of removing all terminal symbols to leave only the variables – is a (pseudo-)repetition of a pattern from \(\mathcal {C}\). We introduce a large class of patterns which generalises several known classes such as the k-local and bounded scope coincidence degree patterns, and show that for this class, \( \mathcal {C}\)-(pseudo-)repetitions can be matched in polynomial time. We also show that for most classes \(\mathcal {C}\), the class of \(\mathcal {C}\)-(pseudo-)repetitions does not have bounded treewidth. Finally, we show that if the notion of repetition is relaxed, so that in each occurrence the variables may occur in a different order, the matching problem is NP-complete, even in severely restricted cases.


Pattern matching with variables Repetitions 


  1. 1.
    Amir, A., Nor, I.: Generalized function matching. J. Discrete Algorithms 5, 514–523 (2007)MathSciNetCrossRefGoogle Scholar
  2. 2.
    Angluin, D.: Finding patterns common to a set of strings. J. Comput. Syst. Sci. 21, 46–62 (1980)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Barceló, P., Libkin, L., Lin, A.W., Wood, P.T.: Expressive languages for path queries over graph-structured data. ACM Trans. Database Syst. 37, 31 (2012)CrossRefGoogle Scholar
  4. 4.
    Câmpeanu, C., Salomaa, K., Yu, S.: A formal study of practical regular expressions. Int. J. Found. Comput. Sci. 14, 1007–1018 (2003)MathSciNetCrossRefGoogle Scholar
  5. 5.
    Day, J.D., Fleischmann, P., Manea, F., Nowotka, D.: Local patterns. In: Proceedings of 37th FSTTCS, Volume 93 of LIPIcs, pp. 24:1–24:14 (2017)Google Scholar
  6. 6.
    Erlebach, T., Rossmanith, P., Stadtherr, H., Steger, A., Zeugmann, T.: Learning one-variable pattern languages very efficiently on average, in parallel, and by asking queries. Theor. Comput. Sci. 261, 119–156 (2001)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Fernau, H., Manea, F., Mercaş, R., Schmid, M.L.: Pattern matching with variables: fast algorithms and new hardness results. In: Proceedings of 32nd STACS, Volume 30 of LIPIcs, pp. 302–315 (2015)Google Scholar
  8. 8.
    Fernau, H., Schmid, M.L.: Pattern matching with variables: a multivariate complexity analysis. In: Fischer, J., Sanders, P. (eds.) CPM 2013. LNCS, vol. 7922, pp. 83–94. Springer, Heidelberg (2013). Scholar
  9. 9.
    Fernau, H., Schmid, M.L.: Pattern matching with variables: a multivariate complexity analysis. Inf. Comput. 242, 287–305 (2015)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Fernau, H., Schmid, M.L., Villanger, Y.: On the parameterised complexity of string morphism problems. Theory Comput. Syst. 59(1), 24–51 (2016)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Freydenberger, D.D.: Extended regular expressions: succinctness and decidability. Theory Comput. Syst. 53, 159–193 (2013)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Friedl, J.E.F.: Mastering Regular Expressions, 3rd edn. O’Reilly, Sebastopol (2006)Google Scholar
  13. 13.
    Gawrychowski, P., Tomohiro, I., Inenaga, S., Köppl, D., Manea, F.: Tighter bounds and optimal algorithms for all maximal \(\alpha \)-gapped repeats and palindromes. Theory Comput. Syst. 62(1), 162–191 (2018)MathSciNetCrossRefGoogle Scholar
  14. 14.
    Gawrychowski, P., Manea, F., Nowotka, D.: Testing generalised freeness of words. In: Proceedings of 31st STACS, Volume 25 of LIPIcs, pp. 337–349 (2014)Google Scholar
  15. 15.
    Karhumäki, J., Plandowski, W., Mignosi, F.: The expressibility of languages and relations by word equations. J. ACM 47, 483–505 (2000)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Kearns, M., Pitt, L.: A polynomial-time algorithm for learning \(k\)-variable pattern languages from examples. In: Proceedings of 2nd COLT, pp. 57–71 (1989)Google Scholar
  17. 17.
    Lothaire, M.: Combinatorics on Words. Cambridge University Press, Cambridge (1997)CrossRefGoogle Scholar
  18. 18.
    Manea, F., Müller, M., Nowotka, D., Seki, S.: The extended equation of Lyndon and Schützenberger. J. Comput. Syst. Sci. 85, 132–167 (2017)CrossRefGoogle Scholar
  19. 19.
    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
  20. 20.
    Mateescu, A., Salomaa, A.: Finite degrees of ambiguity in pattern languages. RAIRO Informatique Théoretique et Appl. 28, 233–253 (1994)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Ng, Y.K., Shinohara, T.: Developments from enquiries into the learnability of the pattern languages from positive data. Theor. Comput. Sci. 397, 150–165 (2008)MathSciNetCrossRefGoogle Scholar
  22. 22.
    Ordyniak, S., Popa, A.: A parameterized study of maximum generalized pattern matching problems. In: Cygan, M., Heggernes, P. (eds.) IPEC 2014. LNCS, vol. 8894, pp. 270–281. Springer, Cham (2014). Scholar
  23. 23.
    Reidenbach, D.: Discontinuities in pattern inference. Theor. Comput. Sci. 397, 166–193 (2008)MathSciNetCrossRefGoogle Scholar
  24. 24.
    Reidenbach, D., Schmid, M.L.: Patterns with bounded treewidth. Inf. Comput. 239, 87–99 (2014)MathSciNetCrossRefGoogle Scholar
  25. 25.
    Shinohara, T.: Polynomial time inference of pattern languages and its application. In: Proceedings of 7th IBM MFCS, pp. 191–209 (1982)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  • Joel D. Day
    • 1
  • Pamela Fleischmann
    • 1
  • Florin Manea
    • 1
  • Dirk Nowotka
    • 1
  • Markus L. Schmid
    • 2
  1. 1.Kiel UniversityKielGermany
  2. 2.Trier UniversityTrierGermany

Personalised recommendations