skip to main content
10.1145/2103776.2103784acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Reflexive toolbox for regular expression matching: verification of functional programs in Coq+Ssreflect

Published:24 January 2012Publication History

ABSTRACT

We study a derivative method allowing to prove termination of computations on regular expressions. A Coq formalisation of a canonical non-deterministic finite automaton construction on a regular expression is presented. The correctness of the functional definitions is formally verified in Coq using the libraries and the small-scale reflection tools of Ssreflect. We propose to extend the proofs further, and this is a work in progress, to study termination of containment and equivalence in terms of partial derivatives. This serves as a major motivation and intended application of the presented approach. A method that we develop in the paper, called shadowing, allows for a smooth program extraction from decision procedures whatever the complexity of the dependently typed proofs.

References

  1. J. B. Almeida, N. Moreira, D. Pereira, and S. M. de Sousa. Partial derivative automata formalized in Coq. In Implementation and Application of Automata 2010, volume 6482/2011 of Lecture Notes in Computer Science, pages 59--68, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. V. M. Antimirov. Partial derivatives of regular expressions and finite automaton constructions. Theor. Comput. Sci., 155 (2): 291--319, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Y. Bertot, G. Gonthier, S. Ould Biha, and I. Pasca. Canonical big operators. In phProceedings of the 21st International Conference on Theorem Proving in Higher Order Logics (TPHOLs'08), LNCS, pages 86--101. Springer-Verlag, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Braibant and D. Pous. An efficient coq tactic for deciding kleene algebras. In M. Kaufmann and L. Paulson, editors, phInteractive Theorem Proving, volume 6172 of phLecture Notes in Computer Science, pages 163--178. Springer Berlin / Heidelberg, 2010. ISBN 978--3--642--14051--8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. A. Brzozowski. Derivatives of regular expressions. J. ACM, 11 (4): 481--494, 1964. 10.1145/321239.321249. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J.-M. Champarnaud and D. Ziadi. From Mirkin's prebases to Antimirov's word partial derivatives. Fundam. Inf., 45: 195--205, January 2001. ISSN 0169--2968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. A. Danielsson. Total parser combinators. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP'10, pages 285--296, New York, NY, USA, 2010. ACM. ISBN 978--1--60558--794--3. 10.1145/1863543.1863585. URL http://doi.acm.org/10.1145/1863543.1863585. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. F. Garillot, G. Gonthier, A. Mahboubi, and L. Rideau. Packaging mathematical structures. In Theorem Proving in Higher Order Logics (2009), volume 5674 of phLNCS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Gonthier. Expressions regulieres, May 2010. E-mail correspondence.Google ScholarGoogle Scholar
  10. G. Gonthier, A. Mahboubi, and E. Tassi. A Small Scale Reflection Extension for the Coq system. Research Report RR-6455, INRIA, 2011. URL http://hal.inria.fr/inria-00258384/en/.Google ScholarGoogle Scholar
  11. F. Henglein and L. Nielsen. Declarative coinductive axiomatization of regular expression containment and its computational interpretation (preliminary version). Technical Report 612, Department of Computer Science, University of Copenhagen (DIKU), February 2010.Google ScholarGoogle Scholar
  12. F. Henglein and L. Nielsen. Regular expression containment: Coinductive axiomatization and computational interpretation. In Proc. 38th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL). ACM, January 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. V. Komendantsky. Formal proofs of the prebase theorem of Mirkin, 2011. Coq script available at http://www.cs.st-andrews.ac.uk/\ vk/doc/prebase.v.Google ScholarGoogle Scholar
  14. V. Komendantsky. Regular expression containment as a proof search problem. In S. Lengrand, editor, Proceedings of the International Workshop on Proof-Search in Axiomatic Theories and Type Theories (PSATTT'11), Wrocław, Poland, 30 July 2011.Google ScholarGoogle Scholar
  15. A. Krauss and T. Nipkow. Proof pearl: Regular expression equivalence and relation algebra. Journal of Automated Reasoning, March 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. G. Mirkin. New algorithm for construction of base in the language of regular expressions. Tekhnicheskaya Kibernetika, 5: 113--119, 1966. English translation in Engineering Cybernetics, No. 5, Sept.--Oct. 1966, pp. 110--116.Google ScholarGoogle Scholar
  17. J. J. M. M. Rutten. Automata and coinduction (an exercise in coalgebra). In D. Sangiorigi and R. de Simone, editors, CONCUR'98, volume 1466 of LNCS, pages 194--218. Springer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Sulzmann and K. Z. M. Lu. Regular expression matching using partial derivatives, 2010. Draft.Google ScholarGoogle Scholar
  19. The Coq development team. The Coq proof assistant reference manual. http://coq.inria.fr/refman/.Google ScholarGoogle Scholar

Index Terms

  1. Reflexive toolbox for regular expression matching: verification of functional programs in Coq+Ssreflect

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PLPV '12: Proceedings of the sixth workshop on Programming languages meets program verification
        January 2012
        90 pages
        ISBN:9781450311250
        DOI:10.1145/2103776

        Copyright © 2012 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 24 January 2012

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate18of25submissions,72%

        Upcoming Conference

        POPL '25

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader