Differences between revisions 7 and 8
Revision 7 as of 2011-02-03 20:48:05
Size: 1863
Editor: viktor
Comment:
Revision 8 as of 2011-02-03 20:48:29
Size: 1863
Editor: viktor
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
<<latex($\mbox{h \models P_1 * P_2$ if and only if there exist $h_1, h2$ such that $h = h_1 \uplus h_2$ and $h_1 \models P_1$ and $h_2 \models P_2}$)>> <<latex(\mbox{$h \models P_1 * P_2$ if and only if there exist $h_1, h2$ such that $h = h_1 \uplus h_2$ and $h_1 \models P_1$ and $h_2 \models P_2$})>>

Separation logic

Separation logic is an extension of Hoare's logic oriented to reasoning about mutable data structures (or, programs with dynamically allocated pointers). It enables more compact proofs and specs of imperative programs than before because of its support for local reasoning, where specifications and proofs concentrate on the portion of memory used by a program component, and not the entire global state of the system.

It introduces a new logical connective, *, called separating conjunction and proof rules for handling heap-manipulating commands.

\mbox{$h \models P_1 * P_2$ if and only if there exist $h_1, h2$ such that $h = h_1 \uplus h_2$ and $h_1 \models P_1$ and $h_2 \models P_2$}

The most prominent proof rule is the frame rule:

$$\frac{ \{P\}~C\{Q\} }{ \{P*F\}~C\{Q*F\} }\quad \mathbf{fv}(F)\cap\mathbf{mod}(C) = \emptyset$$

This says that a program that runs correctly with a heap satifying its precondition also runs correctly with a bigger initial heap. Further, it is guaranteed not to touch the additional portion heap.

The best way to start is to read the following survey paper by John Reynolds:

Separation Logic: A Logic for Shared Mutable Data Structures. JC Reynolds. In LICS 2002.

Extensions of separation logic have been devised to better handle:

  • Abstraction (hypothetical frame rule, abstract predicates, context logic)
  • Concurrency (CSL, locks-in-the-heap, RGSep/SAGL/LRG, deny-guarantee)

  • Assembly code
  • Higher-order functions

Separation logic has also been extensively used in semi-automatic and automatic program analyses (often known as shape analyses) for proving functional correctness of programs or simply the absence of certain kinds of runtime errors and/or memory leaks.

ToolSupport

SeparationLogic (last edited 2011-02-07 13:18:06 by viktor)