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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Antimirov, V.M.: Partial derivatives of regular expressions and finite automaton constructions. Theoret. Comput. Sci. 155(2), 291–319 (1996)
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
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
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
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
Brüggemann-Klein, A.: Regular expressions into finite automata. Theoret. Comput. Sci. 48, 197–213 (1993)
Champarnaud, J.M., Ziadi, D.: Canonical derivatives, partial derivatives and finite automaton constructions. Theoret. Comput. Sci. 289, 137–163 (2002)
Champarnaud, J., Ziadi, D.: From c-continuations to new quadratic algorithms for automaton synthesis. Int. J. Algor. Comput. 11(6), 707–736 (2001)
Cochran, W.G.: Sampling Techniques, 3rd edn., John Wiley and Sons, New York (1977)
Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. CUP, Cambridge (2007)
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
Flajolet, P., Sedgewick, R.: Analytic Combinatorics. CUP, Cambridge (2008)
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
Gruber, H., Gulan, S.: Simplifying regular expressions: a quantitative perspective. Tech. rep, IFIG Research Report (2009)
Hille, E.: Analytic Function Theory, vol. 2. Blaisdell Publishing Company, New York (1962)
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
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
Mirkin, B.G.: An algorithm for constructing a base in a language of regular expressions. Eng. Cybernet. 5, 51–57 (1966)
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 IFIP International Federation for Information Processing
About this paper
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)