Abstract Refinement Types

We present abstract refinement types which enable quantification over the refinements of data- and function-types. Our key insight is that we can avail of quantification while preserving SMT-based decidability, simply by encoding refinement parameters as uninterpreted propositions within the refinement logic. We illustrate how this mechanism yields a variety of sophisticated means for reasoning about programs, including: parametric refinements for reasoning with type classes, index-dependent refinements for reasoning about key-value maps, recursive refinements for reasoning about recursive data types, and inductive refinements for reasoning about higher-order traversal routines. We have implemented our approach in a refinement type checker for Haskell and present experiments using our tool to verify correctness invariants of various programs.

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

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

[3]  Thomas W. Reps,et al.  A framework for numeric analysis of array operations , 2005, POPL '05.

[4]  Yves Bertot,et al.  Interactive Theorem Proving and Program Development: Coq'Art The Calculus of Inductive Constructions , 2010 .

[5]  Ranjit Jhala,et al.  Array Abstractions from Proofs , 2007, CAV.

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

[7]  MagalhãesJosé Pedro,et al.  Equality proofs and deferred type errors , 2012 .

[8]  Joshua Dunfield,et al.  A unified system of type refinements , 2007 .

[9]  Ranjit Jhala,et al.  Type-based data structure verification , 2009, PLDI '09.

[10]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .

[11]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[12]  David Walker,et al.  Dynamic Typing with Dependent Types , 2004, IFIP TCS.

[13]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

[14]  RepsThomas,et al.  A framework for numeric analysis of array operations , 2005 .

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

[16]  Tim Sheard,et al.  Type-level Computation Using Narrowing in Omegamega , 2007, PLPV@IJCAR.

[17]  Patrick Cousot,et al.  A parametric segmentation functor for fully automatic and scalable array content analysis , 2011, POPL '11.

[18]  Pierre-Yves Strub,et al.  Modular code-based cryptographic verification , 2011, CCS '11.

[19]  Benjamin Livshits,et al.  Verified Security for Browser Extensions , 2011, 2011 IEEE Symposium on Security and Privacy.

[20]  Kenneth Knowles,et al.  Hybrid type checking , 2010, TOPL.

[21]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[22]  Charles Gregory Nelson,et al.  Techniques for program verification , 1979 .

[23]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[24]  Hassen Saïdi,et al.  Construction of Abstract State Graphs with PVS , 1997, CAV.

[25]  Simon L. Peyton Jones,et al.  Equality proofs and deferred type errors: a compiler pearl , 2012, ICFP '12.

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

[27]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[28]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[29]  K. Rustan M. Leino,et al.  Annotation inference for modular checkers , 2001, Inf. Process. Lett..

[30]  StrubPierre-Yves,et al.  Secure distributed programming with value-dependent types , 2011 .

[31]  FindlerRobert Bruce,et al.  Contracts for higher-order functions , 2002 .

[32]  Patrick Maxim Rondon,et al.  Liquid types , 2008, PLDI '08.

[33]  CousotPatrick,et al.  A parametric segmentation functor for fully automatic and scalable array content analysis , 2011 .

[34]  Tim Sheard,et al.  Type - level computation using narrowing in Omega , 2006 .

[35]  Frank Pfenning,et al.  Eliminating array bound checking through dependent types , 1998, PLDI.

[36]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.