skip to main content
10.1145/1599410.1599415acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Model-checking higher-order functions

Published:07 September 2009Publication History

ABSTRACT

We propose a novel type-based model checking algorithm for higher-order recursion schemes. As shown by Kobayashi, verification problems of higher-order functional programs can easily be translated into model checking problems of recursion schemes. Thus, the model checking algorithm serves as a basis for verification of higher-order functional programs. To our knowledge, this is the first practical algorithm for model checking recursion schemes: all the previous algorithms always suffer from the n-EXPTIME bottleneck, not only in the worst, and there was no implementation of the algorithms. We have implemented a model checker for recursion schemes based on the proposed algorithm, and applied it to verification of functional programs, including reachability, flow analysis and resource usage verification problems. According to our experiments, the model checker is surprisingly fast: it could automatically verify a number of small but tricky higher-order functional programs in less than a second.

References

  1. Objective caml. http://caml.inria.fr/ocaml/.Google ScholarGoogle Scholar
  2. K. Aehlig. A finite semantics of simply-typed lambda terms for infinite runs of automata. Logical Methods in Computer Science, 3(3), 2007.Google ScholarGoogle Scholar
  3. K. Aehlig, J.G. de Miranda, and C.-H.L. Ong. The monadic second order theory of trees given by arbitrary level-two recursion schemes is decidable. In TLCA 2005, volume 3461 of LNCS, pages 39--54. Springer-Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Bakewell and D.R. Ghica. On-the-fly techniques for game-based software model checking. In Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, volume 4963 of LNCS, pages 78--92. Springer-Verlag, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Ball, R. Majumdar, T.D. Millstein, and S.K. Rajamani. Automatic predicate abstraction of C programs. In PLDI 2001, pages 203--213, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Beyer, T.A. Henzinger, R. Jhala, and R. Majumdar. The software model checker blast. International Journal on Software Tools for Technology Transfer, 9(5-6):505--525, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Blume, U.A. Acar, and W. Chae. Exception handlers as extensible cases. In Proceedings of APLAS 2008, volume 5356 of LNCS, pages 273--289. Springer-Verlag, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Boudol. On strong normalization and type inference in the intersection type discipline. Theor. Comput. Sci., 398(1-3):63--81, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Coppo, M. Dezani-Ciancaglini, and B. Venneri. Principal type schemes and lambda-calculus semantics. In Essays on Combinatory Logic, Lambda Calculus, and Foundation, pages 535--560. Academic Press, 1980.Google ScholarGoogle Scholar
  10. B. Courcelle. The monadic second-order logic of graphs IX: machines and their behaviours. Theoretical Computer Science, 151:125--162, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Hague, A. Murawski, C.-H.L. Ong, and O. Serre. Collapsible pushdown automata and recursion schemes. In Proceedings of 23rd Annual IEEE Symposium on Logic in Computer Science, pages 452--461. IEEE Computer Society, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Igarashi and N. Kobayashi. Resource usage analysis. ACM Trans. Prog. Lang. Syst., 27(2):264--313, 2005. Preliminary summary appeared in Proceedings of POPL 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. F. Iwama, A. Igarashi, and N. Kobayashi. Resource usage analysis for a functional language with exceptions. In Proceedings of ACM SIGPLAN 2006 Workshop on Partial Evaluation and Program Manipulation (PEPM 2006), pages 38--47. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A.J. Kfoury and J.B. Wells. Principality and type inference for intersection types using expansion variables. Theor. Comput. Sci., 311(1-3):1--70, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. Knapik, D. Niwinski, and P. Urzyczyn. Deciding monadic theories of hyperalgebraic trees. In TLCA 2001, volume 2044 of LNCS, pages 253--267. Springer-Verlag, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Knapik, D. Niwinski, and P. Urzyczyn. Higher-order pushdown trees are easy. In FoSSaCS 2002, volume 2303 of LNCS, pages 205--222. Springer-Verlag, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. Knapik, D. Niwinski, P. Urzyczyn, and I. Walukiewicz. Unsafe grammars and panic automata. In ICALP 2005, volume 3580 of LNCS, pages 1450--1461. Springer-Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. N. Kobayashi. Types and higher-order recursion schemes for verification of higher-order programs. In Proc. of POPL, pages 416--428, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. N. Kobayashi and C.-H.L. Ong. Complexity of model checking recursion schemes for fragments of the modal mu-calculus. In Proceedings of ICALP 2009, LNCS. Springer-Verlag, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. N. Kobayashi and C.-H.L. Ong. A type system equivalent to the modal mu-calculus model checking of higher-order recursion schemes. In Proceedings of LICS 2009. IEEE Computer Society Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. X. Leroy and F. Pessaux. Type-based analysis of uncaught exceptions. ACM Trans. Prog. Lang. Syst., 22(2):340--377, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Might and O. Shivers. Exploiting reachability and cardinality in higher-order flow analysis. J. Funct. Program., 18(5-6):821--864, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. F. Nielson, H.R. Nielson, and C. Hankin. Principles of Program Analysis. Springer-Verlag, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C.-H.L. Ong. On model-checking trees generated by higher-order recursion schemes. In LICS 2006, pages 81--90. IEEE Computer Society Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M.O. Rabin. Decidability of second-order theories and automata on infinite trees. Trans. Amer. Maths. Soc, 141:1--35, 1969.Google ScholarGoogle Scholar
  26. J. Rehof and T. Mogensen. Tractable constraints in finite semilattices. Science of Computer Programming, 35(2):191--221, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S.R.D. Rocca and B. Venneri. Principal type schemes for an extended type theory. Theor. Comput. Sci., 28:151--169, 1984.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Model-checking higher-order functions

              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
                PPDP '09: Proceedings of the 11th ACM SIGPLAN conference on Principles and practice of declarative programming
                September 2009
                324 pages
                ISBN:9781605585680
                DOI:10.1145/1599410

                Copyright © 2009 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: 7 September 2009

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                Overall Acceptance Rate230of486submissions,47%

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader