Advertisement

Abstract Refinement Types

  • Niki Vazou
  • Patrick M. Rondon
  • Ranjit Jhala
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7792)

Abstract

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.

Keywords

Type Check Parametric Invariant Input List Typing Judgment Predicate Abstraction 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Belo, J.F., Greenberg, M., Igarashi, A., Pierce, B.C.: Polymorphic Contracts. In: Barthe, G. (ed.) ESOP 2011. LNCS, vol. 6602, pp. 18–37. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  2. 2.
    Bengtson, J., Bhargavan, K., Fournet, C., Gordon, A.D., Maffeis, S.: Refinement types for secure implementations. ACM TOPLAS 33(2), 8 (2011)CrossRefGoogle Scholar
  3. 3.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer (2004)Google Scholar
  4. 4.
    Constable, R.L.: Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall (1986)Google Scholar
  5. 5.
    Cousot, P., Cousot, R., Logozzo, F.: A parametric segmentation functor for fully automatic and scalable array content analysis. In: POPL, pp. 105–118 (2011)Google Scholar
  6. 6.
    de Moura, L., Bjørner, N.: Z3: An Efficient SMT Solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  7. 7.
    Dunfield, J.: A Unified System of Type Refinements. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, USA (2007)Google Scholar
  8. 8.
    Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: ICFP, pp. 48–59 (2002)Google Scholar
  9. 9.
    Flanagan, C., Joshi, R., Leino, K.R.M.: Annotation inference for modular checkers. Information Processing Letters (2001)Google Scholar
  10. 10.
    Fournet, C., Kohlweiss, M., Strub, P.-Y.: Modular code-based cryptographic verification. In: CCS, pp. 341–350 (2011)Google Scholar
  11. 11.
    Freeman, T., Pfenning, F.: Refinement types for ML. In: PLDI (1991)Google Scholar
  12. 12.
    Gopan, D., Reps, T.W., Sagiv, S.: A framework for numeric analysis of array operations. In: POPL, pp. 338–350 (2005)Google Scholar
  13. 13.
    Graf, S., Saïdi, H.: Construction of Abstract State Graphs with PVS. In: Grumberg, O. (ed.) CAV 1997. LNCS, vol. 1254, pp. 72–83. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  14. 14.
    Guha, A., Fredrikson, M., Livshits, B., Swamy, N.: Verified security for browser extensions. In: IEEE Symposium on Security and Privacy, pp. 115–130 (2011)Google Scholar
  15. 15.
    Jhala, R., McMillan, K.L.: Array Abstractions from Proofs. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 193–206. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  16. 16.
    Kawaguchi, M., Rondon, P., Jhala, R.: Type-based data structure verification. In: PLDI, pp. 304–315 (2009)Google Scholar
  17. 17.
    Knowles, K.W., Flanagan, C.: Hybrid type checking. ACM TOPLAS 32(2) (2010)Google Scholar
  18. 18.
    Meyer, B.: Eiffel: the language. Prentice-Hall, Inc., Upper Saddle River (1992)MATHGoogle Scholar
  19. 19.
    Nelson, G.: Techniques for program verification. Technical Report CSL81-10, Xerox Palo Alto Research Center (1981)Google Scholar
  20. 20.
    Norell, U.: Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers, SE-412 96 Göteborg, Sweden (September 2007)Google Scholar
  21. 21.
    Ou, X., Tan, G., Mandelbaum, Y., Walker, D.: Dynamic Typing with Dependent Types. In: Levy, J.-J., Mayr, E.W., Mitchell, J.C. (eds.) TCS 2004. IFIP, vol. 155, pp. 437–450. Springer, Boston (2004)Google Scholar
  22. 22.
    Pierce, B.C.: Types and Programming Languages. MIT Press (2002)Google Scholar
  23. 23.
    Rondon, P., Kawaguchi, M., Jhala, R.: Liquid types. In: PLDI (2008)Google Scholar
  24. 24.
    Sheard, T.: Type-level computation using narrowing in omega. In: PLPV (2006)Google Scholar
  25. 25.
    Swamy, N., Chen, J., Fournet, C., Strub, P.-Y., Bhargavan, K., Yang, J.: Secure distributed programming with value-dependent types. In: ICFP, pp. 266–278 (2011)Google Scholar
  26. 26.
    Vytiniotis, D., Peyton Jones, S.L., Magalhães, J.: Equality proofs and deferred type errors: a compiler pearl. In: ICFP, pp. 341–352 (2012)Google Scholar
  27. 27.
    Xi, H., Pfenning, F.: Eliminating array bound checking through dependent types. In: PLDI (1998)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Niki Vazou
    • 1
  • Patrick M. Rondon
    • 2
  • Ranjit Jhala
    • 1
  1. 1.UC San DiegoUSA
  2. 2.GoogleUSA

Personalised recommendations