Hostname: page-component-7479d7b7d-8zxtt Total loading time: 0 Render date: 2024-07-13T19:51:21.176Z Has data issue: false hasContentIssue false

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

Published online by Cambridge University Press:  05 November 2015

DMITRIY TRAYTEL
Affiliation:
Institute of Information Security, Department of Computer Science, ETH Zürich, Switzerland (e-mail: traytel@inf.ethz.ch)
TOBIAS NIPKOW
Affiliation:
Fakultät für Informatik, Technische Universität München, Germany (e-mail: nipkow@in.tum.de)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 2015 

References

Antimirov, V. (1996) Partial derivatives of regular expressions and finite automaton constructions. Theor. Comput. Sci. 155 (2), 291319.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Brzozowski, J. A. (1964) Derivatives of regular expressions. J. ACM 11 (4), 481494.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
Danielsson, N. A. (2010) Total parser combinators. In Proc. Int. Conf. Functional Programming, ICFP 2010, Hudak, P. & Weirich, S. (eds), ACM, pp. 285296.Google Scholar
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.Google Scholar
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.Google Scholar
Ginzburg, A. (1967) A procedure for checking equality of regular expressions. J. ACM 14 (2), 355362.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Krauss, A. & Nipkow, T. (2012) Proof pearl: Regular expression equivalence and relation algebra. J. Autom. Reason. 49 (1), 95106. published online March 2011.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
Nipkow, T. & Klein, G. (2014) Concrete Semantics: With Isabelle/HOL. Springer. Available at: http://www.in.tum.de/~nipkow/Concrete-Semantics.CrossRefGoogle Scholar
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.Google Scholar
Nipkow, T., Paulson, L. & Wenzel, M. (2002) Isabelle/HOL — A Proof Assistant for Higher-Order Logic. Lect. Notes Comput. Sci., vol. 2283. Springer.Google Scholar
Okhotin, A. (2005) The dual of concatenation. Theor. Comput. Sci. 345 (2–3), 425447.CrossRefGoogle Scholar
Owens, S., Reppy, J. H. & Turon, A. (2009) Regular-expression derivatives re-examined. J. Funct. Program. 19 (2), 173190.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Thomas, W. (1997) Languages, automata, and logic. In Handbook of Formal Languages, Rozenberg, G. & Salomaa, A. (eds), Springer, pp. 389455.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
Wu, C., Zhang, X. & Urban, C. (2014) A formalisation of the Myhill-Nerode theorem based on regular expressions. J. Autom. Reason. 52 (4), 451480.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.