Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2500365.2500612acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Verified decision procedures for MSO on words based on derivatives of regular expressions

Published: 25 September 2013 Publication History

Abstract

Monadic second-order logic on finite words (MSO) is a decidable yet expressive logic into which many decision problems can be encoded. Since MSO formulas correspond to regular languages, equivalence of MSO formulas can be reduced to the equivalence of some regular structures (e.g. automata). This paper presents a verified functional decision procedure for MSO formulas that is not based on automata but on regular expressions. Functional languages are ideally suited for this task: regular expressions are data types and functions on them are defined by pattern matching and recursion and are verified by structural induction.
Decision procedures for regular expression equivalence have been formalized before, usually based on Brzozowski derivatives. Yet, for a straightforward embedding of MSO formulas into regular expressions an extension of regular expressions with a projection operation is required. We prove total correctness and completeness of an equivalence checker for regular expressions extended in that way. We also define a language-preserving translation of formulas into regular expressions with respect to two different semantics of MSO. Our results have been formalized and verified in the theorem prover Isabelle. Using Isabelle's code generation facility, this yields purely functional, formally verified programs that decide equivalence of MSO formulas.

References

[1]
V. Antimirov. Partial derivatives of regular expressions and finite automaton constructions. Theor. Comput. Sci., 155(2):291--319, Mar. 1996.
[2]
A. Asperti. A compact proof of decidability for regular expression equivalence. In L. Beringer and A. Felty, eds., Interactive Theorem Proving, ITP 2012, vol. 7406 of LNCS, pp. 283--298. Springer, 2012.
[3]
A. Ayari and D. Basin. Bounded model construction for monadic second-order logics. In E. A. Emerson and A. P. Sistla, eds., Proc. Int. Conf. Computer Aided Verification, CAV 2000, vol. 1855 of LNCS, pp. 99--112. Springer, 2000.
[4]
C. Ballarin. Interpretation of locales in Isabelle: Theories and proof contexts. In J. M. Borwein and W. M. Farmer, eds., Mathematical Knowledge Management, MKM 2006, vol. 4108 of LNCS, pp. 31--43. Springer, 2006.
[5]
D. Basin and S. Friedrich. Combining WS1S and HOL. In D. Gabbay and M. de Rijke, eds., Frontiers of Combining Systems 2, vol. 7 of Studies in Logic and Computation, pp. 39--56. Research Studies Press/Wiley, 2000.
[6]
S. Berghofer and M. Reiter. Formalizing the logic-automaton connection. In S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel, eds., Theorem Proving in Higher Order Logics, TPHOLs 2009, vol. 5674 of LNCS, pp. 147--163. Springer, 2009.
[7]
T. Braibant and D. Pous. An efficient Coq tactic for deciding Kleene algebras. In M. Kaufmann and L. Paulson, eds., Interactive Theorem Proving, ITP 2010, vol. 6172 of LNCS, pp. 163--178. Springer, 2010.
[8]
J. A. Brzozowski. Derivatives of regular expressions. J. ACM, 11(4):481--494, Oct. 1964.
[9]
P. Caron, J.-M. Champarnaud, and L. Mignot. Partial derivatives of an extended regular expression. In A.-H. Dediu, S. Inenaga, and C. Martın-Vide, eds., Proc. Int. Conf. Language and Automata Theory and Applications, LATA 2011, vol. 6638 of LNCS, pp. 179--191. Springer, 2011.
[10]
T. Coquand and V. Siles. A decision procedure for regular expression equivalence in type theory. In J.-P. Jouannaud and Z. Shao, eds., Proc. Int. Conf. Certified Programs and Proofs, CPP 2011, vol. 7086 of LNCS, pp. 119--134. Springer, 2011.
[11]
N. A. Danielsson. Total parser combinators. In P. Hudak and S. Weirich, eds., Proc. Int. Conf. Functional Programming, ICFP 2010, pp. 285--296. ACM, 2010.
[12]
J. Elgaard, N. Klarlund, and A. Møller. MONA 1.x: new techniques for WS1S and WS2S. In A. J. Hu and M. Y. Vardi, eds., Proc. Int. Conf. Computer Aided Verification, CAV 1998, vol. 1427 of LNCS, pp. 516--520. Springer, 1998.
[13]
S. Fischer, F. Huch, and T. Wilke. A play on regular expressions: functional pearl. In P. Hudak and S. Weirich, eds., Proc. Int. Conf. Functional Programming, ICFP 2010, pp. 357--368. ACM, 2010.
[14]
F. Haftmann, A. Krauss, O. Kuncar, and T. Nipkow. Data refinement in Isabelle/HOL. In S. Blazy, C. Paulin-Mohring, and D. Pichardie, eds., Interactive Theorem Proving, ITP 2013, vol. 7998 of LNCS, pp. 100--115. Springer, 2013.
[15]
F. Haftmann and T. Nipkow. Code generation via higher-order rewrite systems. In M. Blume, N. Kobayashi, and G. Vidal, eds., Functional and Logic Programming, FLOPS 2010, vol. 6009 of LNCS, pp. 103--117. Springer, 2010.
[16]
J. G. Henriksen, J. L. Jensen, M. E. Jørgensen, N. Klarlund, R. Paige, T. Rauhe, and A. Sandholm. MONA: Monadic second-order logic in practice. In E. Brinksma, R. Cleaveland, K. Larsen, T. Margaria, and B. Steffen, eds., Tools and Algorithms for the Construction and Analysis of Systems, TACAS 1995, vol. 1019 of LNCS, pp. 89--110. Springer, 1995.
[17]
N. Klarlund. A theory of restrictions for logics and automata. In N. Halbwachs and D. Peled, eds., Proc. Int. Conf. Computer Aided Verification, CAV 1999, vol. 1633 of LNCS, pp. 406--417. Springer, 1999.
[18]
A. Krauss and T. Nipkow. Proof pearl: Regular expression equivalence and relation algebra. J. Automated Reasoning, 49:95--106, 2012. published online March 2011.
[19]
M. Might, D. Darais, and D. Spiewak. Parsing with derivatives: A functional pearl. In M. M. T. Chakravarty, Z. Hu, and O. Danvy, eds., Proc. Int. Conf. Functional Programming, ICFP 2011, pp. 189--195. ACM, 2011.
[20]
N. Moreira, D. Pereira, and S. M. de Sousa. Deciding regular expressions (in-)equivalence in Coq. In W. Kahl and T. Griffin, eds., Relational and Algebraic Methods in Computer Science, RAMiCS 2012, vol. 7560 of LNCS, pp. 98--113. Springer, 2012.
[21]
T. Nipkow. Programming and proving in Isabelle/HOL. http://isabelle.in.tum.de/doc/prog-prove.pdf.
[22]
T. Nipkow, L. Paulson, and M. Wenzel. Isabelle/HOL -- A Proof Assistant for Higher-Order Logic, vol. 2283 of LNCS. Springer, 2002.
[23]
S. Owens, J. H. Reppy, and A. Turon. Regular-expression derivatives re-examined. J. Funct. Program., 19(2):173--190, 2009.
[24]
S. Owre and H. Rueß. Integrating WS1S with PVS. In E. A. Emerson and A. P. Sistla, eds., Proc. Int. Conf. Computer Aided Verification, CAV 2000, vol. 1855 of LNCS, pp. 548--551. Springer, 2000.
[25]
J. J. M. M. Rutten. Automata and coinduction (an exercise in coalgebra). In D. Sangiorgi and R. de Simone, eds., Proc. Int. Conf. Concurrency Theory, CONCUR 1998, vol. 1466 of LNCS, pp. 194--218. Springer, 1998.
[26]
W. Thomas. Languages, automata, and logic. In G. Rozenberg and A. Salomaa, eds., Handbook of Formal Languages, pp. 389--455. Springer, 1997.
[27]
D. Traytel and T. Nipkow. Formal development associated with this paper. http://www21.in.tum.de/ traytel/icfp13_mso.tar.gz.
[28]
C. Wu, X. Zhang, and C. Urban. A formalisation of the Myhill--Nerode theorem based on regular expressions (Proof pearl). In M. Eekelen, H. Geuvers, J. Schmaltz, and F. Wiedijk, eds., Interactive Theorem Proving, ITP 2011, vol. 6898 of LNCS, pp. 341--356. Springer, 2011.

Cited By

View all
  • (2015)Verified decision procedures for MSO on words based on derivatives of regular expressionsJournal of Functional Programming10.1017/S095679681500024625Online publication date: 5-Nov-2015
  • (2013)A Brief Survey of Verified Decision Procedures for Equivalence of Regular ExpressionsAutomated Reasoning with Analytic Tableaux and Related Methods10.1007/978-3-642-40537-2_3(10-12)Online publication date: 2013
  • (2024)A Logical Treatment of Finite AutomataTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-031-57246-3_20(350-369)Online publication date: 4-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
September 2013
484 pages
ISBN:9781450323260
DOI:10.1145/2500365
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 the author(s) 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].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 September 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. brzozowski derivatives
  2. decision procedure
  3. interactive theorem proving
  4. isabelle
  5. mso
  6. regular expressions
  7. ws1s

Qualifiers

  • Research-article

Conference

ICFP'13
Sponsor:
ICFP'13: ACM SIGPLAN International Conference on Functional Programming
September 25 - 27, 2013
Massachusetts, Boston, USA

Acceptance Rates

ICFP '13 Paper Acceptance Rate 40 of 133 submissions, 30%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)2
Reflects downloads up to 10 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2015)Verified decision procedures for MSO on words based on derivatives of regular expressionsJournal of Functional Programming10.1017/S095679681500024625Online publication date: 5-Nov-2015
  • (2013)A Brief Survey of Verified Decision Procedures for Equivalence of Regular ExpressionsAutomated Reasoning with Analytic Tableaux and Related Methods10.1007/978-3-642-40537-2_3(10-12)Online publication date: 2013
  • (2024)A Logical Treatment of Finite AutomataTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-031-57246-3_20(350-369)Online publication date: 4-Apr-2024
  • (2019)Symbolic Regex MatcherTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-030-17462-0_24(372-378)Online publication date: 6-Apr-2019

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media