ABSTRACT
We present a refinement type-based approach for the static verification of complex data structure invariants. Our approach is based on the observation that complex data structures are typically fashioned from two elements: recursion (e.g., lists and trees), and maps (e.g., arrays and hash tables). We introduce two novel type-based mechanisms targeted towards these elements: recursive refinements and polymorphic refinements. These mechanisms automate the challenging work of generalizing and instantiating rich universal invariants by piggybacking simple refinement predicates on top of types, and carefully dividing the labor of analysis between the type system and an SMT solver. Further, the mechanisms permit the use of the abstract interpretation framework of liquid type inference to automatically synthesize complex invariants from simple logical qualifiers, thereby almost completely automating the verification. We have implemented our approach in dsolve, which uses liquid types to verify ocaml programs. We present experiments that show that our type-based approach reduces the manual annotation required to verify complex properties like sortedness, balancedness, binary-search-ordering, and acyclicity by more than an order of magnitude.
- A. W. Appel. SSA is functional programming. SIGPLAN Notices, 33(4), 1998. Google Scholar
Digital Library
- L. Augustsson. Cayenne -- a language with dependent types. In ICFP, 1998. Google Scholar
Digital Library
- B. E. Chang and X. Rival. Relational inductive shape analysis. In POPL, pages 247--260, 2008. Google Scholar
Digital Library
- S. Cui, K. Donnelly, and H. Xi. Ats: A language that combines programming with theorem proving. In FroCos, 2005. Google Scholar
Digital Library
- Luca de Alfaro. Vec: Extensible, functional arrays for ocaml. http://www.dealfaro.com/vec.html.Google Scholar
- L. de Moura and N. Bjørner. Z3: An efficient smt solver. In TACAS, pages 337--340, 2008. Google Scholar
Digital Library
- Joshua Dunfield. A Unified System of Type Refinements. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, USA, 2007.Google Scholar
- J.C. Filliâtre. Ocaml software. http://www.lri.fr/ filliatr/software.en.html.Google Scholar
- C. Flanagan. Hybrid type checking. In POPL. ACM, 2006. Google Scholar
Digital Library
- S. Gulwani, B. McCloskey, and A. Tiwari. Lifting abstract interpreters to quantified logical domains. In POPL, pages 235--246, 2008. Google Scholar
Digital Library
- F. Henglein. Type inference with polymorphic recursion. ACM TOPLAS, 15(2):253--289, 1993. Google Scholar
Digital Library
- R. Jhala and R. Majumdar. Bit-level types for high-level reasoning. In FSE. ACM, 2006. Google Scholar
Digital Library
- S. K. Lahiri and S. Qadeer. Back to the future: revisiting precise program verification using smt solvers. In POPL, 2008. Google Scholar
Digital Library
- T. Lev-Ami and S. Sagiv. TVLA: A system for implementing static analyses. In SAS, LNCS 1824, pages 280--301. Springer, 2000. Google Scholar
Digital Library
- John McCarthy. Towards a mathematical science of computation. In IFIP Congress, pages 21--28, 1962.Google Scholar
- Alan Mycroft. Polymorphic type schemes and recursive definitions. In Symposium on Programming, pages 217--228, 1984. Google Scholar
Digital Library
- A. Nanevski, G. Morrisett, A. Shinnar, P. Govereau, and L. Birkedal. Ynot: Reasoning with the awkward squad. In ICFP, 2008. C. Okasaki. Purely Functional Data Structures. CUP, 1999.Google Scholar
- B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google Scholar
Digital Library
- Y. Regis-Gianas and F. Pottier. A Hoare logic for call-by-value functional programs. In MPC, 2008. To appear. Google Scholar
Digital Library
- P. Rondon, M. Kawaguchi, and R. Jhala. Type based data structure verification. http://pho.ucsd.edu/liquid. Google Scholar
Digital Library
- P. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In PLDI, pages 158--169, 2008. Google Scholar
Digital Library
- H. Xi. DML code examples. http://www.cs.bu.edu/fac/hwxi/DML/.Google Scholar
- H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, pages 214--227, 1999. Google Scholar
Digital Library
- H. Yang, J. Berdine, C. Calcagno, B. Cook, D. Distefano, and P. W. O'Hearn. Scalable shape analysis for systems code. In CAV, 2008. Google Scholar
Digital Library
- K. Zee, V. Kuncak, and M. C. Rinard. Full functional verification of linked data structures. In PLDI, pages 349--361, 2008. Google Scholar
Digital Library
Index Terms
Type-based data structure verification
Recommendations
Liquid types
PLDI '08: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present Logically Qualified Data Types, abbreviated to Liquid Types, a system that combines Hindley-Milner type inference with Predicate Abstraction to automatically infer dependent types precise enough to prove a variety of safety properties. Liquid ...
Type-based data structure verification
PLDI '09We present a refinement type-based approach for the static verification of complex data structure invariants. Our approach is based on the observation that complex data structures are typically fashioned from two elements: recursion (e.g., lists and ...
Liquid types
PLDI '08We present Logically Qualified Data Types, abbreviated to Liquid Types, a system that combines Hindley-Milner type inference with Predicate Abstraction to automatically infer dependent types precise enough to prove a variety of safety properties. Liquid ...







Comments