Deriving Laws for Developing Concurrent Programs in a Rely-Guarantee Style

by   Ian J. Hayes, et al.

In this paper we present a theory for the refinement of shared-memory concurrent algorithms from specifications. Our approach avoids restrictive atomicity contraints. It provides a range of constructs for specifying concurrent programs and laws for refining these to code. We augment pre and post condition specifications with Jones' rely and guarantee conditions, which we encode as commands within a wide-spectrum language. Program components are specified using either partial and total correctness versions of end-to-end 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 four primitive commands and a handful of operators, and for which we have developed an extensive algebraic theory in Isabelle/HOL. For shared memory programs, expression evaluation is subject to fine-grained interference and we have avoided atomicity restrictions other than for read and write of primitive types (words). Expression evaluation and assignment commands are also defined in terms of our core language primitives, allowing laws for reasoning about them to be proven in the theory. Control structures such as conditionals, recursion and loops are all defined in terms of the core language. In developing the laws for refining to such structures from specifications we have taken care to develop laws that are as general as possible; our laws are typically more general than those found in the literature. In developing our concurrent refinement theory we have taken care to focus on the algebraic properties of our commands and operators, which has allowed us to reuse algebraic theories, including well-known theories, such as lattices and boolean algebra, as well as programming-specific algebras, such as our synchronous algebra.



page 1

page 2

page 3

page 4


Handling localisation in rely/guarantee concurrency: An algebraic approach

The rely/guarantee approach of Jones extends Hoare logic with rely and g...

A synchronous program algebra: a basis for reasoning about shared-memory and event-based concurrency

This research started with an algebra for reasoning about rely/guarantee...

Some Challenges of Specifying Concurrent Program Components

The purpose of this paper is to address some of the challenges of formal...

Encoding fairness in a synchronous concurrent program algebra: extended version with proofs

Concurrent program refinement algebra provides a suitable basis for supp...

Convolution and Concurrency

We show how concurrent quantales and concurrent Kleene algebras arise as...

Programs as the Language of Science

Currently it is widely accepted that the language of science is mathemat...

An Efficient Approach to Achieve Compositionality using Optimized Multi-Version Object Based Transactional Systems

In the modern era of multi-core systems, the main aim is to utilize the ...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.