Skip to main content

Manipulation of Regular Expressions Using Derivatives: An Overview

  • Conference paper
  • First Online:
Implementation and Application of Automata (CIAA 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13266))

Included in the following conference series:

  • 321 Accesses

Abstract

The notions of derivative and partial derivative of regular expressions revealed themselves to be very powerful and have been successfully extended to many other formal language classes and algebraic structures. Although the undisputed elegance of this formalism, its efficient practical use is still a challenging research topic. Here we give a brief historical overview and summarise some of these aspects.

Research supported by CMUP through FCT project UIDB/00144/2021.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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

Institutional subscriptions

Notes

  1. 1.

    The necessity of these equalities was pointed out by Salomaa [72].

References

  1. Adams, M.D., Hollenbeck, C., Might, M.: On the complexity and performance of parsing with derivatives. In: Krintz, C., Berger, E. (eds.) Proceedings 37th ACM SIGPLAN PLDI, pp. 224–236. ACM (2016). https://doi.org/10.1145/2908080.2908128

  2. Almeida, M., Moreira, N., Reis, R.: Antimirov and Mosses’ rewrite system revisited. Int. J. Found. Comput. Sci. 20(4), 669–684 (2009). https://doi.org/10.1142/S0129054109006802

    Article  MATH  Google Scholar 

  3. Almeida, M., Moreira, N., Reis, R.: Testing equivalence of regular languages. J. Autom. Lang. Comb. 15(1/2), 7–25 (2010). https://doi.org/10.25596/jalc-2010-007

  4. Antimirov, V.M.: Partial derivatives of regular expressions and finite automaton constructions. Theoret. Comput. Sci. 155(2), 291–319 (1996). https://doi.org/10.1016/0304-3975(95)00182-4

    Article  MathSciNet  MATH  Google Scholar 

  5. Antimirov, V.M., Mosses, P.: Rewriting extended regular expressions. In: Rozenberg, G., Salomaa, A. (eds.) Developments in Language Theory, pp. 195–209. World Scientific (1994)

    Google Scholar 

  6. Asperti, A., Coen, C.S., Tassi, E.: Regular expressions, au point. CoRR abs/1010.2604 (2010). http://arxiv.org/abs/1010.2604

  7. Câmpeanu, C., Manea, F., Shallit, J. (eds.): DCFS 2016. LNCS, vol. 9777. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41114-9

    Book  MATH  Google Scholar 

  8. Bastos, R., Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On the average complexity of partial derivative automata for semi-extended expressions. J. Autom. Lang. Comb. 22(1–3), 5–28 (2017). https://doi.org/10.25596/jalc-2017-005

  9. Berry, G., Sethi, R.: From regular expressions to deterministic automata. Theoret. Comput. Sci. 48, 117–126 (1986)

    Article  MathSciNet  Google Scholar 

  10. Bonchi, F., Pous, D.: Checking NFA equivalence with bisimulations up to congruence. In: Giacobazzi, R., Cousot, R. (eds.) Proceedings 40th POPL 2013, pp. 457–468. ACM (2013). https://doi.org/10.1145/2429069.2429124

  11. Broda, S., Holzer, M., Maia, E., Moreira, N., Reis, R.: A mesh of automata. Inf. Comput. 265, 94–111 (2019). https://doi.org/10.1016/j.ic.2019.01.003

    Article  MathSciNet  MATH  Google Scholar 

  12. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On the average state complexity of partial derivative automata: an analytic combinatorics approach. Int. J. Found. Comput. Sci. 22(7), 1593–1606 (2011). https://doi.org/10.1142/S012905

    Article  MathSciNet  MATH  Google Scholar 

  13. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On the average size of Glushkov and partial derivative automata. Int. J. Found. Comput. Sci. 23(5), 969–984 (2012). https://doi.org/10.1142/S0129054112400400

    Article  MathSciNet  MATH  Google Scholar 

  14. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: Average size of automata constructions from regular expressions. Bull. Eur. Assoc. Theor. Comput. Sci. 116, 167–192 (2015). http://bulletin.eatcs.org/index.php/beatcs/article/view/352/334

  15. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: Position automaton construction for regular expressions with intersection. In: Brlek, S., Reutenauer, C. (eds.) DLT 2016. LNCS, vol. 9840, pp. 51–63. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53132-7_5

    Chapter  Google Scholar 

  16. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: Automata for regular expressions with shuffle. Inf. Comput. 259(2), 162–173 (2018). https://doi.org/10.1016/j.ic.2017.08.013

    Article  MathSciNet  MATH  Google Scholar 

  17. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: Analytic combinatorics and descriptional complexity of regular languages on average. ACM SIGACT News 51(1), 38–56 (2020)

    Article  MathSciNet  Google Scholar 

  18. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: Location based automata for expressions with shuffle. In: Leporati, A., Martín-Vide, C., Shapira, D., Zandron, C. (eds.) LATA 2021. LNCS, vol. 12638, pp. 43–54. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-68195-1_4

    Chapter  MATH  Google Scholar 

  19. Broda, S., Maia, E., Moreira, N., Reis, R.: The prefix automaton. J. Autom. Lang. Comb. 26(1–2), 17–53 (2021). https://doi.org/10.25596/jalc-2021-017

  20. Brüggemann-Klein, A.: Regular expressions into finite automata. Theoret. Comput. Sci. 48, 197–213 (1993)

    Article  MathSciNet  Google Scholar 

  21. Brzozowski, Jr. J.A., McCluskey, E.J.: Signal flow graph techniques for sequential circuit state diagrams. IEEE Trans. Electron. Comput. EC-12(2), 67–76 (1963)

    Google Scholar 

  22. Brzozowski, J.: Regular expression techniques for sequential circuits. Ph.D. thesis, Department of Electrical Engineering, Princeton University (1962)

    Google Scholar 

  23. Brzozowski, J.A.: Quotient complexity of regular languages 15(1/2), 71–89 (2010). https://doi.org/10.25596/jalc-2010-071

  24. Brzozowski, J.A., Leiss, E.L.: On equations for regular languages, finite automata, and sequential networks. Theor. Comput. Sci. 10, 19–35 (1980). https://doi.org/10.1016/0304-3975(80)90069-9

    Article  MathSciNet  MATH  Google Scholar 

  25. Brzozowski, J.: Derivatives of regular expressions. J. ACM 11(4), 481–494 (1964). https://doi.org/10.1145/321239.321249

    Article  MathSciNet  MATH  Google Scholar 

  26. Cardoso, E.M., Amaro, M., da Silva Feitosa, S., dos Santos Reis, L.V., Bois, A.R.D., Ribeiro, R.G.: The design of a verified derivative-based parsing tool for regular expressions. CLEI Electron. J. 24(3) (2021). https://doi.org/10.19153/cleiej.24.3.2

  27. Champarnaud, J.M., Ziadi, D.: From Mirkin’s prebases to Antimirov’s word partial derivatives. Fundam. Inform. 45(3), 195–205 (2001)

    MathSciNet  MATH  Google Scholar 

  28. Champarnaud, J.M., Ziadi, D.: Canonical derivatives, partial derivatives and finite automaton constructions. Theoret. Comput. Sci. 289, 137–163 (2002). https://doi.org/10.1016/S0304-3975(01)00267-5

    Article  MathSciNet  MATH  Google Scholar 

  29. Champarnaud, J.-M., Ouardi, F., Ziadi, D.: An efficient computation of the equation \(\mathbb{K}\)-automaton of a regular \(\mathbb{K}\)-expression. In: Harju, T., Karhumäki, J., Lepistö, A. (eds.) DLT 2007. LNCS, vol. 4588, pp. 145–156. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73208-2_16

    Chapter  Google Scholar 

  30. Champarnaud, J., Ponty, J., Ziadi, D.: From regular expressions to finite automata. Int. J. Comput. Math. 72(4), 415–431 (1999). https://doi.org/10.1080/00207169908804865

    Article  MathSciNet  MATH  Google Scholar 

  31. Champarnaud, J., Ziadi, D.: From C-continuations to new quadratic algorithms for automaton synthesis. Int. J. Alg. Comput. 11(6), 707–736 (2001)

    Article  MathSciNet  Google Scholar 

  32. Chang, C., Paige, R.: From regular expressions to DFA’s using compressed NFA’s. Theor. Comput. Sci. 178(1–2), 1–36 (1997). https://doi.org/10.1016/S0304-3975(96)00140-5

    Article  MathSciNet  MATH  Google Scholar 

  33. Conway, J.H.: Regular Algebra and Finite Machines. Chapman and Hall, London (1971)

    MATH  Google Scholar 

  34. Demaille, A.: Derived-term automata of multitape rational expressions. In: Han, Y.-S., Salomaa, K. (eds.) CIAA 2016. LNCS, vol. 9705, pp. 51–63. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40946-7_5

    Chapter  MATH  Google Scholar 

  35. Flajolet, P., Sipala, P., Steyaert, J.-M.: Analytic variations on the common subexpression problem. In: Paterson, M.S. (ed.) ICALP 1990. LNCS, vol. 443, pp. 220–234. Springer, Heidelberg (1990). https://doi.org/10.1007/BFb0032034

    Chapter  Google Scholar 

  36. Ginzburg, A.: A procedure for checking equality of regular expressions. J. ACM 14(2), 355–362 (1967). https://doi.org/10.1145/321386.321399

    Article  MATH  Google Scholar 

  37. Glushkov, V.M.: The abstract theory of automata. Russ. Math. Surv. 16, 1–53 (1961)

    Article  MathSciNet  Google Scholar 

  38. Gruber, H., Gulan, S.: Simplifying regular expressions. In: Dediu, A.-H., Fernau, H., Martín-Vide, C. (eds.) LATA 2010. LNCS, vol. 6031, pp. 285–296. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13089-2_24

    Chapter  Google Scholar 

  39. Gruber, H., Holzer, M.: From finite automata to regular expressions and back–a summary on descriptional complexity. Int. J. Found. Comput. Sci. 26(8), 1009–1040 (2015). https://doi.org/10.1142/S0129054115400110

    Article  MathSciNet  MATH  Google Scholar 

  40. Holzer, M., Kutrib, M.: The complexity of regular(-like) expressions. Int. J. Found. Comput. Sci. 22(7), 1533–1548 (2011)

    Google Scholar 

  41. Hopcroft, J., Karp, R.M.: A linear algorithm for testing equivalence of finite automata. Technical report, TR 71–114, University of California, Berkeley, California (1971)

    Google Scholar 

  42. Kappé, T., Brunet, P., Luttik, B., Silva, A., Zanasi, F.: Brzozowski goes concurrent - a Kleene theorem for pomset languages. In: Meyer, R., Nestmann, U. (eds.) Proceedings 28th CONCUR 2017. LIPIcs, vol. 85, pp. 25:1–25:16. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2017). https://doi.org/10.4230/LIPIcs.CONCUR.2017.25

  43. Khorsi, A., Ouardi, F., Ziadi, D.: Fast equation automaton computation. J. Discrete Algorithms 6(3), 433–448 (2008). https://doi.org/10.1016/j.jda.2007.10.003

    Article  MathSciNet  MATH  Google Scholar 

  44. Kleene, S.C.: Representation of events in nerve nets and finite automata. In: Shannon, C.E., McCarthy, J. (eds.) Automata Studies, pp. 3–41. Princeton University Press, Princeton (1956)

    Google Scholar 

  45. Konstantinidis, S., Machiavelo, A., Moreira, N., Reis, R.: Partial derivative automaton by compressing regular expressions. In: Yan, Y., Ko, S. (eds.) Proceedings 23rd DCFS 2021. LNCS, vol. 13037, pp. 100–112. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-93489-7_9

  46. Konstantinidis, S., Machiavelo, A., Moreira, N., Reis, R.: On the size of partial derivatives and the word membership problem. Acta Informatica 58(4), 357–375 (2021). https://doi.org/10.1007/s00236-021-00399-6

    Article  MathSciNet  MATH  Google Scholar 

  47. Konstantinidis, S., Moreira, N., Reis, R.: Partial derivatives of regular expressions over alphabet-invariant and user-defined labels. Theor. Comput. Sci. 870, 103–120 (2021). https://doi.org/10.1016/j.tcs.2020.12.029

    Article  MathSciNet  MATH  Google Scholar 

  48. Krob, D.: Differentiation of K-rational expressions. Int. J. Algebra Comput. 2(1), 57–88 (1992). https://doi.org/10.1142/S0218196792000062

    Article  MathSciNet  MATH  Google Scholar 

  49. Leiss, E.L.: The complexity of restricted regular expressions and the synthesis problem for finite automata. J. Comput. Syst. Sci. 23(3), 348–354 (1981). https://doi.org/10.1016/0022-0000(81)90070-2

    Article  MathSciNet  MATH  Google Scholar 

  50. Lombardy, S., Sakarovitch, J.: Derivatives of rational expressions with multiplicity. Theor. Comput. Sci. 332(1–3), 141–177 (2005). https://doi.org/10.1016/j.tcs.2004.10.016

    Article  MathSciNet  MATH  Google Scholar 

  51. Lombardy, S., Sakarovitch, J.: Derived terms without derivation a shifted perspective on the derived-term automaton. J. Comput. Sci. Cybern. 37(3), 201–221 (2021). https://doi.org/10.15625/1813-9663/37/3/16263

  52. McCulloch, W., Pitts, W.: A logical calculus of the ideas immanent in nervous activity. Bull. Math. Biophisics 5, 115–133 (1943)

    Article  MathSciNet  Google Scholar 

  53. McNaughton, R., Yamada, H.: Regular expressions and state graphs for automata. IEEE Trans. Electron. Comput. 9, 39–47 (1960)

    Article  Google Scholar 

  54. Mignot, L.: A unified implementation of automata and expression structures, and of the associated algorithms using enriched categories. CoRR abs/2012.10641 (2020). https://arxiv.org/abs/2012.10641

  55. Mignot, L., Sebti, N.O., Ziadi, D.: Tree automata constructions from regular expressions: a comparative study. Fundam. Informaticae 156(1), 69–94 (2017). https://doi.org/10.3233/FI-2017-1598

    Article  MathSciNet  MATH  Google Scholar 

  56. Mignot, L., Sebti, N.O., Ziadi, D.: An efficient algorithm for the construction of the equation tree automaton. Int. J. Found. Comput. Sci. 29(6), 951–978 (2018). https://doi.org/10.1142/S0129054118500156

    Article  MathSciNet  MATH  Google Scholar 

  57. Mirkin, B.G.: An algorithm for constructing a base in a language of regular expressions. Eng. Cybern. 5, 51–57 (1966)

    Google Scholar 

  58. Mizoguchi, Y., Ohtsuka, H., Kawahara, Y.: Symbolic calculus of regular expressions. Bull. Inf. Cybern. 22(3–4), 165–170 (1987)

    MathSciNet  MATH  Google Scholar 

  59. Moreira, N., Pereira, D., de Sousa, S.M.: Deciding Kleene algebra terms (in)equivalence in Coq. J. Logical Algebraic Methods Program. 84(3), 377–401 (2015). https://doi.org/10.1016/j.jlamp.2014.12.004

    Article  MathSciNet  MATH  Google Scholar 

  60. Moss, A.: Simplified parsing expression derivatives. In: Leporati, A., Martín-Vide, C., Shapira, D., Zandron, C. (eds.) LATA 2020. LNCS, vol. 12038, pp. 425–436. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-40608-0_30

    Chapter  Google Scholar 

  61. Myhill, J.: Finite automata and representation of events. In: Fundamental Concepts in the Theory of Systems, vol. 57. Wright Air Development Center (1957)

    Google Scholar 

  62. Nerode, A.: Linear automaton transformations. Proc. Am. Math. Soc. 9, 541–544 (1958)

    Google Scholar 

  63. Nicaud, C.: On the average size of Glushkov’s automata. In: Dediu, A.H., Ionescu, A.M., Martín-Vide, C. (eds.) LATA 2009. LNCS, vol. 5457, pp. 626–637. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00982-2_53

    Chapter  MATH  Google Scholar 

  64. Nipkow, T., Traytel, D.: Unified decision procedures for regular expression equivalence. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS, vol. 8558, pp. 450–466. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08970-6_29

    Chapter  Google Scholar 

  65. Ouardi, F., Lotfi, Z., Elghadyry, B.: Efficient construction of the equation automaton. Algorithms 14(8), 238 (2021). https://doi.org/10.3390/a14080238

    Article  Google Scholar 

  66. Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM J. Comput. 16(6), 973–989 (1987). https://doi.org/10.1137/0216062

    Article  MathSciNet  MATH  Google Scholar 

  67. Ponty, J.-L., Ziadi, D., Champarnaud, J.-M.: A new quadratic algorithm to convert a regular expression into an automaton. In: Raymond, D., Wood, D., Yu, S. (eds.) WIA 1996. LNCS, vol. 1260, pp. 109–119. Springer, Heidelberg (1997). https://doi.org/10.1007/3-540-63174-7_9

    Chapter  Google Scholar 

  68. Revuz, D.: Minimisation of acyclic deterministic automata in linear time. Theoret. Comput. Sci. 92(1), 181–189 (1992)

    Article  MathSciNet  Google Scholar 

  69. Rutten, J.: Behavioural differential equations: a coinductive calculus of streams, automata, and power series. Theoret. Comput. Sci. 208(1–3), 1–53 (2003). https://doi.org/10.1016/S0304-3975(02)00895-2

    Article  MathSciNet  MATH  Google Scholar 

  70. Sakarovitch, J.: Elements of Automata Theory. Cambridge University Press (2009). https://doi.org/10.1017/CBO9781139195218

  71. Sakarovitch, J.: Automata and rational expressions. In: Pin, J. (ed.) Handbook of Automata Theory, pp. 39–78. European Mathematical Society Publishing House, Zürich (2021). https://doi.org/10.4171/Automata-1/2

  72. Salomaa, A.: Two complete axiom systems for the algebra of regular events. J. Assoc. Comput. Mach. 13(1), 158–169 (1966)

    Article  MathSciNet  Google Scholar 

  73. Silva, A., Bonchi, F., Bonsangue, M.M., Rutten, J.J.M.M.: Quantitative Kleene coalgebras. Inf. Comput. 209(5), 822–849 (2011). https://doi.org/10.1016/j.ic.2010.09.007

    Article  MathSciNet  MATH  Google Scholar 

  74. Sulzmann, M., Lu, K.Z.M.: Regular expression sub-matching using partial derivatives. In: Schreye, D.D., Janssens, G., King, A. (eds.) Proceedings PPDP 2012, pp. 79–90. ACM (2012). https://doi.org/10.1145/2370776.2370788

  75. Sulzmann, M., Thiemann, P.: Derivatives and partial derivatives for regular shuffle expressions. J. Comput. Syst. Sci. 104, 323–341 (2019). https://doi.org/10.1016/j.jcss.2016.11.010

    Article  MathSciNet  MATH  Google Scholar 

  76. Thiemann, P.: Partial derivatives for context-free languages. In: Esparza, J., Murawski, A.S. (eds.) FoSSaCS 2017. LNCS, vol. 10203, pp. 248–264. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54458-7_15

    Chapter  Google Scholar 

  77. Thompson, K.: Regular expression search algorithm. Commun. ACM 11(6), 410–422 (1968)

    Article  Google Scholar 

  78. Yamamoto, H.: A new finite automaton construction for regular expressions. In: Bensch, S., Freund, R., Otto, F. (eds.) 6th NCMA. books@ocg.at, vol. 304, pp. 249–264. Österreichische Computer Gesellschaft (2014)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nelma Moreira .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Moreira, N., Reis, R. (2022). Manipulation of Regular Expressions Using Derivatives: An Overview. In: Caron, P., Mignot, L. (eds) Implementation and Application of Automata. CIAA 2022. Lecture Notes in Computer Science, vol 13266. Springer, Cham. https://doi.org/10.1007/978-3-031-07469-1_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-07469-1_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-07468-4

  • Online ISBN: 978-3-031-07469-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics