Abstract
We describe and formally verify a procedure to decide regular expressions equivalence: two regular expressions are equivalent if and only if they recognize the same language. Our approach to this problem is inspired by Brzozowski’s algorithm using derivatives of regular expressions, with a new definition of finite sets. In this paper, we detail a complete formalization of Brzozowki’s derivatives, a new definition of finite sets along with its basic meta-theory, and a decidable equivalence procedure correctly proved using Coq and Ssreflect.
The research leading to these results has received funding from the European Union’s 7th Framework Programme under grant agreement nr. 243847 (ForMath).
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
Almeida, J.B., Moreira, N., Pereira, D., de Sousa, S.M.: Partial Derivative Automata Formalized in Coq. In: Domaratzki, M., Salomaa, K. (eds.) CIAA 2010. LNCS, vol. 6482, pp. 59–68. Springer, Heidelberg (2011)
Bezem, M., Nakata, K., Uustalu, T.: On streams that are finitely red (submitted, 2011)
Braibant, T., Pous, D.: A tactic for deciding Kleene algebras. In: First Coq Workshop (August 2009)
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)
Brzozowski, J.A.: Derivatives of regular expressions. JACM 11(4), 481–494 (1964)
Büchi, J.R.: Weak second order arithmetica and finite automata. Zeitscrift Fur Mathematische Logic und Grundlagen Der Mathematik 6, 66–92 (1960)
The Coq Development Team, http://coq.inria.fr
Coquand, T., Gonthier, G., Siles, V.: Source code of the formalization, http://www.cse.chalmers.se/~siles/coq/regexp.tar.bzip2
Coquand, T., Spiwack, A.: Constructively finite? In: Laureano Lambán, L., Romero, A., Rubio, J. (eds.) Scientific Contributions in Honor of Mirian Andrés Gómez Servicio de Publicaciones, Universidad de La rioja, Spain (2010)
Johnstone, P.: Topos theory. Academic Press (1977)
Krauss, A., Nipkow, T.: Proof Pearl: Regular Expression Equivalence and Relation Algebra. Journal of Automated Reasoning (March 2011) (published online)
Martin-Löf, P.: An intuitionistic type theory: predicative part. In: Logic Colloquium 1973, pp. 73–118. North-Holland, Amsterdam (1973)
Mirkin, B.G.: An algorithm for constructing a base in a language of regular expressions. Engineering Cybernetics 5, 51–57 (1996)
Nordström, B.: Terminating general recursion BIT, vol. 28, pp. 605–619 (1988)
Owens, S., Reppy, J., Turon, A.: Regular-expression Derivatives Re-examined. Journal of Functional Programming 19(2), 173–190
Richman, F., Stolzenberg, G.: Well-Quasi-Ordered sets. Advances in Mathematics 97, 145–153 (1993)
Russell, B., Whitehead, A.N.: Principia Mathematica. Cambridge University Press (1910)
Gonthier, G., Mahboubi, A.: An introduction to small scale reflection in Coq. Journal of Formalized Reasoning 3(2), 95–152 (2010)
Tarski, A.: Sur les ensembles finis. Fundamenta Mathematicae 6, 45–95 (1924)
Thiemann, R., Sternagel, C.: Certification of Termination Proofs Using CeTA. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 452–468. Springer, Heidelberg (2009)
Wu, C., Zhang, X., Urban, C.: A Formalisation of the Myhill-Nerode Theorem Based on Regular Expressions (Proof Pearl). In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 341–356. Springer, Heidelberg (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Coquand, T., Siles, V. (2011). A Decision Procedure for Regular Expression Equivalence in Type Theory. In: Jouannaud, JP., Shao, Z. (eds) Certified Programs and Proofs. CPP 2011. Lecture Notes in Computer Science, vol 7086. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-25379-9_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-25379-9_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-25378-2
Online ISBN: 978-3-642-25379-9
eBook Packages: Computer ScienceComputer Science (R0)