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.
- A. Ahmed. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In ESOP'06, pages 69--83, 2006. Google Scholar
Digital Library
- N. Benton and B. Leperchey. Relational Reasoning in a Nominal Semantics for Storage. In TLCA, pages 86--101, 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- B.-Y. E. Chang and X. Rival. Relational Inductive Shape Analysis. In POPL, pages 247--260, 2008. Google Scholar
Digital Library
- A. Charguraud. The Locally Nameless Representation. Journal of Automated Reasoning, 49(3):363--408, 2012. ISSN 0168-7433.Google Scholar
Cross Ref
- D. Dreyer, A. Ahmed, and L. Birkedal. Logical Step-Indexed Logical Relations. In LICS'09, pages 71--80, 2009. Google Scholar
Digital Library
- F. Henglein. Generic Top-down Discrimination for Sorting and Partitioning in Linear Time*. J. Funct. Program., pages 300--374, 2012. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- M. Kawaguchi, P. Rondon, and R. Jhala. Type-based Data Structure Verification. In PLDI, pages 304--315, 2009. Google Scholar
Digital Library
- S. Lindley and C. McBride. Hasochism: The Pleasure and Pain of Dependently Typed Haskell Programming. In Haskell Symposium, pages 81--92, 2013. Google Scholar
Digital Library
- C. McBride. Faking it: Simulating dependent types in Haskell. J. Funct. Program., 12(5):375--392, July 2002. Google Scholar
Digital Library
- M. Might. Shape Analysis in the Absence of Pointers and Structure. In VMCAI, pages 263--278, 2010. Google Scholar
Digital Library
- MLton. http://mlton.org/.Google Scholar
- Objective Caml. http://ocaml.org/.Google Scholar
- C. Okasaki. Purely Functional Data Structures. Cambridge University Press, New York, NY, USA, 1998. Google Scholar
Digital Library
- B. C. Pierce and D. N. Turner. Local Type Inference. ACM Trans. Program. Lang. Syst., 22(1), Jan. 2000. Google Scholar
Digital Library
- R. Piskac, L. de Moura, and N. Bjørner. Deciding Effectively Propositional Logic with Equality. Technical Report MSR-TR-2008-181.Google Scholar
- P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid Types. In PLDI, pages 159--169, 2008. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- P. Suter, M. Dotta, and V. Kuncak. Decision Procedures for Algebraic Data Types with Abstractions. In POPL, pages 199--210, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- The Glasgow Haskell Compiler. https://www.haskell.org/ghc/.Google Scholar
- N. Vazou, P. M. Rondon, and R. Jhala. Abstract Refinement Types. In ESOP, pages 209--228, 2013. Google Scholar
Digital Library
- S. Weirich, B. A. Yorgey, and T. Sheard. Binders Unbound. In ICFP, pages 333--345, 2011. Google Scholar
Digital Library
- H. Xi, C. Chen, and G. Chen. Guarded Recursive Datatype Constructors. In POPL, pages 224--235, 2003. Google Scholar
Digital Library
Index Terms
A relational framework for higher-order shape analysis
Recommendations
A relational framework for higher-order shape analysis
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programmingWe 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 ...
Parametric higher-order abstract syntax for mechanized semantics
ICFP '08We present parametric higher-order abstract syntax (PHOAS), a new approach to formalizing the syntax of programming languages in computer proof assistants based on type theory. Like higher-order abstract syntax (HOAS), PHOAS uses the meta language's ...
Parametric higher-order abstract syntax for mechanized semantics
ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programmingWe present parametric higher-order abstract syntax (PHOAS), a new approach to formalizing the syntax of programming languages in computer proof assistants based on type theory. Like higher-order abstract syntax (HOAS), PHOAS uses the meta language's ...







Comments