skip to main content
research-article

The ramifications of sharing in data structures

Published:23 January 2013Publication History
Skip Abstract Section

Abstract

Programs manipulating mutable data structures with intrinsic sharing present a challenge for modular verification. Deep aliasing inside data structures dramatically complicates reasoning in isolation over parts of these objects because changes to one part of the structure (say, the left child of a dag node) can affect other parts (the right child or some of its descendants) that may point into it. The result is that finding intuitive and compositional proofs of correctness is usually a struggle. We propose a compositional proof system that enables local reasoning in the presence of sharing.

While the AI "frame problem" elegantly captures the reasoning required to verify programs without sharing, we contend that natural reasoning about programs with sharing instead requires an answer to a different and more challenging AI problem, the "ramification problem": reasoning about the indirect consequences of actions. Accordingly, we present a RAMIFY proof rule that attacks the ramification problem head-on and show how to reason with it. Our framework is valid in any separation logic and permits sound compositional and local reasoning in the context of both specified and unspecified sharing. We verify the correctness of a number of examples, including programs that manipulate dags, graphs, and overlaid data structures in nontrivial ways.

Skip Supplemental Material Section

Supplemental Material

r2d3_talk4.mp4

References

  1. R. Bornat, C. Calcagno, and P. O'Hearn. Local reasoning, separation and aliasing. In SPACE, 2004.Google ScholarGoogle Scholar
  2. R. Bornat, C. Calcagno, and H. Yang. Variables as resource in separation logic. ENTCS, 155, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Bornat. Proving pointer programs in Hoare logic. In MPC, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Cherini and J. O. Blanco. Local reasoning for abstraction and sharing. In SAC, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. C. J. Cheney. A nonrecursive list compacting algorithm. C. ACM, 13(11), 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Calcagno, P. W. O'Hearn, and H. Yang. Local action and abstract separation logic. In LICS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Dockins, A. Hobor, and A. W. Appel. A fresh look at separation algebras and share accounting. In APLAS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Finger. Exploiting constraints in design synthesis. PhD thesis, Stanford University, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. Gast. Developer-oriented correctness proofs - a case study of Cheney's algorithm. In ICFEM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Gardner, S. Maffeis, and G. D. Smith. Towards a program logic for JavaScript. In POPL, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Hobor, A. W. Appel, and F. Zappa Nardelli. Oracle semantics for concurrent separation logic. In ESOP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Hobor, R. Dockins, and A. W. Appel. A logical mix of approximation and separation. In APLAS, ENTCS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Hawblitzel and E. Petrank. Automated verification of practical garbage collectors. In POPL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. S. Ishtiaq and P. W. O'Hearn. BI as an assertion language for mutable data structures. In POPL, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. N. Krishnaswami, L. Birkedal, and J. Aldrich. Verifying event-driven programs using ramified frame properties. In TLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. R. M. Leino. Dafny: An automatic program verifier for functional correctness. In LPAR, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. M. Lucassen and D. K. Gifford. Polymorphic effect systems. In POPL, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. O. Lee, H. Yang, and R. Petersen. Program analysis for overlaid data structures. In CAV, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. N. Marti, R. Affeldt, and A. Yonezawa. Formal verification of the heap manager of an operating system using separation logic. In ICFEM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. F. Mehta and T. Nipkow. Proving pointer programs in higher-order logic. Inf. Comput., 199(1--2), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. H. Mehnert, F. Sieczkowski, L. Birkedal, and P. Sestoft. Formalized verification of snapshotable trees: Separation and sharing. In VSTTE, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Manevich, S. Sagiv, G. Ramalingam, and J. Field. Partially disjunctive heap abstraction. In SAS, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  23. J. C. Reynolds. Intuitionistic reasoning about shared mutable data structure. In Millennial Perspectives in Computer Science, Cornerstones of Computing, 2000.Google ScholarGoogle Scholar
  24. J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. C. Reynolds. A short course on separation logic. http://www.cs.cmu.edu/afs/cs.cmu.edu/project/fox-19/member/jcr/wwwaac2003/notes7.ps, 2003.Google ScholarGoogle Scholar
  26. M. Thielscher. The qualification problem: A solution to the problem of anomalous models. Artificial Intelligence, 131(1), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. N. Torp-Smith, L. Birkedal, and J. C. Reynolds. Local reasoning about a copying garbage collector. ACM TOPLAS, 30(4), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Urquhart. Semantics for relevant logics. J. Symb. Log., 37(1), 1972.Google ScholarGoogle ScholarCross RefCross Ref
  29. V. Vafeiadis. Modular fine-grained concurrency verification. PhD thesis, University of Cambridge, 2007.Google ScholarGoogle Scholar
  30. V. Vafeiadis and M. J. Parkinson. A marriage of rely/guarantee and separation logic. In CONCUR, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. T. Wies, V. Kuncak, P. Lam, A. Podelski, and M. C. Rinard. Field constraint analysis. In VMCAI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. H. Yang. Local Reasoning for Stateful Programs. PhD thesis, University of Illinois, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The ramifications of sharing in data structures

              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 48, Issue 1
                POPL '13
                January 2013
                561 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/2480359
                Issue’s Table of Contents
                • cover image ACM Conferences
                  POPL '13: Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                  January 2013
                  586 pages
                  ISBN:9781450318327
                  DOI:10.1145/2429069

                Copyright © 2013 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 23 January 2013

                Check for updates

                Qualifiers

                • research-article

              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!