Automating Separation Logic with Trees and Data

Separation logic (SL) is a widely used formalism for verifying heap manipulating programs. Existing SL solvers focus on decidable fragments for list-like structures. More complex data structures such as trees are typically unsupported in implementations, or handled by incomplete heuristics. While complete decision procedures for reasoning about trees have been proposed, these procedures suffer from high complexity, or make global assumptions about the heap that contradict the separation logic philosophy of local reasoning. In this paper, we present a fragment of classical first-order logic for local reasoning about tree-like data structures. The logic is decidable in NP and the decision procedure allows for combinations with other decidable first-order theories for reasoning about data. Such extensions are essential for proving functional correctness properties. We have implemented our decision procedure and, building on earlier work on translating SL proof obligations into classical logic, integrated it into an SL-based verification tool. We successfully used the tool to verify functional correctness of tree-based data structure implementations.

[1]  Viktor Kuncak,et al.  An Efficient Decision Procedure for Imperative Tree Data Structures , 2011, CADE.

[2]  Neil Immerman,et al.  Effectively-Propositional Reasoning about Reachability in Linked Data Structures , 2013, CAV.

[3]  Viktor Kuncak,et al.  Full functional verification of linked data structures , 2008, PLDI '08.

[4]  Xiaokang Qiu,et al.  Efficient Decision Procedures for Heaps Using STRAND , 2011, SAS.

[5]  Shengchao Qin,et al.  Automated Verification of Shape and Size Properties Via Separation Logic , 2007, VMCAI.

[6]  Peter W. O'Hearn,et al.  Scalable Shape Analysis for Systems Code , 2008, CAV.

[7]  John McCarthy,et al.  Towards a Mathematical Science of Computation , 1962, IFIP Congress.

[8]  Samin Ishtiaq,et al.  SLAyer: Memory Safety for Systems-Level Code , 2011, CAV.

[9]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[10]  Carsten Ihlemann,et al.  On Local Reasoning in Verification , 2008, TACAS.

[11]  Radu Iosif,et al.  The Tree Width of Separation Logic with Recursive Definitions , 2013, CADE.

[12]  Peter W. O'Hearn,et al.  Smallfoot: Modular Automatic Assertion Checking with Separation Logic , 2005, FMCO.

[13]  Ruzica Piskac,et al.  GRASShopper - Complete Heap Verification with Mixed Specifications , 2014, TACAS.

[14]  Parosh Aziz Abdulla,et al.  Verification of heap manipulating programs with ordered data by extended forest automata , 2015, Acta Informatica.

[15]  Joël Ouaknine,et al.  Tractable Reasoning in a Fragment of Separation Logic , 2011, CONCUR.

[16]  Peter W. O'Hearn,et al.  A Decidable Fragment of Separation Logic , 2004, FSTTCS.

[17]  Thomas Wies,et al.  Complete Instantiation-Based Interpolation , 2013, Journal of Automated Reasoning.

[18]  Pierre Genevès,et al.  Efficient static analysis of XML paths and types , 2007, PLDI '07.

[19]  Tomás Vojnar,et al.  Predator: A Practical Tool for Checking Manipulation of Dynamic Data Structures Using Separation Logic , 2011, CAV.

[20]  Joël Ouaknine,et al.  SeLoger: A Tool for Graph-Based Reasoning in Separation Logic , 2013, CAV.

[21]  Alan J. Hu,et al.  An Inference-Rule-Based Decision Procedure for Verification of Heap-Manipulating Programs with Mutable Data and Cyclic Data Structures , 2007, VMCAI.

[22]  Xiaokang Qiu,et al.  Natural proofs for structure, data, and separation , 2013, PLDI.

[23]  Adam Chlipala,et al.  The bedrock structured programming system: combining generative metaprogramming and hoare logic in an extensible program verifier , 2013, ICFP.

[24]  Harry R. Lewis,et al.  Complexity Results for Classes of Quantificational Formulas , 1980, J. Comput. Syst. Sci..

[25]  Xiaokang Qiu,et al.  Decidable logics combining heap structures and data , 2011, POPL '11.

[26]  Ruzica Piskac,et al.  Automating Separation Logic Using SMT , 2013, CAV.

[27]  Frank Piessens,et al.  VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java , 2011, NASA Formal Methods.

[28]  Alexander Moshe Rabinovich,et al.  Decidable fragments of many-sorted logic , 2010, J. Symb. Comput..

[29]  Shuvendu K. Lahiri,et al.  Back to the future: revisiting precise program verification using SMT solvers , 2008, POPL '08.

[30]  Diego Calvanese,et al.  Reasoning in Expressive Description Logics , 2001, Handbook of Automated Reasoning.

[31]  K. Rustan M. Leino,et al.  Developing verified programs with Dafny , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[32]  Constantin Enea,et al.  A Logic-Based Framework for Reasoning about Composite Data Structures , 2009, CONCUR.

[33]  Neil Immerman,et al.  The Boundary Between Decidability and Undecidability for Transitive-Closure Logics , 2004, CSL.

[34]  Antoine Meyer,et al.  A logic of reachable patterns in linked data-structures , 2006, J. Log. Algebraic Methods Program..

[35]  Neil Immerman,et al.  Modular reasoning about heap paths via effectively propositional formulas , 2014, POPL.

[36]  Antoine Meyer,et al.  A logic of reachable patterns in linked data-structures , 2007, J. Log. Algebraic Methods Program..

[37]  Nils Klarlund,et al.  MONA Version 1.4 - User Manual , 2001 .

[38]  James W. Thatcher,et al.  Generalized finite automata theory with an application to a decision problem of second-order logic , 1968, Mathematical systems theory.

[39]  Amir Pnueli,et al.  Shape Analysis of Single-Parent Heaps , 2007, VMCAI.

[40]  Alan Robinson,et al.  Handbook of automated reasoning , 2001 .

[41]  Peter W. O'Hearn,et al.  Local Reasoning about Programs that Alter Data Structures , 2001, CSL.

[42]  Andrey Rybalchenko,et al.  Separation logic + superposition calculus = heap theorem prover , 2011, PLDI '11.