Advertisement

Journal of Automated Reasoning

, Volume 52, Issue 4, pp 451–480 | Cite as

A Formalisation of the Myhill-Nerode Theorem Based on Regular Expressions

  • Chunhan Wu
  • Xingyuan Zhang
  • Christian UrbanEmail author
Article

Abstract

There are numerous textbooks on regular languages. Many of them focus on finite automata for proving properties. Unfortunately, automata are not so straightforward to formalise in theorem provers. The reason is that natural representations for automata are graphs, matrices or functions, none of which are inductive datatypes. Regular expressions can be defined straightforwardly as a datatype and a corresponding reasoning infrastructure comes for free in theorem provers. We show in this paper that a central result from formal language theory—the Myhill-Nerode Theorem—can be recreated using only regular expressions. From this theorem many closure properties of regular languages follow.

Keywords

Regular languages Theorem provers Myhill-Nerode theorem 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Almeida, J.B., Moriera, N., Pereira, D., de Sousa, S.M.: Partial derivative automata formalized in Coq. In: Proceedings of the 15th International Conference on Implementation and Application of Automata, vol. 6482, pp. 59–68. LNCS (2010)Google Scholar
  2. 2.
    Antimirov, V.: Partial derivatives of regular expressions and finite automata constructions. Theor. Comput. Sci. 155, 291–319 (1995)CrossRefMathSciNetGoogle Scholar
  3. 3.
    Asperti, A.: A compact proof of decidability for regular expression equivalence. In: Proceedings of the 3rd International Conference on Interactive Theorem Proving, vol. 7406, pp. 283–298. LNCS (2012)Google Scholar
  4. 4.
    Berghofer, S., Nipkow, T.: Executing higher order logic. In: Proceedings of the International Workshop on Types for Proofs and Programs, vol. 2277, pp. 24–40. LNCS (2002)Google Scholar
  5. 5.
    Berghofer, S., Reiter, M.: Formalizing the logic-automaton connection. In: Proceedings of the 22nd International Conference on Theorem Proving in Higher Order Logics, vol. 5674, pp. 147–163. LNCS (2009)Google Scholar
  6. 6.
    Braibant, T.: Kleene Algebras, Rewriting Modulo AC, and and Circuits in Coq. Ph.D. thesis, University of Grenoble (2012)Google Scholar
  7. 7.
    Brzozowski, J.A.: Derivatives of regular expressions. J. ACM 11(4), 481–494 (1964)CrossRefzbMATHMathSciNetGoogle Scholar
  8. 8.
    Church, A.: A formulation of the simple theory of types. J. Symb. Log. 5(2), 56–68 (1940)CrossRefMathSciNetGoogle Scholar
  9. 9.
    Constable, R.L., Jackson, P.B., Naumov, P., Uribe, J.C.: Constructively formalizing automata theory. In: Proof, Language, and Interaction, pp. 213–238. MIT Press (2000)Google Scholar
  10. 10.
    Coquand, T., Siles, V.: A decision procedure for regular expression equivalence in type theory. In: Proceedings of the 1st Conference on Certified Programs and Proofs, vol. 7086, pp. 119–134. LNCS (2011)Google Scholar
  11. 11.
    Doczkal, C., Kaiser, J.O., Smolka, G.: A Constructive Theory of Regular Languages in Coq. Accepted for publication. In: Proceedings of the 3rd International Conference on Certified Programs and Proofs. (2013)Google Scholar
  12. 12.
    Fenner, S.A., Gasarch, W.I., Postow, B.: The complexity of finding SUBSEQ(A). Theor. Comput. Syst. 45(3), 577–612 (2009)CrossRefzbMATHMathSciNetGoogle Scholar
  13. 13.
    Filliâtre, J.-C.: Finite automata theory in Coq: a constructive proof of Kleene’s Theorem. Research Report 97–04, LIP - ENS Lyon (1997)Google Scholar
  14. 14.
    Fortnow, L., Gasarch, W.I.: Proving DFA-Langs Closed Under Concat and * Without Using Equiv to NDFA’s. Retrieved today, from http://blog.computationalcomplexity.org (2013)
  15. 15.
    Gelade, W., Neven, F.: Succinctness of the complement and intersection of regular expressions. ACM Trans. Comput. Log. 13(1), 4:1–4:21 (2012)CrossRefMathSciNetGoogle Scholar
  16. 16.
    Haftmann, F.: Code Generation from Specifications in Higher-Order Logic. Ph.D. thesis, Technical University of Munich (2009)Google Scholar
  17. 17.
    Haines, L.H.: On free monoids partially ordered by embedding. J. Comb. Theor. 6, 94–98 (1969)CrossRefzbMATHMathSciNetGoogle Scholar
  18. 18.
    Harper, R.: Proof-directed debugging. J. Funct. Program. 9(4), 463–469 (1999)CrossRefzbMATHMathSciNetGoogle Scholar
  19. 19.
    Hopcroft, J.E., Ullman, J.D.: Formal Languages and Their Relation to Automata. Addison-Wesley, Reading (1969)Google Scholar
  20. 20.
    Kozen, D.: Automata and Computability. Springer, New York (1997)CrossRefzbMATHGoogle Scholar
  21. 21.
    Krauss, A., Nipkow, T.: Proof pearl: regular expression equivalence and relation algebra. J. Autom. Reason. 49(1), 95–106 (2012)CrossRefzbMATHMathSciNetGoogle Scholar
  22. 22.
    Lammich, P., Tuerk, T.: Applying data refinement for monadic programs to Hopcroft’s Algorithm. In: Proceedings of the 3rd International Conference on Interactive Theorem Proving, vol. 7406, pp. 166–182. LNCS (2012)Google Scholar
  23. 23.
    Nipkow, T.: Verified lexical analysis. In: Proceedings of the 11th International Conference on Theorem Proving in Higher Order Logics, vol. 1479, pp. 1–15. LNCS (1998)Google Scholar
  24. 24.
    Nipkow, T.: Gauss-Jordan elimination for matrices represented as functions. In: Klein, G., Nipkow, T., Paulson, L. (eds.) The Archive of Formal Proofs, http://afp.sourceforge.net/entries/Gauss-Jordan-Elim-Fun.shtml. Formal proof development, 2011
  25. 25.
    Owens, S., Reppy, J., Turon, A.: Regular-expression derivatives re-examined. J. Funct. Program. 19(2), 173–190 (2009)CrossRefzbMATHMathSciNetGoogle Scholar
  26. 26.
    Owens, S., Slind, K.: Adapting functional programs to higher order logic. Higher-Order Symb. Comput. 21(4), 377–409 (2008)CrossRefzbMATHGoogle Scholar
  27. 27.
    Rosenberg, A.L.: A Big Ideas Approach to the Theory of Computation. Course notes for CMPSCI 401 at the University of Massachusetts (2006)Google Scholar
  28. 28.
    Sakarovitch, J.: Elements of Automata Theory. Cambridge University Press, Cambridge (2009)CrossRefzbMATHGoogle Scholar
  29. 29.
    Shallit, J.: A Second Course in Formal Languages and Automata Theory. Cambridge University Press, Cambridge (2008)CrossRefGoogle Scholar
  30. 30.
    Sternagel, C.: Certified kruskals tree theorem. Accepted for publication In: Proceedings of the 3rd International Conference on Certified Programs and Proofs. (2013)Google Scholar
  31. 31.
    Sulzmann, M., Lu, K.Z.M.: Regular expression sub-matching using partial derivatives. In: Proceedings of the 14th Symposium on Principles and Practice of Declarative Programming (PPDP), pp. 79–90. ACM (2012)Google Scholar
  32. 32.
    Wu, C., Zhang, X., Urban, C.: A formalisation of the Myhill-Nerode theorem based on regular expressions (Proof Pearl). In: Proceedings of the 2nd International Conference on Interactive Theorem Proving, vol. 6898, pp. 341–356. LNCS (2011)Google Scholar
  33. 33.
    Wu, C., Zhang, X., Urban, C.: The Myhill-Nerode theorem based on regular expressions. In: Klein, G., Nipkow, T., Paulson, L. (eds) The Archive of Formal Proofs, http://afp.sourceforge.net/entries/Myhill-Nerode.shtml. Formal proof development, 2011
  34. 34.
    Yi, K.: Educational pearl: Proof-Directed Debugging revisited for a first-order version. J. Funct. Program. 16(6), 663–670 (2006)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer Science+Business Media Dordrecht 2014

Authors and Affiliations

  1. 1.PLA University of Science and Technology NanjingNanjingChina
  2. 2.King’s College LondonLondonUK

Personalised recommendations