Reasoning about expression evaluation under interference
Ian J. Hayes, Cliff B. Jones, Larissa A. Meinicke
TL;DR
The paper tackles the problem of reasoning about expression evaluation under interference in concurrent programs. It introduces a fine-grained, algebraic rely-guarantee framework in which expressions are modeled as non-atomic evaluation commands ⟨|e|⟩_k, enabling precise treatment of multi-variable interference. It provides a comprehensive set of compositional laws for constant, l-value, unary, and binary expressions, along with refinement rules for conditionals and assignments, all without restricting expressions to a single critical reference. The approach is demonstrated through a Fischer-Galler forest example and is formalized and proven in Isabelle/HOL, illustrating practical applicability to trustworthy, concurrent data-structure reasoning. Overall, the work advances safe, compositional reasoning about expression evaluation under interference, avoiding oversimplified atomics and syntactic constraints while strengthening the chain of formal proofs for concurrent programming.
Abstract
Hoare-style inference rules for program constructs permit the copying of expressions and tests from program text into logical contexts. It is known that this requires care even for sequential programs but much more serious issues arise with concurrent programs because of potential interference to the values of variables. The "rely-guarantee" approach tackles the challenge of recording acceptable interference and offers a way to provide safe inference rules for concurrent constructs. This paper shows how the algebraic presentation of rely-guarantee ideas can clarify and formalise the conditions for safely re-using expressions and tests from program text in logical contexts for reasoning about concurrent programs; crucially this extends to handling expressions that reference more than one shared variable. A non-trivial example related to the Fischer-Galler forest representation of equivalence relations is treated.
