The Average Transition Complexity of Glushkov and Partial Derivative Automata

  • Sabine Broda
  • António Machiavelo
  • Nelma Moreira
  • Rogério Reis
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6795)

Abstract

In this paper, the relation between the Glushkov automaton (\(\mathcal{A}_{\mathrm{pos}}\)) and the partial derivative automaton (\(\mathcal{A}_{\mathrm{pd}}\)) of a given regular expression, in terms of transition complexity, is studied. The average transition complexity of \(\mathcal{A}_{\mathrm{pos}}\) was proved by Nicaud to be linear in the size of the corresponding expression. This result was obtained using an upper bound of the number of transitions of \(\mathcal{A}_{\mathrm{pos}}\). Here we present a new quadratic construction of \(\mathcal{A}_{\mathrm{pos}}\) that leads to a more elegant and straightforward implementation, and that allows the exact counting of the number of transitions. Based on that, a better estimation of the average size is presented. Asymptotically, and as the alphabet size grows, the number of transitions per state is on average 2.

Broda et al. computed an upper bound for the ratio of the number of states of \(\mathcal{A}_{\mathrm{pd}}\) to the number of states of \(\mathcal{A}_{\mathrm{pos}}\), which is about \(\frac{1}{2}\) for large alphabet sizes. Here we show how to obtain an upper bound for the number of transitions in \(\mathcal{A}_{\mathrm{pd}}\), which we then use to get an average case approximation. Some experimental results are presented that illustrate the quality of our estimate.

References

  1. [Ant96]
    Antimirov, V.M.: Partial derivatives of regular expressions and finite automaton constructions. Theoret. Comput. Sci. 155(2), 291–319 (1996)MathSciNetCrossRefMATHGoogle Scholar
  2. [BK93]
    Brüggemann-Klein, A.: Regular expressions into finite automata. Theoret. Comput. Sci. 48, 197–213 (1993)MathSciNetCrossRefMATHGoogle Scholar
  3. [BMMR11a]
    Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On the average size of Glushkov and partial derivative automata. Technical Report DCC-2011-03, FCUP & CMUP, Universidade do Porto (April 2011)Google Scholar
  4. [BMMR11b]
    Broda, S., Machiavelo, A., Moreira, N., Reis, R.: On the average state complexity of partial derivative automata. International Journal of Foundations of Computer Science (2011) (accepted to publication)Google Scholar
  5. [Brz64]
    Brzozowski, J.A.: Derivatives of regular expressions. JACM 11(4), 481–494 (1964)MathSciNetCrossRefMATHGoogle Scholar
  6. [BS86]
    Berry, G., Sethi, R.: From regular expressions to deterministic automata. Theoret. Comput. Sci. 48, 117–126 (1986)MathSciNetCrossRefMATHGoogle Scholar
  7. [CP97]
    Chang, C.-H., Paige, R.: From regular expressions to DFA’s using compressed NFA’s. Theor. Comput. Sci. 178(1-2), 1–36 (1997)MathSciNetCrossRefMATHGoogle Scholar
  8. [CZ01]
    Champarnaud, J.M., Ziadi, D.: From Mirkin’s prebases to Antimirov’s word partial derivatives. Fundam. Inform. 45(3), 195–205 (2001)MathSciNetMATHGoogle Scholar
  9. [CZ02]
    Champarnaud, J.M., Ziadi, D.: Canonical derivatives, partial derivatives and finite automaton constructions. Theoret. Comput. Sci. 289, 137–163 (2002)MathSciNetCrossRefMATHGoogle Scholar
  10. [FS08]
    Flajolet, P., Sedgewick, R.: Analytic Combinatorics. Cambridge University Press, Cambridge (2008)MATHGoogle Scholar
  11. [Glu61]
    Glushkov, V.M.: The abstract theory of automata. Russian Math. Surveys 16, 1–53 (1961)MathSciNetCrossRefMATHGoogle Scholar
  12. [HK10]
    Holzer, M., Kutrib, M.: The complexity of regular(-like) expressions. In: Gao, Y., Lu, H., Seki, S., Yu, S. (eds.) DLT 2010. LNCS, vol. 6224, pp. 16–30. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  13. [Koz97]
    Kozen, D.C.: Automata and Computability. Springer, Heidelberg (1997)CrossRefMATHGoogle Scholar
  14. [Lei80]
    Leiss, E.: Constructing a finite automaton for a given regular expression. SIGACT News 12(3) (September 1980)Google Scholar
  15. [Mir66]
    Mirkin, B.G.: An algorithm for constructing a base in a language of regular expressions. Engineering Cybernetics 5, 51–57 (1966)Google Scholar
  16. [MY60]
    McNaughton, R., Yamada, H.: Regular expressions and state graphs for automata. IEEE Transactions on Electronic Computers 9, 39–47 (1960)CrossRefMATHGoogle Scholar
  17. [Nic09]
    Nicaud, C.: On the average size of glushkov’s automata. In: Dediu, A., Ionescu, A.M., Martín-Vide, C. (eds.) LATA 2009. LNCS, vol. 5457, pp. 626–637. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  18. [PZC97]
    Ponty, J.-L., Ziadi, D., Champarnaud, J.-M.: A new quadratic algorithm to convert a regular expression into an automaton. In: Raymond, D.R., Yu, S., Wood, D. (eds.) WIA 1996. LNCS, vol. 1260, pp. 109–119. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  19. [Sak09]
    Sakarovitch, J.: Elements of Automata Theory. CUP (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Sabine Broda
    • 1
  • António Machiavelo
    • 1
  • Nelma Moreira
    • 1
  • Rogério Reis
    • 1
  1. 1.CMUP, Faculdade de Ciências da Universidade do PortoPortoPortugal

Personalised recommendations