Skip to main content

Matching Problem for Regular Expressions with Variables

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7829))

Abstract

The notion of a backreference in practical regular expressions is formalised giving rise to a novel notion of a regular expression with variables. So far the state-of-the-art in formal languages theory of practical regular expressions with backreferences was represented by an operational matching semantics of trees of valid matches. Since explicit tree data structures are required only in procedural languages where functional list combinators are not available, this provides an opportunity for functional programming to step in with a computationally and proof-theoretically more tangible definition of backreferences and their matching semantics. An operational notion of (NP-complete) exhaustive pattern matching is provided that relies on a fundamental construction of partial derivatives of regular expressions. Matching is proved sound and complete.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A.V.: Algorithms for finding patterns in strings. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. A: Algorithms and Complexity, pp. 255–300. The MIT Press (1990)

    Google Scholar 

  2. Almeida, J.B., Moreira, N., Pereira, D., de Sousa, S.M.: Partial derivative automata formalized in Coq. In: Domaratzki, M., Salomaa, K. (eds.) CIAA 2010. LNCS, vol. 6482, pp. 59–68. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  3. Antimirov, V.M.: Partial derivatives of regular expressions and finite automaton constructions. Theor. Comput. Sci. 155(2), 291–319 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  4. Bird, R., Wadler, P.: Introduction to Functional Programming. Prentice Hall (1988)

    Google Scholar 

  5. Campeanu, C., Salomaa, K., Yu, S.: A formal study of practical regular expressions. International Journal of Foundations of Computer Science 14, 1007–1018 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  6. Carle, B., Narendran, P.: On extended regular expressions. In: Dediu, A.H., Ionescu, A.M., Martín-Vide, C. (eds.) LATA 2009. LNCS, vol. 5457, pp. 279–289. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  7. Castiglione, G., Restivo, A., Salemi, S.: Patterns in words and languages. Discrete Appl. Math. 144(3), 237–246 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  8. Champarnaud, J.-M., Ziadi, D.: Canonical derivatives, partial derivatives and finite automaton constructions. Theor. Comput. Sci. 289(1), 137–163 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  9. Gonthier, G., Mahboubi, A., Tassi, E.: A Small Scale Reflection Extension for the Coq system. Research Report RR-6455, INRIA (2011)

    Google Scholar 

  10. Komendantsky, V.: Formal proofs of the prebase theorem of Mirkin (2011), Coq script available at, http://www.cs.st-andrews.ac.uk/~vk/doc/prebase.v

  11. Komendantsky, V.: Coq and Haskell sources of the decision procedure for regular expression matching with variables (2012), https://bitbucket.org/vkomenda/vmatch

  12. Komendantsky, V.: Reflexive toolbox for regular expression matching: Verification of functional programs in Coq+Ssreflect. In: The 6th ACM SIGPLAN Workshop Programming Languages meet Program Verification, PLPV 2012, Philadelphia, USA (January 24, 2012), For contributed proofs, see [10]

    Google Scholar 

  13. Kozen, D.: A completeness theorem for Kleene algebras and the algebra of regular events. Infor. and Comput. 110(2), 366–390 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  14. Kuklewicz, C.: The regex-posix package (2012), http://hackage.haskell.org/package/regex-posix/

  15. Laurikari, V.: NFAs with tagged transitions, their conversion to deterministic automata and application to regular expressions. In: SPIRE 2000, pp. 181–187 (2000)

    Google Scholar 

  16. Lu, K.Z.M., Sulzmann, M.: A library implementation of XHaskell (2010), http://code.google.com/p/xhaskell-library

  17. Lu, K.Z.M., Sulzmann, M.: The regex-pderiv package (2012), http://hackage.haskell.org/package/regex-pderiv

  18. McIlroy, M.D.: Enumerating the strings of regular languages. Journal of Functional Programming 14, 503–518 (2004)

    Article  MATH  Google Scholar 

  19. Mirkin, B.G.: New algorithm for construction of base in the language of regular expressions. Tekhnicheskaya Kibernetika 5, 113–119 (1966); English translation in Engineering Cybernetics (5), 110-116 (September-October 1966)

    Google Scholar 

  20. Reidenbach, D., Schmid, M.L.: A polynomial time match test for large classes of extended regular expressions. In: Domaratzki, M., Salomaa, K. (eds.) CIAA 2010. LNCS, vol. 6482, pp. 241–250. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  21. Sulzmann, M., Lu, K.Z.M.: XHaskell – adding regular expression type to Haskell. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 75–92. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  22. Yu, S.: Regular languages. In: Rozenberg, G., Salomaa, A. (eds.) Handbook of Formal Languages, vol. 1, Word, language, grammar, pp. 41–110. Springer (1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Komendantsky, V. (2013). Matching Problem for Regular Expressions with Variables. In: Loidl, HW., Peña, R. (eds) Trends in Functional Programming. TFP 2012. Lecture Notes in Computer Science, vol 7829. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40447-4_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40447-4_10

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40446-7

  • Online ISBN: 978-3-642-40447-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics