Abstract
This work presents a mechanically verified implementation of an algorithm for deciding regular expression (in-)equivalence within the Coq proof assistant. This algorithm decides regular expression equivalence through an iterated process of testing the equivalence of their partial derivatives and also does not construct the underlying automata. Our implementation has a refutation step that improves the general efficiency of the decision procedure by enforcing the in-equivalence of regular expressions at early stages of computation. Recent theoretical and experimental research provide evidence that this method is, on average, more efficient than the classical methods based in automata. We present some performance tests and comparisons with similar approaches.
This work was partially funded by the European Regional Development Fund through the programme COMPETE and by the Portuguese Government through the FCT under the projects PEst-OE/EEI/UI0027/2011, PEst-C/MAT/UI0144/2011, and CANTE-PTDC/EIA-CCO/101904/2008.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Filliâtre, J.C.: Finite Automata Theory in Coq: A constructive proof of Kleene’s theorem. Research Report 97–04, LIP - ENS Lyon (February 1997)
Kleene, S.: In: Shannon, C., McCarthy, J. (eds.) Representation of Events in Nerve Nets and Finite Automata, pp. 3–42. Princeton University Press
Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer (2004)
Höfner, P., Struth, G.: Automated Reasoning in Kleene Algebra. In: Pfenning, F. (ed.) CADE 2007. LNCS (LNAI), vol. 4603, pp. 279–294. Springer, Heidelberg (2007)
McCune, W.: Prover9 and Mace4, http://www.cs.unm.edu/smccune/mace4 (access date: October 1, 2011)
Moreira, N., Pereira, D.: KAT and PHL in Coq. CSIS 05 (02) (December 2008) ISSN: 1820-0214
Kozen, D.: Kleene algebra with tests. Transactions on Programming Languages and Systems 19(3), 427–443 (1997)
Almeida, J.B., Moreira, N., Pereira, D., Melo de Sousa, S.: Partial Derivative Automata Formalized in Coq. In: Domaratzki, M., Salomaa, K. (eds.) CIAA 2010. LNCS, vol. 6482, pp. 59–68. Springer, Heidelberg (2011)
Almeida, M., Moreira, N., Reis, R.: Antimirov and Mosses’s rewrite system revisited. Int. J. Found. Comput. Sci. 20(4), 669–684 (2009)
Antimirov, V.M., Mosses, P.D.: Rewriting extended regular expressions. In: Rozenberg, G., Salomaa, A. (eds.) DLT, pp. 195–209. World Scientific (1994)
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)
Almeida, M., Moreira, N., Reis, R.: Testing regular languages equivalence. JALC 15(1/2), 7–25 (2010)
Almeida, M.: Equivalence of regular languages: an algorithmic approach and complexity analysis. PhD thesis, FCUP (2011), http://www.dcc.fc.up.pt/~mfa/thesis.pdf
Broda, S., Machiavelo, A., Moreira, N., Reis, R.: The Average Transition Complexity of Glushkov and Partial Derivative Automata. In: Mauri, G., Leporati, A. (eds.) DLT 2011. LNCS, vol. 6795, pp. 93–104. Springer, Heidelberg (2011)
Braibant, T., Pous, D.: An Efficient Coq Tactic for Deciding Kleene Algebras. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 163–178. Springer, Heidelberg (2010)
Kozen, D.: A completeness theorem for Kleene algebras and the algebra of regular events. Infor. and Comput. 110(2), 366–390 (1994)
Coquand, T., Siles, V.: A Decision Procedure for Regular Expression Equivalence in Type Theory. In: Jouannaud, J.-P., Shao, Z. (eds.) CPP 2011. LNCS, vol. 7086, pp. 119–134. Springer, Heidelberg (2011)
Brzozowski, J.A.: Derivatives of regular expressions. JACM 11(4), 481–494 (1964)
Krauss, A., Nipkow, T.: Proof pearl: Regular expression equivalence and relation algebra. J. Autom. Reasoning 49(1), 95–106 (2012)
Rutten, J.J.M.M.: Automata and Coinduction (An Exercise in Coalgebra). In: Sangiorgi, D., de Simone, R. (eds.) CONCUR 1998. LNCS, vol. 1466, pp. 194–218. Springer, Heidelberg (1998)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)
Komendantsky, V.: Reflexive toolbox for regular expression matching: verification of functional programs in Coq+Ssreflect. In: Claessen, K., Swamy, N. (eds.) PLPV, pp. 61–70. ACM (2012)
Komendantsky, V.: Computable partial derivatives of regular expressions (2011), http://www.cs.st-andrews.ac.uk/~vk/papers.html (access date: July 1, 2011)
Mirkin, B.: An algorithm for constructing a base in a language of regular expressions. Engineering Cybernetics 5, 110–116 (1966)
Asperti, A.: A Compact Proof of Decidability for Regular Expression Equivalence. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 283–298. Springer, Heidelberg (2012)
Moreira, N., Pereira, D., Melo de Sousa, S.: Deciding KAT terms equivalence in Coq. Technical Report DCC-2012-04, DCC-FC & LIACC, Universidade do Porto (2012)
Hopcroft, J., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Languages and Computation. Addison Wesley (2000)
Champarnaud, J.M., Ziadi, D.: From Mirkin’s prebases to Antimirov’s word partial derivatives. Fundam. Inform. 45(3), 195–205 (2001)
Moreira, N., Pereira, D., Melo de Sousa, S.: Coq library: PDCoq (Version 1.1 2012), http://www.liacc.up.pt/~kat/pdcoq/
Paulin-Mohring, C.: Inductive Definitions in the System Coq: Rules and Properties. In: Bezem, M., Groote, J.F. (eds.) TLCA 1993. LNCS, vol. 664, pp. 328–345. Springer, Heidelberg (1993)
The Coq Development Team: The Coq proof assistant, http://coq.inria.fr
Lescuyer, S.: First-class containers in Coq. Studia Informatica Universalis 9, 87–127 (2011)
Barthe, G., Courtieu, P.: Efficient Reasoning about Executable Specifications in Coq. In: Carreño, V.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 31–46. Springer, Heidelberg (2002)
Almeida, A., Almeida, M., Alves, J., Moreira, N., Reis, R.: FAdo and GUItar: Tools for Automata Manipulation and Visualization. In: Maneth, S. (ed.) CIAA 2009. LNCS, vol. 5642, pp. 65–74. Springer, Heidelberg (2009)
Kozen, D.: On Hoare logic and Kleene algebra with tests. ACM Transactions on Computational Logic (TOCL) 1(1), 60–76 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Moreira, N., Pereira, D., Melo de Sousa, S. (2012). Deciding Regular Expressions (In-)Equivalence in Coq. In: Kahl, W., Griffin, T.G. (eds) Relational and Algebraic Methods in Computer Science. RAMICS 2012. Lecture Notes in Computer Science, vol 7560. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33314-9_7
Download citation
DOI: https://doi.org/10.1007/978-3-642-33314-9_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-33313-2
Online ISBN: 978-3-642-33314-9
eBook Packages: Computer ScienceComputer Science (R0)