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

Verifying higher-order functional programs with pattern-matching algebraic data types

Authors Info & Claims
Published:26 January 2011Publication History

ABSTRACT

Type-based model checking algorithms for higher-order recursion schemes have recently emerged as a promising approach to the verification of functional programs. We introduce pattern-matching recursion schemes (PMRS) as an accurate model of computation for functional programs that manipulate algebraic data-types. PMRS are a natural extension of higher-order recursion schemes that incorporate pattern-matching in the defining rules.

This paper is concerned with the following (undecidable) verification problem: given a correctness property φ, a functional program ℘ (qua PMRS) and a regular input set ℑ, does every term that is reachable from ℑ under rewriting by ℘ satisfy φ? To solve the PMRS verification problem, we present a sound semi-algorithm which is based on model-checking and counterexample guided abstraction refinement. Given a no-instance of the verification problem, the method is guaranteed to terminate.

From an order-n PMRS and an input set generated by a regular tree grammar, our method constructs an order-n weak PMRS which over-approximates only the first-order pattern-matching behaviour, whilst remaining completely faithful to the higher-order control flow. Using a variation of Kobayashi's type-based approach, we show that the (trivial automaton) model-checking problem for weak PMRS is decidable. When a violation of the property is detected in the abstraction which does not correspond to a violation in the model, the abstraction is automatically refined by `unfolding' the pattern-matching rules in the program to give successively more and more accurate weak PMRS models.

Skip Supplemental Material Section

Supplemental Material

53-mpeg-4.mp4

mp4

457.2 MB

References

  1. W. Blum and C.-H. L. Ong. Path-correspondence theorems and their applications. Preprint, 2009.Google ScholarGoogle Scholar
  2. E. M. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. Counterexample-guided abstraction refinement. In CAV '00: Proceedings of the 12th International Conference on Computer Aided Verification, pages 154--169, London, UK, 2000. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Igarashi and N. Kobayashi. Resource usage analysis. ACM Trans. Program. Lang. Syst., 27(2):264--313, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. N. D. Jones. Flow analysis of lambda expressions (preliminary version). In Proceedings of the 8th Colloquium on Automata, Languages and Programming, pages 114--128. Springer-Verlag, 1981. ISBN 3-540-10843-2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. N. D. Jones and N. Andersen. Flow analysis of lazy higher-order functional programs. Theoretical Computer Science, 375:120--136, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. N. Kobayashi. Types and higher-order recursion schemes for verification of higher-order programs. In Proceedings of POPL 2009, pages 416--428. ACM Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Kobayashi. Model-checking higher-order functions. In PPDP, pages 25--36, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. Kobayashi and C.-H. L. Ong. A type theory equivalent to the modal mu-calculus model checking ofhigher-order recursion schemes. In Proceedings of LICS 2009. IEEE Computer Society, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. N. Kobayashi, N. Tabuchi, and H. Unno. Higher-order multi-parameter tree transducers and recursion schemes for program veri- fication. In POPL, pages 495--508, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Kochems. Approximating reachable terms of functional programs. University of Oxford MMathsCompSc thesis, 2010.Google ScholarGoogle Scholar
  11. R. P. Kurshan. Computer Aided Verification of Coordinating Processes. Princeton University Press, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Midtgaard. Control-flow analysis of functional programs. Technical Report BRICS RS-07-18, DAIMI, Department of Computer Science, University of Aarhus, Aarhus, Denmark, Dec 2007. URL http://www.brics.dk/RS/07/18/BRICS-RS-07-18.pdf.Google ScholarGoogle ScholarCross RefCross Ref
  13. F. Nielson, H. R. Nielson, and C. Hankin. Principles of Program Analysis. Springer-Verlag New York, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C.-H. L. Ong. On model-checking trees generated by higher-order recursion schemes. In Proceedings 21st Annual IEEE Symposium on Logic in Computer Science, Seattle, pages 81--90. Computer Society Press, 2006. Long version (55 pp.) downloadable at users.comlab.ox.ac.uk/luke.ong/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C.-H. L. Ong and S. J. Ramsay. Verifying higher-order functional programs with pattern-matching al- gebraic data types. Long version, available from: https://mjolnir.comlab.ox.ac.uk/papers/pmrs.pdf. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C.-H. L. Ong and N. Tzevelekos. Functional reachability. In LICS, pages 286--295, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. O. Shivers. Control-flow analysis of higher-order languages. PhD thesis, Carnegie-Mellon University, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Verifying higher-order functional programs with pattern-matching algebraic data types

              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
                POPL '11: Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                January 2011
                652 pages
                ISBN:9781450304900
                DOI:10.1145/1926385
                • cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 46, Issue 1
                  POPL '11
                  January 2011
                  624 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/1925844
                  Issue’s Table of Contents

                Copyright © 2011 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: 26 January 2011

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                Overall Acceptance Rate824of4,130submissions,20%

                Upcoming Conference

                POPL '25

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader