Skip to main content Accessibility help
×
Home

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

  • DMITRIY TRAYTEL (a1) and TOBIAS NIPKOW (a2)

Abstract

Monadic second-order logic on finite words 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.

Copyright

References

Hide All
Antimirov, V. (1996) Partial derivatives of regular expressions and finite automaton constructions. Theor. Comput. Sci. 155 (2), 291319.
Asperti, A. (2012) A compact proof of decidability for regular expression equivalence. In Proc. Int. Conf. Interactive Theorem Proving, ITP 2012, Beringer, L. & Felty, A. (eds), Lect. Notes Comput. Sci., vol. 7406. Springer, pp. 283298.
Ayari, A. & Basin, D. (2000) Bounded model construction for monadic second-order logics. In Proc. Int. Conf. Computer Aided Verification, CAV 2000, Emerson, E. A. & Sistla, A. P. (eds), Lect. Notes Comput. Sci., vol. 1855. Springer, pp. 99112.
Ballarin, C. (2006) Interpretation of locales in Isabelle: Theories and proof contexts. In Proc. Int. Conf. Mathematical Knowledge Management, MKM 2006, Borwein, J. M. & Farmer, W. M. (eds), Lect. Notes Comput. Sci., vol. 4108. Springer, pp. 3143.
Basin, D. & Friedrich, S. (2000) Combining WS1S and HOL. In Frontiers of Combining Systems 2, Gabbay, D. M. & de Rijke, M. (eds), Studies in Logic and Computation, vol. 7. Research Studies Press, pp. 3956.
Berghofer, S. & Reiter, M. (2009) Formalizing the logic-automaton connection. In Proc. Int. Conf. Theorem Proving in Higher Order Logics, TPHOLs 2009, Berghofer, S., Nipkow, T., Urban, C. & Wenzel, M. (eds), Lect. Notes Comput. Sci., vol. 5674. Springer, pp. 147163.
Bonchi, F. & Pous, D. (2013) Checking NFA equivalence with bisimulations up to congruence. In Proc. Int. Symp. Principles of Programming Languages, POPL 2013, Giacobazzi, R. & Cousot, R. (eds), ACM, pp. 457468.
Braibant, T. & Pous, D. (2010) An efficient Coq tactic for deciding Kleene algebras. In Proc. Int. Conf. Interactive Theorem Proving, ITP 2010, Kaufmann, M. & Paulson, L. (eds), Lect. Notes Comput. Sci., vol. 6172. Springer, pp. 163178.
Brzozowski, J. A. (1964) Derivatives of regular expressions. J. ACM 11 (4), 481494.
Caron, P., Champarnaud, J.-M., & Mignot, L. (2011) Partial derivatives of an extended regular expression. In Proc. Int. Conf. Language and Automata Theory and Applications, LATA 2011, Dediu, A.-H., Inenaga, S. & Martín-Vide, C. (eds), Lect. Notes Comput. Sci., vol. 6638. Springer, pp. 179191.
Coquand, T. & Siles, V. (2011) A decision procedure for regular expression equivalence in type theory. In Proc. Int. Conf. Certified Programs and Proofs, CPP 2011, Jouannaud, J.-P. & Shao, Z. (eds), Lect. Notes Comput. Sci., vol. 7086. Springer, pp. 119134.
Danielsson, N. A. (2010) Total parser combinators. In Proc. Int. Conf. Functional Programming, ICFP 2010, Hudak, P. & Weirich, S. (eds), ACM, pp. 285296.
Elgaard, J., Klarlund, N. & Møller, A. (1998) MONA 1.x: New techniques for WS1S and WS2S. In Proc. Int. Conf. Computer Aided Verification, CAV 1998, Hu, A. J. & Vardi, M. Y. (eds), Lect. Notes Comput. Sci., vol. 1427. Springer, pp. 516520.
Fischer, S., Huch, F. & Wilke, T. (2010) A play on regular expressions: Functional pearl. Proc. Int. Conf. Functional Programming, ICFP 2010, Hudak, P. & Weirich, S. (eds), ACM, pp. 357368.
Ginzburg, A. (1967) A procedure for checking equality of regular expressions. J. ACM 14 (2), 355362.
Haftmann, F. & Nipkow, T. (2010) Code generation via higher-order rewrite systems. Proc. Int. Symp. Functional and Logic Programming, FLOPS 2010, Lect. Notes Comput. Sci., vol. 6009. Springer, pp. 103117.
Haftmann, F., Krauss, A., Kunčar, O. & Nipkow, T. (2013) Data refinement in Isabelle/HOL. In Proc. Int. Conf. Interactive Theorem Proving, ITP 2013, Blazy, S., Paulin-Mohring, C. & Pichardie, D. (eds), Lect. Notes Comput. Sci., vol. 7998. Springer, pp. 100115.
Henriksen, J. G., Jensen, J. L., Jørgensen, M. E., Klarlund, N., Paige, R., Rauhe, T. & Sandholm, A. (1995) MONA: Monadic second-order logic in practice. In Proc. Int. Workshop Tools and Algorithms for the Construction and Analysis of Systems, TACAS 1995, Brinksma, E., Cleaveland, R., Larsen, K., Margaria, T. & Steffen, B. (eds), Lect. Notes Comput. Sci., vol. 1019. Springer, pp. 89110.
Klarlund, N. (1999) A theory of restrictions for logics and automata. In Proc. Int. Conf. Computer Aided Verification, CAV 1999, Halbwachs, N. & Peled, D. (eds), Lect. Notes Comput. Sci., vol. 1633. Springer, pp. 406417.
Kozen, D. (2008 March) On the Coalgebraic Theory of Kleene Algebra with Tests. Tech. rept. http://hdl.handle.net/1813/10173. Computing and Information Science, Cornell University.
Krauss, A. & Nipkow, T. (2012) Proof pearl: Regular expression equivalence and relation algebra. J. Autom. Reason. 49 (1), 95106. published online March 2011.
Might, M., Darais, D. & Spiewak, D. (2011) Parsing with derivatives: A functional pearl. In Proc. Int. Conf. Functional Programming, ICFP 2011, Chakravarty, M. M. T., Hu, Z. & Danvy, O. (eds), ACM, pp. 189195.
Moreira, N., Pereira, D. & de Sousa, S. M. (2012) Deciding regular expressions (in-)equivalence in Coq. In Relational and Algebraic Methods in Computer Science, RAMiCS 2012, Kahl, W. & Griffin, T. (eds), Lect. Notes Comput. Sci., vol. 7560. Springer, pp. 98113.
Nipkow, T. & Klein, G. (2014) Concrete Semantics: With Isabelle/HOL. Springer. Available at: http://www.in.tum.de/~nipkow/Concrete-Semantics.
Nipkow, T. & Traytel, D. (2014) Unified decision procedures for regular expression equivalence. In Proc. Int. Conf. Interactive Theorem Proving, ITP 2014, Klein, G. & Gamboa, R. (eds), Lect. Notes Comput. Sci., vol. 8558. Springer, pp. 450466.
Nipkow, T., Paulson, L. & Wenzel, M. (2002) Isabelle/HOL — A Proof Assistant for Higher-Order Logic. Lect. Notes Comput. Sci., vol. 2283. Springer.
Okhotin, A. (2005) The dual of concatenation. Theor. Comput. Sci. 345 (2–3), 425447.
Owens, S., Reppy, J. H. & Turon, A. (2009) Regular-expression derivatives re-examined. J. Funct. Program. 19 (2), 173190.
Owre, S. & Rueß, H. (2000) Integrating WS1S with PVS. In Proc. Int. Conf. Computer Aided Verification, CAV 2000, Emerson, E. A. & Sistla, A. P. (eds), Lect. Notes Comput. Sci., vol. 1855. Springer, pp. 548551.
Pous, D. (2015) Symbolic algorithms for language equivalence and Kleene algebra with test. In Proc. Int. Symp. Principles of Programming Languages, POPL 2015, Walker, D. (ed), ACM, pp. 357368.
Rutten, Jan J. M. M. (1998) Automata and coinduction (an exercise in coalgebra) In Proc. Int. Conf. Concurrency Theory, CONCUR 1998, Sangiorgi, D. & de Simone, R. (eds), Lect. Notes Comput. Sci., vol. 1466. Springer, pp. 194218.
Thomas, W. (1997) Languages, automata, and logic. In Handbook of Formal Languages, Rozenberg, G. & Salomaa, A. (eds), Springer, pp. 389455.
Traytel, D. & Nipkow, T. (2013) Verified decision procedures for MSO on words based on derivatives of regular expressions. Proc. Int. Conf. Functional Programming, ICFP 2013, Morrisett, G. & Uustalu, T. (eds), ACM, pp. 312.
Traytel, D. & Nipkow, T. (2014) Decision procedures for MSO on words based on derivatives of regular expressions. In Archive of Formal Proofs, Klein, G., Nipkow, T. & Paulson, L. (eds), http://afp.sf.net/entries/MSO_Regex_Equivalence.shtml, Formal proof development.
Wu, C., Zhang, X. & Urban, C. (2014) A formalisation of the Myhill-Nerode theorem based on regular expressions. J. Autom. Reason. 52 (4), 451480.

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

  • DMITRIY TRAYTEL (a1) and TOBIAS NIPKOW (a2)

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

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

  • DMITRIY TRAYTEL (a1) and TOBIAS NIPKOW (a2)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *