Skip to main content

Partial Derivative Automaton by Compressing Regular Expressions

  • Conference paper
  • First Online:

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

Abstract

The partial derivative automaton (\(\mathcal {A}_{{{\,\mathrm{\mathsf {PD}}\,}}}\)) is an elegant simulation of a regular expression. Although it is, in general, smaller than the position automaton (\(\mathcal {A}_{{{\,\mathrm{\mathsf {POS}}\,}}}\)), the algorithms that build \(\mathcal {A}_{{{\,\mathrm{\mathsf {PD}}\,}}}\) in quadratic worst-case time, first compute \(\mathcal {A}_{{{\,\mathrm{\mathsf {POS}}\,}}}\). Asymptotically, and on average for the uniform distribution, the size of \(\mathcal {A}_{{{\,\mathrm{\mathsf {PD}}\,}}}\) is half the size of \(\mathcal {A}_{{{\,\mathrm{\mathsf {POS}}\,}}}\), being both linear on the size of the expression. We address the construction of \(\mathcal {A}_{{{\,\mathrm{\mathsf {PD}}\,}}}\) efficiently, on average, avoiding the computation of \(\mathcal {A}_{{{\,\mathrm{\mathsf {POS}}\,}}}\). The expression and the set of its partial derivatives are represented by a directed acyclic graph with shared common subexpressions. We develop an algorithm for building \(\mathcal {A}_{{{\,\mathrm{\mathsf {PD}}\,}}}\)’s from expressions in strong star normal form of size n that runs in time \(O\big (n^{3/2}\,\root 4 \of {\log (n)}\,\big )\) and space \(O\big (n^{3/2}/(\log n)^{3/4}\,\big )\), on average. Empirical results corroborate its good practical performance.

Research supported by NSERC (Canada) and by CMUP through FCT project UIDB/00144/2020.

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

References

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

    Article  MathSciNet  Google Scholar 

  2. 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/S0129054111008908

    Article  MathSciNet  MATH  Google Scholar 

  3. 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 

  4. Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On average behaviour of regular expressions in strong star normal form. Int. J. Found. Comput. Sci. 30(6–7), 899–920 (2019). https://doi.org/10.1142/S0129054119400227

    Article  MathSciNet  MATH  Google Scholar 

  5. 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). https://doi.org/10.1145/3388392.3388400

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  9. Cochran, W.G.: Sampling Techniques, 3rd edn., John Wiley and Sons, New York (1977)

    Google Scholar 

  10. Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. CUP, Cambridge (2007)

    Google Scholar 

  11. Downey, P.J., Sethi, R., Tarjan, R.E.: Variations on the common subexpression problem. J. ACM 27(4), 758–771 (1980). https://doi.org/10.1145/322217.322228

    Article  MathSciNet  MATH  Google Scholar 

  12. Flajolet, P., Sedgewick, R.: Analytic Combinatorics. CUP, Cambridge (2008)

    Google Scholar 

  13. 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 

  14. Gruber, H., Gulan, S.: Simplifying regular expressions: a quantitative perspective. Tech. rep, IFIG Research Report (2009)

    MATH  Google Scholar 

  15. Hille, E.: Analytic Function Theory, vol. 2. Blaisdell Publishing Company, New York (1962)

    Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

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

    Google Scholar 

  19. 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 

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

© 2021 IFIP International Federation for Information Processing

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Konstantinidis, S., Machiavelo, A., Moreira, N., Reis, R. (2021). Partial Derivative Automaton by Compressing Regular Expressions. In: Han, YS., Ko, SK. (eds) Descriptional Complexity of Formal Systems. DCFS 2021. Lecture Notes in Computer Science(), vol 13037. Springer, Cham. https://doi.org/10.1007/978-3-030-93489-7_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-93489-7_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-93488-0

  • Online ISBN: 978-3-030-93489-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics