skip to main content
10.1145/1542476.1542510acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Type-based data structure verification

Authors Info & Claims
Published:15 June 2009Publication History

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.

References

  1. A. W. Appel. SSA is functional programming. SIGPLAN Notices, 33(4), 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L. Augustsson. Cayenne -- a language with dependent types. In ICFP, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. B. E. Chang and X. Rival. Relational inductive shape analysis. In POPL, pages 247--260, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Cui, K. Donnelly, and H. Xi. Ats: A language that combines programming with theorem proving. In FroCos, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Luca de Alfaro. Vec: Extensible, functional arrays for ocaml. http://www.dealfaro.com/vec.html.Google ScholarGoogle Scholar
  6. L. de Moura and N. Bjørner. Z3: An efficient smt solver. In TACAS, pages 337--340, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Joshua Dunfield. A Unified System of Type Refinements. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, USA, 2007.Google ScholarGoogle Scholar
  8. J.C. Filliâtre. Ocaml software. http://www.lri.fr/ filliatr/software.en.html.Google ScholarGoogle Scholar
  9. C. Flanagan. Hybrid type checking. In POPL. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Gulwani, B. McCloskey, and A. Tiwari. Lifting abstract interpreters to quantified logical domains. In POPL, pages 235--246, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. Henglein. Type inference with polymorphic recursion. ACM TOPLAS, 15(2):253--289, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Jhala and R. Majumdar. Bit-level types for high-level reasoning. In FSE. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. K. Lahiri and S. Qadeer. Back to the future: revisiting precise program verification using smt solvers. In POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Lev-Ami and S. Sagiv. TVLA: A system for implementing static analyses. In SAS, LNCS 1824, pages 280--301. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. John McCarthy. Towards a mathematical science of computation. In IFIP Congress, pages 21--28, 1962.Google ScholarGoogle Scholar
  16. Alan Mycroft. Polymorphic type schemes and recursive definitions. In Symposium on Programming, pages 217--228, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Regis-Gianas and F. Pottier. A Hoare logic for call-by-value functional programs. In MPC, 2008. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Rondon, M. Kawaguchi, and R. Jhala. Type based data structure verification. http://pho.ucsd.edu/liquid. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In PLDI, pages 158--169, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. H. Xi. DML code examples. http://www.cs.bu.edu/fac/hwxi/DML/.Google ScholarGoogle Scholar
  23. H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, pages 214--227, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. K. Zee, V. Kuncak, and M. C. Rinard. Full functional verification of linked data structures. In PLDI, pages 349--361, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type-based data structure verification

        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
          PLDI '09: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2009
          492 pages
          ISBN:9781605583921
          DOI:10.1145/1542476
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 44, Issue 6
            PLDI '09
            June 2009
            478 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1543135
            Issue’s Table of Contents

          Copyright © 2009 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 15 June 2009

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate406of2,067submissions,20%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!