Local Reasoning about Programs that Alter Data Structures
Reference: Peter W. O’Hearn, John C. Reynolds & Hongseok Yang. Computer Science Logic (CSL), 2001, LNCS 2142, pp. 1–19. DOI. Paper PDF.
Summary
The paper develops local reasoning for mutable heaps using spatial assertions and small specifications. Separating conjunction, P * R, splits a heap into disjoint portions satisfying its operands. The Frame Rule extends a command’s specification with an untouched portion, subject to a variable-modification condition. Examples include allocation, deallocation, pointer arithmetic and linked structures. This is foundational Separation Logic; the paper treats sequential heap programs, not distributed transaction causality.
Key Ideas
- Small axioms: specify only the cells an atomic command accesses.
- Spatial assertions:
emp describes an empty heap; points-to assertions describe cells; * expresses disjoint composition.
- Framing: infer preservation outside a command’s footprint.
- Safety: fault avoidance matters; describing a footprint is insufficient without suitable command semantics.
Frame Rule
{P} C {Q}
---------------------------
{P * R} C {Q * R}
Modifies(C) ∩ Free(R) = ∅
The side condition protects variables mentioned by the framed assertion. Disjoint heap ownership is expressed through *.
Connections
Architectural Interpretation