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

03/29/2021
by   Ian J. Hayes, et al.
0

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.

READ FULL TEXT

Authors

page 1

page 2

page 3

page 4

07/09/2019

Handling localisation in rely/guarantee concurrency: An algebraic approach

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

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...
10/23/2018

Some Challenges of Specifying Concurrent Program Components

The purpose of this paper is to address some of the challenges of formal...
05/04/2018

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

Concurrent program refinement algebra provides a suitable basis for supp...
02/06/2020

Convolution and Concurrency

We show how concurrent quantales and concurrent Kleene algebras arise as...
11/13/2018

Programs as the Language of Science

Currently it is widely accepted that the language of science is mathemat...
05/03/2019

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.