skip to main content
research-article

Liquid types

Authors Info & Claims
Published:07 June 2008Publication History
Skip Abstract Section

Abstract

We 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 types allow programmers to reap many of the benefits of dependent types, namely static verification of critical properties and the elimination of expensive run-time checks, without the heavy price of manual annotation. We have implemented liquid type inference in DSOLVE, which takes as input an OCAML program and a set of logical qualifiers and infers dependent types for the expressions in the OCAML program. To demonstrate the utility of our approach, we describe experiments using DSOLVE to statically verify the safety of array accesses on a set of OCAML benchmarks that were previously annotated with dependent types as part of the DML project. We show that when used in conjunction with a fixed set of array bounds checking qualifiers, DSOLVE reduces the amount of manual annotation required for proving safety from 31% of program text to under 1%.

References

  1. Tilak Agerwala and Jayadev Misra. Assertion graphs for verifying and synthesizing programs. Technical Report 83, University of Texas, Austin, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L. Augustsson. Cayenne - a language with dependent types. In ICFP, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Ball and S.K. Rajamani. The SLAM project: debugging system software via static analysis. In POPL, pages 1--3. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Chaki, E. M. Clarke, A. Groce, J. Ouaknine, O. Strichman, and K. Yorav. Efficient verification of sequential and concurrent c programs. FMSD, 25(2-3):129--166, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B. Chin, S. Markstrum, T. D. Millstein, and J. Palsberg. Inference of user-defined type qualifiers and qualifier rules. In ESOP, pages 264--278, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. M. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. Counterexample-guided abstraction refinement. In CAV, LNCS 1855, pages 154--169. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. L. Damas and R. Milner. Principal type-schemes for functional programs. In POPL, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E.W. Dijkstra. A Discipline of Programming. Prentice-Hall, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. Dutertre and L. De Moura. Yices SMT solver. http://yices.csl.sri.com/.Google ScholarGoogle Scholar
  10. C. Flanagan. Hybrid type checking. In POPL. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Flanagan and S. Qadeer. Predicate abstraction for software verification. In POPL. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Flanagan, A. Sabry, B. F. Duba, and M. Felleisen. The essence of compiling with continuations. In PLDI, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J.S. Foster. Type Qualifiers: Lightweight Specifications to Improve Software Quality. PhD thesis, U.C. Berkeley, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Freeman and F. Pfenning. Refinement types for ML. In PLDI, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Graf and H. Saïdi. Construction of abstract state graphs with PVS. In CAV, LNCS 1254, pages 72--83. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T.A. Henzinger, R. Jhala, R. Majumdar, and K.L. McMillan. Abstractions from proofs. In POPL 04. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. F. Ivancic, I. Shlyakhter, A. Gupta, and M. K. Ganai. Model checking c programs using f-soft. In ICCD, pages 297--308, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. K. Knowles and C. Flanagan. Type reconstruction for general refinement types. In ESOP, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Lincoln and J. C. Mitchell. Algorithmic aspects of type inference with subtypes. In POPL, Albequerque, New Mexico, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Martin-Lof. Constructive mathematics and computer programming. Royal Society of London Philosophical Transactions Series A, 312:501--518, October 1984.Google ScholarGoogle ScholarCross RefCross Ref
  21. G. Nelson. Techniques for program verification. Technical Report CSL81-10, Xerox Palo Alto Research Center, 1981.Google ScholarGoogle Scholar
  22. X. Ou, G. Tan, Y. Mandelbaum, and D. Walker. Dynamic typing with dependent types. In IFIP TCS, pages 437--450, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  23. F. Pottier. Simplifying subtyping constraints. In ICFP, New York, NY, USA, 1996. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. Technical Report CSE Tech Report, UCSD, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Sulzmann, M. Odersky, and M. Wehr. Type inference with constrained types. In FOOL, 1997.Google ScholarGoogle Scholar
  26. H. Xi. DML code examples. http://www.cs.bu.edu/fac/hwxi/DML/.Google ScholarGoogle Scholar
  27. H. Xi and F. Pfenning. Eliminating array bound checking through dependent types. In PLDI, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, pages 214--227, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Xie and A. Aiken. Scalable error detection using boolean satisfiability. In POPL, pages 351--363, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Liquid types

              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

              Full Access

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 43, Issue 6
                PLDI '08
                June 2008
                382 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/1379022
                Issue’s Table of Contents
                • cover image ACM Conferences
                  PLDI '08: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation
                  June 2008
                  396 pages
                  ISBN:9781595938602
                  DOI:10.1145/1375581
                  • General Chair:
                  • Rajiv Gupta,
                  • Program Chair:
                  • Saman Amarasinghe

                Copyright © 2008 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 7 June 2008

                Check for updates

                Qualifiers

                • research-article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader