skip to main content
research-article

A relational framework for higher-order shape analysis

Published:19 August 2014Publication History
Skip Abstract Section

Abstract

We propose the integration of a relational specification framework within a dependent type system capable of verifying complex invariants over the shapes of algebraic datatypes. Our approach is based on the observation that structural properties of such datatypes can often be naturally expressed as inductively-defined relations over the recursive structure evident in their definitions. By interpreting constructor applications (abstractly) in a relational domain, we can define expressive relational abstractions for a variety of complex data structures, whose structural and shape invariants can be automatically verified. Our specification language also allows for definitions of parametricrelations for polymorphic data types that enable highly composable specifications and naturally generalizes to higher-order polymorphic functions.

We describe an algorithm that translates relational specifications into a decidable fragment of first-order logic that can be efficiently discharged by an SMT solver. We have implemented these ideas in a type checker called CATALYST that is incorporated within the MLton SML compiler. Experimental results and case studies indicate that our verification strategy is both practical and effective.

References

  1. A. Ahmed. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In ESOP'06, pages 69--83, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. N. Benton and B. Leperchey. Relational Reasoning in a Nominal Semantics for Storage. In TLCA, pages 86--101, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. Benton, A. Kennedy, M. Hofmann, and L. Beringer. Reading, Writing and Relations: Towards Extensional Semantics for Effect Analyses. In APLAS, pages 114--130, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. N. Benton, A. Kennedy, L. Beringer, and M. Hofmann. Relational Semantics for Effect-based Program Transformations: Higher-order Store. In PPDP, pages 301--312, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B.-Y. E. Chang and X. Rival. Relational Inductive Shape Analysis. In POPL, pages 247--260, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Charguraud. The Locally Nameless Representation. Journal of Automated Reasoning, 49(3):363--408, 2012. ISSN 0168-7433.Google ScholarGoogle ScholarCross RefCross Ref
  7. D. Dreyer, A. Ahmed, and L. Birkedal. Logical Step-Indexed Logical Relations. In LICS'09, pages 71--80, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. F. Henglein. Generic Top-down Discrimination for Sorting and Partitioning in Linear Time*. J. Funct. Program., pages 300--374, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. Jeannet, A. Loginov, T. Reps, and M. Sagiv. A relational approach to interprocedural shape analysis. ACM Trans. Program. Lang. Syst., 32(2), Feb. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Kaki and S. Jagannathan. A Relational Framework for Higher-Order Shape Analysis. Technical Report TR-14-002, Purdue University, 2014. URL http://docs.lib.purdue.edu/cstech/1772/.Google ScholarGoogle Scholar
  11. M. Kawaguchi, P. Rondon, and R. Jhala. Type-based Data Structure Verification. In PLDI, pages 304--315, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Lindley and C. McBride. Hasochism: The Pleasure and Pain of Dependently Typed Haskell Programming. In Haskell Symposium, pages 81--92, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. McBride. Faking it: Simulating dependent types in Haskell. J. Funct. Program., 12(5):375--392, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Might. Shape Analysis in the Absence of Pointers and Structure. In VMCAI, pages 263--278, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. MLton. http://mlton.org/.Google ScholarGoogle Scholar
  16. Objective Caml. http://ocaml.org/.Google ScholarGoogle Scholar
  17. C. Okasaki. Purely Functional Data Structures. Cambridge University Press, New York, NY, USA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. C. Pierce and D. N. Turner. Local Type Inference. ACM Trans. Program. Lang. Syst., 22(1), Jan. 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Piskac, L. de Moura, and N. Bjørner. Deciding Effectively Propositional Logic with Equality. Technical Report MSR-TR-2008-181.Google ScholarGoogle Scholar
  20. P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid Types. In PLDI, pages 159--169, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P.-Y. Strub, N. Swamy, C. Fournet, and J. Chen. Self-Certification: Bootstrapping Certified Typecheckers in F* with Coq. In POPL, pages 571--584, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. Suter, M. Dotta, and V. Kuncak. Decision Procedures for Algebraic Data Types with Abstractions. In POPL, pages 199--210, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Swamy, J. Chen, C. Fournet, P.-Y. Strub, K. Bhargavan, and J. Yang. Secure distributed programming with value-dependent types. In ICFP, pages 266--278, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. The Glasgow Haskell Compiler. https://www.haskell.org/ghc/.Google ScholarGoogle Scholar
  25. N. Vazou, P. M. Rondon, and R. Jhala. Abstract Refinement Types. In ESOP, pages 209--228, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Weirich, B. A. Yorgey, and T. Sheard. Binders Unbound. In ICFP, pages 333--345, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. H. Xi, C. Chen, and G. Chen. Guarded Recursive Datatype Constructors. In POPL, pages 224--235, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A relational framework for higher-order shape analysis

        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

        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!