Skip to main content
QUICK REVIEW

[Paper Review] Deriving Laws for Developing Concurrent Programs in a Rely-Guarantee Style

Ian J. Hayes, Larissa Meinicke|arXiv (Cornell University)|Mar 28, 2021
Distributed systems and fault toleranceComputer Science4 citations
TL;DR

This paper presents a formal theory for refining shared-memory concurrent programs using rely/guarantee conditions within a wide-spectrum language. It derives a comprehensive set of refinement laws that handle interference on shared variables without assuming atomicity of expression evaluation, enabling correct derivation of fine-grained concurrent algorithms from specifications, with full mechanisation in Isabelle/HOL.

ABSTRACT

This paper presents a theory for the refinement of shared-memory concurrent algorithms from specifications. We augment pre and post condition specifications with Jones' rely and guarantee conditions, all of which are encoded as commands within a wide-spectrum language. Program components are specified using either partial or total correctness versions of postcondition specifications. Operations on shared data structures and atomic machine operations (e.g. compare-and-swap) are specified using an atomic specification command. All the above constructs are defined in terms of a simple core language, based on a small set of primitive commands and a handful of operators. A comprehensive set of laws for refining such specifications to code is derived in the theory. The approach supports fine-grained concurrency, avoiding atomicity assumptions on expression evaluation and assignment commands. The theory has been formalised in Isabelle/HOL, and the refinement laws and supporting lemmas have been proven in Isabelle/HOL.

Motivation & Objective

  • To develop a systematic theory for deriving correct concurrent programs from specifications under interference.
  • To address the challenge of non-deterministic interleavings in fine-grained concurrent algorithms.
  • To provide a compositional framework that separates specification from implementation while preserving correctness under interference.
  • To support both partial and total correctness in the presence of environment interference.
  • To enable mechanised verification of refinement laws using Isabelle/HOL for practical concurrent algorithm development.

Proposed method

  • Augmenting pre- and postconditions with rely and guarantee conditions, all encoded as commands in a wide-spectrum language.
  • Defining all program constructs—including assignments, conditionals, loops, and atomic operations—within a core language based on primitive commands and operators.
  • Introducing atomic specification commands to model low-level operations like compare-and-swap.
  • Deriving refinement laws that support stepwise refinement from abstract specifications to concrete code, even under interference.
  • Mechanising the entire theory and all refinement laws in Isabelle/HOL to ensure correctness and support tool-supported reasoning.
  • Using a lattice-based command model to formally reason about program equivalence and refinement under interference.

Experimental results

Research questions

  • RQ1How can rely/guarantee conditions be systematically integrated into a refinement calculus for concurrent programs?
  • RQ2What refinement laws are needed to safely derive concurrent algorithms when shared variables are subject to interference?
  • RQ3How can atomic operations and data structure manipulations be specified and refined while preserving correctness under interference?
  • RQ4What is the role of stability under interference in ensuring correct postconditions in concurrent settings?
  • RQ5How can the theory be mechanised to support scalable, machine-checked verification of concurrent algorithms?

Key findings

  • The theory successfully derives a comprehensive set of refinement laws that support the development of fine-grained concurrent algorithms without assuming atomicity of expression evaluation.
  • The approach enables correct refinement of operations like set removal under interference by splitting the requirement between postcondition and guarantee.
  • The Isabelle/HOL mechanisation confirms the correctness of all refinement laws and supporting lemmas, enabling trustable verification.
  • The framework supports both partial and total correctness, with distinct laws for each, allowing specification of non-terminating but safe algorithms.
  • The theory is extensible, supporting future additions such as generalised invariants, local variables, and resource-based reasoning for locks and condition variables.
  • The use of a wide-spectrum language with command-based rely/guarantee conditions enables more expressive and modular reasoning than prior approaches.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.