Model-checking higher-order functions

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.

[1]  Pawel Urzyczyn,et al.  Higher-Order Pushdown Trees Are Easy , 2002, FoSSaCS.

[2]  C.-H. Luke Ong,et al.  Complexity of Model Checking Recursion Schemes for Fragments of the Modal Mu-Calculus , 2009, ICALP.

[3]  Jakob Rehof,et al.  Tractable Constraints in Finite Semilattices , 1999, Sci. Comput. Program..

[4]  François Pessaux,et al.  Type-based analysis of uncaught exceptions , 2000, TOPL.

[5]  Assaf J. Kfoury,et al.  Principality and type inference for intersection types using expansion variables , 2004, Theor. Comput. Sci..

[6]  Atsushi Igarashi,et al.  Resource usage analysis , 2002, POPL '02.

[7]  Igor Walukiewicz,et al.  Unsafe Grammars and Panic Automata , 2005, ICALP.

[8]  Dan R. Ghica,et al.  On-the-Fly Techniques for Game-Based Software Model Checking , 2008, TACAS.

[9]  Atsushi Igarashi,et al.  Resource usage analysis for a functional language with exceptions , 2006, PEPM '06.

[10]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[11]  Thomas A. Henzinger,et al.  The software model checker Blast , 2007, International Journal on Software Tools for Technology Transfer.

[12]  Matthew Might,et al.  Exploiting reachability and cardinality in higher-order flow analysis , 2008, J. Funct. Program..

[13]  M. Rabin Decidability of second-order theories and automata on infinite trees , 1968 .

[14]  Gérard Boudol,et al.  On strong normalization and type inference in the intersection type discipline , 2008, Theor. Comput. Sci..

[15]  Thomas A. Henzinger,et al.  The software model checker B last : Applications to software engineering , 2007 .

[16]  Simona Ronchi Della Rocca,et al.  Principal Type Schemes for an Extended Type Theory , 1984, Theor. Comput. Sci..

[17]  Klaus Aehlig A Finite Semantics of Simply-Typed Lambda Terms for Infinite Runs of Automata , 2007, Log. Methods Comput. Sci..

[18]  Pawel Urzyczyn,et al.  Deciding Monadic Theories of Hyperalgebraic Trees , 2001, TLCA.

[19]  Naoki Kobayashi Types and higher-order recursion schemes for verification of higher-order programs , 2009, POPL '09.

[20]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[21]  Bruno Courcelle,et al.  The Monadic Second-Order Logic of Graphs IX: Machines and their Behaviours , 1995, Theor. Comput. Sci..

[22]  Mario Coppo,et al.  Principal type-schemes and lambda-calculus semantics , 1980 .

[23]  C.-H. Luke Ong,et al.  On Model-Checking Trees Generated by Higher-Order Recursion Schemes , 2006, 21st Annual IEEE Symposium on Logic in Computer Science (LICS'06).

[24]  Andrzej S. Murawski,et al.  Collapsible Pushdown Automata and Recursion Schemes , 2008, LICS.

[25]  C.-H. Luke Ong,et al.  A Type System Equivalent to the Modal Mu-Calculus Model Checking of Higher-Order Recursion Schemes , 2009, 2009 24th Annual IEEE Symposium on Logic In Computer Science.

[26]  Klaus Aehlig,et al.  The Monadic Second Order Theory of Trees Given by Arbitrary Level-Two Recursion Schemes Is Decidable , 2005, TLCA.

[27]  Umut A. Acar,et al.  Exception Handlers as Extensible Cases , 2008, APLAS.