BI as an assertion language for mutable data structures

Samin Ishtiaq, Peter W. O’Hearn

2001 · 281 citations · 18 references

Concepts

TL;DR

Reynolds’ logic for mutable data structures uses intuitionistic logic enriched with a spatial conjunction to express pre‑ and postconditions. The authors examine this logic through the lens of BI (bunched implications) and investigate the completeness of its axioms. They relate the intuitionistic and classical systems via a translation akin to that from intuitionistic logic to modal S4, add an operation and axiom for memory disposal, and exploit a local character that allows automatic inference of frame axioms. The study shows the logic is compatible with classical logic, uses BI’s spatial implication to express weakest preconditions for object assignments, proves a cons‑cell allocation axiom complete under a dangling‑pointer interpretation, and demonstrates that local specifications enable automatic inference of heap‑invariant frame axioms.

Abstract

Reynolds has developed a logic for reasoning about mutable data structures in which the pre- and postconditions are written in an intuitionistic logic enriched with a spatial form of conjunction. We investigate the approach from the point of view of the logic BI of bunched implications of O'Hearn and Pym. We begin by giving a model in which the law of the excluded middle holds, thus showing that the approach is compatible with classical logic. The relationship between the intuitionistic and classical versions of the system is established by a translation, analogous to a translation from intuitionistic logic into the modal logic S4. We also consider the question of completeness of the axioms. BI's spatial implication is used to express weakest preconditions for object-component assignments, and an axiom for allocating a cons cell is shown to be complete under an interpretation of triples that allows a command to be applied to states with dangling pointers. We make this latter a feature, by incorporating an operation, and axiom, for disposing of memory. Finally, we describe a local character enjoyed by specifications in the logic, and show how this enables a class of frame axioms, which say what parts of the heap don't change, to be inferred automatically.

References

18