skip to main content
10.1145/2628136.2628159acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

A relational framework for higher-order shape analysis

Published: 19 August 2014 Publication History

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.
[2]
N. Benton and B. Leperchey. Relational Reasoning in a Nominal Semantics for Storage. In TLCA, pages 86--101, 2005.
[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.
[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.
[5]
B.-Y. E. Chang and X. Rival. Relational Inductive Shape Analysis. In POPL, pages 247--260, 2008.
[6]
A. Charguraud. The Locally Nameless Representation. Journal of Automated Reasoning, 49(3):363--408, 2012. ISSN 0168-7433.
[7]
D. Dreyer, A. Ahmed, and L. Birkedal. Logical Step-Indexed Logical Relations. In LICS'09, pages 71--80, 2009.
[8]
F. Henglein. Generic Top-down Discrimination for Sorting and Partitioning in Linear Time*. J. Funct. Program., pages 300--374, 2012.
[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.
[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/.
[11]
M. Kawaguchi, P. Rondon, and R. Jhala. Type-based Data Structure Verification. In PLDI, pages 304--315, 2009.
[12]
S. Lindley and C. McBride. Hasochism: The Pleasure and Pain of Dependently Typed Haskell Programming. In Haskell Symposium, pages 81--92, 2013.
[13]
C. McBride. Faking it: Simulating dependent types in Haskell. J. Funct. Program., 12(5):375--392, July 2002.
[14]
M. Might. Shape Analysis in the Absence of Pointers and Structure. In VMCAI, pages 263--278, 2010.
[15]
MLton. http://mlton.org/.
[16]
Objective Caml. http://ocaml.org/.
[17]
C. Okasaki. Purely Functional Data Structures. Cambridge University Press, New York, NY, USA, 1998.
[18]
B. C. Pierce and D. N. Turner. Local Type Inference. ACM Trans. Program. Lang. Syst., 22(1), Jan. 2000.
[19]
R. Piskac, L. de Moura, and N. Bjørner. Deciding Effectively Propositional Logic with Equality. Technical Report MSR-TR-2008-181.
[20]
P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid Types. In PLDI, pages 159--169, 2008.
[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.
[22]
P. Suter, M. Dotta, and V. Kuncak. Decision Procedures for Algebraic Data Types with Abstractions. In POPL, pages 199--210, 2010.
[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.
[24]
The Glasgow Haskell Compiler. https://www.haskell.org/ghc/.
[25]
N. Vazou, P. M. Rondon, and R. Jhala. Abstract Refinement Types. In ESOP, pages 209--228, 2013.
[26]
S. Weirich, B. A. Yorgey, and T. Sheard. Binders Unbound. In ICFP, pages 333--345, 2011.
[27]
H. Xi, C. Chen, and G. Chen. Guarded Recursive Datatype Constructors. In POPL, pages 224--235, 2003.

Cited By

View all
  • (2024)A Pure Demand Operational Semantics with Applications to Program AnalysisProceedings of the ACM on Programming Languages10.1145/36498528:OOPSLA1(1154-1180)Online publication date: 29-Apr-2024
  • (2021)A relational shape abstract domainFormal Methods in System Design10.1007/s10703-021-00366-4Online publication date: 24-Apr-2021
  • (2020)Stable relations and abstract interpretation of higher-order programsProceedings of the ACM on Programming Languages10.1145/34090014:ICFP(1-30)Online publication date: 3-Aug-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming
August 2014
390 pages
ISBN:9781450328739
DOI:10.1145/2628136
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. decidability
  2. dependent types
  3. inductive relations
  4. parametric relations
  5. relational specifications
  6. standard ml

Qualifiers

  • Research-article

Funding Sources

Conference

ICFP'14
Sponsor:

Acceptance Rates

ICFP '14 Paper Acceptance Rate 28 of 85 submissions, 33%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)A Pure Demand Operational Semantics with Applications to Program AnalysisProceedings of the ACM on Programming Languages10.1145/36498528:OOPSLA1(1154-1180)Online publication date: 29-Apr-2024
  • (2021)A relational shape abstract domainFormal Methods in System Design10.1007/s10703-021-00366-4Online publication date: 24-Apr-2021
  • (2020)Stable relations and abstract interpretation of higher-order programsProceedings of the ACM on Programming Languages10.1145/34090014:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2019)Mergeable replicated data typesProceedings of the ACM on Programming Languages10.1145/33605803:OOPSLA(1-29)Online publication date: 10-Oct-2019
  • (2019)Inferring frame conditions with static correlation analysisProceedings of the ACM on Programming Languages10.1145/32903603:POPL(1-29)Online publication date: 2-Jan-2019
  • (2019)A Decidable Logic for Tree Data-Structures with MeasurementsVerification, Model Checking, and Abstract Interpretation10.1007/978-3-030-11245-5_15(318-341)Online publication date: 11-Jan-2019
  • (2017)Beginner's luck: a language for property-based generatorsACM SIGPLAN Notices10.1145/3093333.300986852:1(114-129)Online publication date: 1-Jan-2017
  • (2017)Beginner's luck: a language for property-based generatorsProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009868(114-129)Online publication date: 1-Jan-2017
  • (2017)A Relational Shape Abstract DomainNASA Formal Methods10.1007/978-3-319-57288-8_15(212-229)Online publication date: 9-Apr-2017
  • (2016)Automatically disproving fair termination of higher-order functional programsACM SIGPLAN Notices10.1145/3022670.295191951:9(243-255)Online publication date: 4-Sep-2016
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media