Hybrid contract checking via symbolic simplification

Program errors are hard to detect or prove absent. Allowing programmers to write formal and precise specifications, especially in the form of contracts, is a popular approach to program verification and error discovery. We formalize and implement a hybrid (static and dynamic) contract checker for a subset of OCaml. The key technique is symbolic simplification, which makes integrating static and dynamic contract checking easy and effective. Our technique statically checks contract satisfaction or blames the function violating the contract. When a contract satisfaction is undecidable, it leaves residual code for dynamic contract checking.

[1]  Na Xu Static contract checking for Haskell , 2009, POPL '09.

[2]  Jean-François Couchot,et al.  Handling Polymorphism in Automated Deduction , 2007, CADE.

[3]  Neil D. Jones,et al.  Termination Analysis of Higher-Order Functional Programs , 2005, APLAS.

[4]  Lawrence C. Paulson,et al.  Extending Sledgehammer with SMT Solvers , 2011, Journal of Automated Reasoning.

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

[6]  Greg Nelson,et al.  Extended static checking for Java , 2002, PLDI '02.

[7]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[8]  Naoki Kobayashi,et al.  Predicate abstraction and CEGAR for higher-order model checking , 2011, PLDI '11.

[9]  Chin Soon Lee Program Termination Analysis in Polynomial Time , 2002, GPCE.

[10]  Frank Piessens,et al.  VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java , 2011, NASA Formal Methods.

[12]  Juan Chen,et al.  Secure distributed programming with value-dependent types , 2013, J. Funct. Program..

[13]  Rupak Majumdar,et al.  HMC: Verifying Functional Programs Using Abstract Interpreters , 2011, CAV.

[14]  Atsushi Igarashi,et al.  Polymorphic Contracts , 2011, ESOP.

[15]  Amr Sabry,et al.  The essence of compiling with continuations (with retrospective) , 1993, PLDI 1993.

[16]  Benjamin C. Pierce,et al.  Contracts made manifest , 2010, POPL '10.

[17]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[18]  Yann Régis-Gianas,et al.  A Hoare Logic for Call-by-Value Functional Programs , 2008, MPC.

[19]  Robert Bruce Findler,et al.  Contracts as Pairs of Projections , 2006, FLOPS.

[20]  K. Rustan M. Leino,et al.  A Polymorphic Intermediate Verification Language: Design and Logical Encoding , 2010, TACAS.

[21]  Dana N. Xu Extended static checking for haskell , 2006, Haskell '06.

[22]  Lawrence C. Paulson,et al.  Extending Sledgehammer with SMT Solvers , 2011, CADE.

[23]  Matthias Felleisen,et al.  Correct blame for contracts: no more scapegoating , 2011, POPL '11.

[24]  Nobuko Yoshida,et al.  A compositional logic for polymorphic higher-order functions , 2004, PPDP '04.

[25]  Amr Sabry,et al.  The essence of compiling with continuations , 1993, PLDI '93.

[26]  C. A. R. Hoare,et al.  An Axiomatic Basis for Computer Programming (Reprint) , 2002, Software Pioneers.

[27]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[28]  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).

[29]  Bor-Yuh Evan Chang,et al.  Mixing type checking and symbolic execution , 2010, PLDI '10.

[30]  Manuel Fähndrich,et al.  Static Contract Checking with Abstract Interpretation , 2010, FoVeOOS.

[31]  Nicholas Ayache,et al.  Combining the Coq Proof Assistant with First - Order Decision Procedures , 2006 .

[32]  Cormac Flanagan,et al.  Hybrid type checking , 2006, POPL '06.

[33]  Mark Lillibridge,et al.  Extended static checking for Java , 2002, PLDI '02.

[34]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[35]  Nobuko Yoshida,et al.  Descriptive and Relative Completeness of Logics for Higher-Order Functions , 2006, ICALP.

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

[37]  David A. McAllester,et al.  Sound and complete models of contracts , 2006, Journal of Functional Programming.

[38]  Manfred Kerber How to Prove Higher Order Theorems in First Order Logic , 1991, IJCAI.

[39]  H Xi,et al.  Dependent Types in Practical Programming. Extended Abstract. , 1999 .

[40]  Matthew Might Logic-flow analysis of higher-order programs , 2007, POPL '07.

[41]  Neil D. Jones,et al.  The size-change principle for program termination , 2001, POPL '01.

[42]  Lars Birkedal,et al.  Polymorphism and separation in hoare type theory , 2006, ICFP '06.

[43]  Andrew D. Gordon,et al.  Refinement Types for Secure Implementations , 2008, 2008 21st IEEE Computer Security Foundations Symposium.

[44]  C.-H. Luke Ong,et al.  Verifying higher-order functional programs with pattern-matching algebraic data types , 2011, POPL '11.

[45]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[46]  W. Marsden I and J , 2012 .