The Relationship between Separation Logic and Implicit Dynamic Frames

Separation logic is a concise method for specifying programs that manipulate dynamically allocated storage. Partially inspired by separation logic, Implicit Dynamic Frames has recently been proposed, aiming at first-order tool support. In this paper, we precisely connect the semantics of these two logics. We define a logic whose syntax subsumes both that of a standard separation logic, and that of implicit dynamic frames as sub-syntaxes. We define a total heap semantics for our logic, and, for the separation logic subsyntax, prove it equivalent the standard partial heaps model. In order to define a semantics which works uniformly for both subsyntaxes, we define the novel concept of a minimal state extension, which provides a different (but equivalent) definition of the semantics of separation logic implication and magic wand connectives, while also giving a suitable semantics for these connectives in implicit dynamic frames. We show that our resulting semantics agrees with the existing definition of weakest pre-condition semantics for the implicit dynamic frames fragment. Finally, we show that we can encode the separation logic fragment of our logic into the implicit dynamic frames fragment, preserving semantics. For the connectives typically supported by tools, this shows that separation logic can be faithfully encoded in a first-order automatic verification tool (Chalice).

[1]  Jan Smans Specification and Automatic Verification of Frame Properties for Java-like Programs (Specificatie en automatische verificatie van frame eigenschappen voor Java-achtige programma's) ; Specification and Automatic Verification of Frame Properties for Java-like Programs , 2009 .

[2]  K. Rustan M. Leino,et al.  A Basis for Verifying Multi-threaded Programs , 2009, ESOP.

[3]  ParkinsonMatthew,et al.  Permission accounting in separation logic , 2005 .

[4]  Peter W. O'Hearn,et al.  Permission accounting in separation logic , 2005, POPL '05.

[5]  Nick Benton,et al.  Relational Reasoning in a Nominal Semantics for Storage , 2005, TLCA.

[6]  Ioannis T. Kassios A theory of object oriented refinement , 2006 .

[7]  K. Rustan M. Leino,et al.  Dafny: An Automatic Program Verifier for Functional Correctness , 2010, LPAR.

[8]  Frank Piessens,et al.  Implicit Dynamic Frames: Combining Dynamic Frames and Separation Logic , 2009, ECOOP.

[9]  Peter W. O'Hearn,et al.  BI as an assertion language for mutable data structures , 2001, POPL '01.

[10]  Matthew J. Parkinson,et al.  The Relationship between Separation Logic and Implicit Dynamic Frames , 2011, ESOP.

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

[12]  John Tang Boyland,et al.  Checking Interference with Fractional Permissions , 2003, SAS.

[13]  Frank Piessens,et al.  Heap-Dependent Expressions in Separation Logic , 2010, FMOODS/FORTE.

[14]  Ioannis T. Kassios Dynamic Frames: Support for Framing, Dependencies and Sharing Without Restrictions , 2006, FM.

[15]  YangHongseok,et al.  Separation and information hiding , 2004 .

[16]  Anindya Banerjee,et al.  Regional Logic for Local Reasoning about Global Invariants , 2008, ECOOP.

[17]  Peter W. O'Hearn,et al.  Resources, Concurrency and Local Reasoning , 2004, CONCUR.

[18]  Peter W. O'Hearn,et al.  Separation and information hiding , 2004, POPL.

[19]  Andrew W. Appel,et al.  Separation Logic for Small-Step cminor , 2007, TPHOLs.

[20]  Matthew J. Parkinson,et al.  Local reasoning for Java , 2005 .