skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Automated lemma synthesis in symbolic-heap separation logic

Published:27 December 2017Publication History
Skip Abstract Section

Abstract

The symbolic-heap fragment of separation logic has been actively developed and advocated for verifying the memory-safety property of computer programs. At present, one of its biggest challenges is to effectively prove entailments containing inductive heap predicates. These entailments are usually proof obligations generated when verifying programs that manipulate complex data structures like linked lists, trees, or graphs.

To assist in proving such entailments, this paper introduces a lemma synthesis framework, which automatically discovers lemmas to serve as eureka steps in the proofs. Mathematical induction and template-based constraint solving are two pillars of our framework. To derive the supporting lemmas for a given entailment, the framework firstly identifies possible lemma templates from the entailment's heap structure. It then sets up unknown relations among each template's variables and conducts structural induction proof to generate constraints about these relations. Finally, it solves the constraints to find out actual definitions of the unknown relations, thus discovers the lemmas. We have integrated this framework into a prototype prover and have experimented it on various entailment benchmarks. The experimental results show that our lemma-synthesis-assisted prover can prove many entailments that could not be handled by existing techniques. This new proposal opens up more opportunities to automatically reason with complex inductive heap predicates.

Skip Supplemental Material Section

Supplemental Material

symbolicheapseparationlogic.webm

