Abstract local reasoning for program modules

  • Authors:
  • Thomas Dinsdale-Young;Philippa Gardner;Mark Wheelhouse

  • Affiliations:
  • Imperial College London;Imperial College London;Imperial College London

  • Venue:
  • CALCO'11 Proceedings of the 4th international conference on Algebra and coalgebra in computer science
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Hoare logic is an important tool for formally proving correctness properties of programs. It takes advantage of modularity by treating program fragments in terms of provable specifications. However, heap programs tend to break this type of modular reasoning by permitting pointer aliasing. For instance, the specification that a program reverses one list does not imply that it leaves a second list alone. To achieve this disjointness property, it is necessary to establish disjointness conditions throughout the proof. O'Hearn, Reynolds, and Yang introduced separation logic for reasoning locally about heap programs, in order to address this problem. The fundamental principle of local reasoning is that, if we know how a local computation behaves on some state, then we can infer the behaviour when the state is extended: it simply leaves the additional state unchanged. A program is specified in terms of its footprint -- the resource necessary for it to operate -- and a frame rule is used to infer that any additional resource is indeed unchanged. For example, given a proof that a program reverses a list, the frame rule can directly establish that the program leaves a second disjoint list alone. Consequently, separation logic enables modular reasoning about heap programs.