Skip to main content
Log in

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

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  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)

  2. Antimirov, V.: Partial derivatives of regular expressions and finite automata constructions. Theor. Comput. Sci. 155, 291–319 (1995)

    Article  MathSciNet  Google Scholar 

  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)

  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)

  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)

  6. Braibant, T.: Kleene Algebras, Rewriting Modulo AC, and and Circuits in Coq. Ph.D. thesis, University of Grenoble (2012)

  7. Brzozowski, J.A.: Derivatives of regular expressions. J. ACM 11(4), 481–494 (1964)

    Article  MATH  MathSciNet  Google Scholar 

  8. Church, A.: A formulation of the simple theory of types. J. Symb. Log. 5(2), 56–68 (1940)

    Article  MathSciNet  Google Scholar 

  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)

  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)

  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)

  12. Fenner, S.A., Gasarch, W.I., Postow, B.: The complexity of finding SUBSEQ(A). Theor. Comput. Syst. 45(3), 577–612 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  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)

  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. Gelade, W., Neven, F.: Succinctness of the complement and intersection of regular expressions. ACM Trans. Comput. Log. 13(1), 4:1–4:21 (2012)

    Article  MathSciNet  Google Scholar 

  16. Haftmann, F.: Code Generation from Specifications in Higher-Order Logic. Ph.D. thesis, Technical University of Munich (2009)

  17. Haines, L.H.: On free monoids partially ordered by embedding. J. Comb. Theor. 6, 94–98 (1969)

    Article  MATH  MathSciNet  Google Scholar 

  18. Harper, R.: Proof-directed debugging. J. Funct. Program. 9(4), 463–469 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  19. Hopcroft, J.E., Ullman, J.D.: Formal Languages and Their Relation to Automata. Addison-Wesley, Reading (1969)

  20. Kozen, D.: Automata and Computability. Springer, New York (1997)

    Book  MATH  Google Scholar 

  21. Krauss, A., Nipkow, T.: Proof pearl: regular expression equivalence and relation algebra. J. Autom. Reason. 49(1), 95–106 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  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)

  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)

  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. Owens, S., Reppy, J., Turon, A.: Regular-expression derivatives re-examined. J. Funct. Program. 19(2), 173–190 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  26. Owens, S., Slind, K.: Adapting functional programs to higher order logic. Higher-Order Symb. Comput. 21(4), 377–409 (2008)

    Article  MATH  Google Scholar 

  27. Rosenberg, A.L.: A Big Ideas Approach to the Theory of Computation. Course notes for CMPSCI 401 at the University of Massachusetts (2006)

  28. Sakarovitch, J.: Elements of Automata Theory. Cambridge University Press, Cambridge (2009)

    Book  MATH  Google Scholar 

  29. Shallit, J.: A Second Course in Formal Languages and Automata Theory. Cambridge University Press, Cambridge (2008)

    Book  Google Scholar 

  30. Sternagel, C.: Certified kruskals tree theorem. Accepted for publication In: Proceedings of the 3rd International Conference on Certified Programs and Proofs. (2013)

  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)

  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)

  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. Yi, K.: Educational pearl: Proof-Directed Debugging revisited for a first-order version. J. Funct. Program. 16(6), 663–670 (2006)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christian Urban.

Additional information

This paper is a revised and much expanded version of Wu et al. [32].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Wu, C., Zhang, X. & Urban, C. A Formalisation of the Myhill-Nerode Theorem Based on Regular Expressions. J Autom Reasoning 52, 451–480 (2014). https://doi.org/10.1007/s10817-013-9297-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-013-9297-2

Keywords

Navigation