References

  1. Aws Albarghouthi, Josh Berdine, Byron Cook, and Zachary Kincaid. 2015. Spatial Interpolants. In European Symposium on Programming (ESOP). 634–660. Google ScholarGoogle ScholarCross RefCross Ref
  2. Rajeev Alur, Rastislav Bodík, Eric Dallal, Dana Fisman, Pranav Garg, Garvit Juniwal, Hadas Kress-Gazit, P. Madhusudan, Milo M. K. Martin, Mukund Raghothaman, Shambwaditya Saha, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2015. Syntax-Guided Synthesis. In Dependable Software Systems Engineering. 1–25.Google ScholarGoogle Scholar
  3. Josh Berdine, Cristiano Calcagno, and Peter W. O’Hearn. 2004. A Decidable Fragment of Separation Logic. In International Conference on Foundations of Software Technology and Theoretical Computer Science (FST TCS). 97–109. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Josh Berdine, Cristiano Calcagno, and Peter W. O’Hearn. 2005a. Smallfoot: Modular Automatic Assertion Checking with Separation Logic. In International Symposium on Formal Methods for Components and Objects. 115–137.Google ScholarGoogle Scholar
  5. Josh Berdine, Cristiano Calcagno, and Peter W. O’Hearn. 2005b. Symbolic Execution with Separation Logic. In Asian Symposium on Programming Languages and Systems (APLAS). 52–68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Josh Berdine, Byron Cook, and Samin Ishtiaq. 2011. SLAyer: Memory Safety for Systems-Level Code. In International Conference on Computer Aided Verification (CAV). 178–183. Google ScholarGoogle ScholarCross RefCross Ref
  7. Marius Bozga, Radu Iosif, and Swann Perarnau. 2010. Quantitative Separation Logic and Programs with Lists. J. Autom. Reasoning 45, 2 (2010), 131–156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. James Brotherston, Dino Distefano, and Rasmus Lerchedahl Petersen. 2011. Automated Cyclic Entailment Proofs in Separation Logic. In International Conference on Automated Deduction (CADE). 131–146. Google ScholarGoogle ScholarCross RefCross Ref
  9. James Brotherston, Carsten Fuhs, Juan A. Navarro Pérez, and Nikos Gorogiannis. 2014. A decision procedure for satisfiability in Separation Logic with inductive predicates. In Joint Meeting of International Conference on Computer Science Logic and Symposium on Logic in Computer Science, CSL-LICS. 25:1–25:10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. James Brotherston, Nikos Gorogiannis, Max I. Kanovich, and Reuben Rowe. 2016. Model checking for Symbolic-Heap Separation Logic with inductive predicates. In Symposium on Principles of Programming Languages (POPL). 84–96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. James Brotherston and Alex Simpson. 2011. Sequent calculi for induction and infinite descent. J. Log. Comput. 21, 6 (2011), 1177–1216. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Alan Bundy. 2001. The Automation of Proof by Mathematical Induction. In Handbook of Automated Reasoning (in 2 volumes). 845–911. Google ScholarGoogle ScholarCross RefCross Ref
  13. Cristiano Calcagno, Dino Distefano, Jérémy Dubreil, Dominik Gabi, Pieter Hooimeijer, Martino Luca, Peter W. O’Hearn, Irene Papakonstantinou, Jim Purbrick, and Dulma Rodriguez. 2015. Moving Fast with Software Verification. In NASA International Symposium on Formal Methods (NFM). 3–11. Google ScholarGoogle ScholarCross RefCross Ref
  14. Wei-Ngan Chin, Cristina David, Huu Hai Nguyen, and Shengchao Qin. 2012. Automated verification of shape, size and bag properties via user-defined predicates in Separation Logic. Science of Computer Programming (SCP) 77, 9 (2012), 1006–1036. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Duc-Hiep Chu, Joxan Jaffar, and Minh-Thai Trinh. 2015. Automatic induction proofs of data-structures in imperative programs. In Conference on Programming Language Design and Implementation (PLDI). 457–466. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Michael Colón, Sriram Sankaranarayanan, and Henny Sipma. 2003. Linear Invariant Generation Using Non-linear Constraint Solving. In International Conference on Computer Aided Verification (CAV). 420–432. Google ScholarGoogle ScholarCross RefCross Ref
  17. Byron Cook, Christoph Haase, Joël Ouaknine, Matthew J. Parkinson, and James Worrell. 2011. Tractable Reasoning in a Fragment of Separation Logic. In International Conference on Concurrency Theory (CONCUR). 235–249. Google ScholarGoogle ScholarCross RefCross Ref
  18. Dino Distefano and Matthew J. Parkinson. 2008. jStar: towards practical verification for java. 213–226.Google ScholarGoogle Scholar
  19. Constantin Enea, Ondrej Lengál, Mihaela Sighireanu, and Tomás Vojnar. 2014. Compositional Entailment Checking for a Fragment of Separation Logic. In Asian Symposium on Programming Languages and Systems (APLAS). 314–333. Google ScholarGoogle ScholarCross RefCross Ref
  20. Constantin Enea, Mihaela Sighireanu, and Zhilin Wu. 2015. On Automated Lemma Generation for Separation Logic with Inductive Definitions. In International Symposium on Automated Technology for Verification and Analysis (ATVA). 80–96. Google ScholarGoogle ScholarCross RefCross Ref
  21. Radu Iosif, Adam Rogalewicz, and Jiri Simácek. 2013. The Tree Width of Separation Logic with Recursive Definitions. In International Conference on Automated Deduction (CADE). 21–38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Radu Iosif, Adam Rogalewicz, and Tomás Vojnar. 2014. Deciding Entailments in Inductive Separation Logic with Tree Automata. In International Symposium on Automated Technology for Verification and Analysis (ATVA). 201–218. Google ScholarGoogle ScholarCross RefCross Ref
  23. Quang Loc Le, Jun Sun, and Wei-Ngan Chin. 2016. Satisfiability Modulo Heap-Based Programs. In International Conference on Computer Aided Verification (CAV). 382–404. Google ScholarGoogle ScholarCross RefCross Ref
  24. Leonardo Mendonça De Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In International Conference on Tools and Algorithms for Construction and Analysis of Systems (TACAS). 337–340.Google ScholarGoogle ScholarCross RefCross Ref
  25. Huu Hai Nguyen and Wei-Ngan Chin. 2008. Enhancing Program Verification with Lemmas. In International Conference on Computer Aided Verification (CAV). 355–369. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. 2001. Local Reasoning about Programs that Alter Data Structures. In International Conference on Computer Science Logic (CSL). 1–19. Google ScholarGoogle ScholarCross RefCross Ref
  27. Juan Antonio Navarro Pérez and Andrey Rybalchenko. 2011. Separation Logic + Superposition Calculus = Heap Theorem Prover. In Conference on Programming Language Design and Implementation (PLDI). 556–566.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Juan Antonio Navarro Pérez and Andrey Rybalchenko. 2013. Separation Logic Modulo Theories. In Asian Symposium on Programming Languages and Systems (APLAS). 90–106.Google ScholarGoogle Scholar
  29. Ruzica Piskac, Thomas Wies, and Damien Zufferey. 2013. Automating Separation Logic Using SMT. In International Conference on Computer Aided Verification (CAV). 773–789. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Ruzica Piskac, Thomas Wies, and Damien Zufferey. 2014. Automating Separation Logic with Trees and Data. In International Conference on Computer Aided Verification (CAV). 711–728. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Xiaokang Qiu, Pranav Garg, Andrei Stefanescu, and Parthasarathy Madhusudan. 2013. Natural proofs for structure, data, and separation. In Conference on Programming Language Design and Implementation (PLDI). 231–242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. John C. Reynolds. 2002. Separation Logic: A Logic for Shared Mutable Data Structures. In Symposium on Logic in Computer Science (LICS). 55–74. Google ScholarGoogle ScholarCross RefCross Ref
  33. John C. Reynolds. 2008. An Introduction to Separation Logic. Lecture Notes for the PhD Fall School on Logics and Semantics of State, Copenhagen 2008. Retrieved on 2017, March 16th. http://www.cs.cmu.edu/~jcr/copenhagen08.pdfGoogle ScholarGoogle Scholar
  34. Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley & Sons, Inc., New York, NY, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Mihaela Sighireanu and David R. Cok. 2016. Report on SL-COMP 2014. Journal on Satisfiability, Boolean Modeling and Computation 9 (2016), 173–186.Google ScholarGoogle ScholarCross RefCross Ref
  36. Quang-Trung Ta, Ton Chanh Le, Siau-Cheng Khoo, and Wei-Ngan Chin. 2016. Automated Mutual Explicit Induction Proof in Separation Logic. In International Symposium on Formal Methods (FM). 659–676. Google ScholarGoogle ScholarCross RefCross Ref
  37. Quang-Trung Ta, Ton Chanh Le, Siau-Cheng Khoo, and Wei-Ngan Chin. 2017. Automated Lemma Synthesis in SymbolicHeap Separation Logic. Technical Report (2017). https://arxiv.org/abs/1710.09635Google ScholarGoogle Scholar
  38. Alfred North Whitehead and Bertrand Russell. 1912. Principia Mathematica. University Press.Google ScholarGoogle Scholar

Index Terms

  1. Automated lemma synthesis in symbolic-heap separation logic

            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!