Abstract

Weak memory presents a new challenge for program verification and has resulted in the development of a variety of specialised logics. For C11-style memory models, our previous work has shown that it is possible to extend Hoare logic and Owicki–Gries reasoning to verify correctness of weak memory programs. The technique introduces a set of high-level assertions over C11 states together with a set of basic Hoare-style axioms over atomic weak memory statements (e.g. reads/writes), but retains all other standard proof obligations for compound statements. This paper takes this line of work further by introducing the first deductive verification environment in Isabelle/HOL for C11-like weak memory programs. This verification environment is built on the Nipkow and Nieto’s encoding of Owicki–Gries in the Isabelle theorem prover. We exemplify our techniques over several litmus tests from the literature and two non-trivial examples: Peterson’s algorithm and a read–copy–update algorithm adapted for C11. For the examples we consider, the proof outlines can be automatically discharged using the existing Isabelle tactics developed by Nipkow and Nieto. The benefit here is that programs can be written using a familiar pseudocode syntax with assertions embedded directly into the program.

Highlights

  • Hoare logic [19] is fundamental to understanding the intended design and semantics of sequential programs

  • We introduced the first deductive verification environment for C11 weak memory programs in Isabelle

  • We start by developing the necessary language support for defining C11 programs and have shown that existing operational semantics for the RC11RAR fragment [14] can be encoded in a straightforward manner, which provides an example instantiation

Read more

Summary

Introduction

Hoare logic [19] is fundamental to understanding the intended design and semantics of sequential programs. Mechanised support for Owicki–Gries’ framework has been developed for the Isabelle theorem prover [32] for programs under sequentially consistent memory model by Nipkow and Nieto [30] and is currently included in the standard distribution This mechanisation provides a simple WHILE-language for writing multi-threaded programs and allows program commands to be annotated with assertions. A key advancement in the semantics developed by Doherty et al is a transition relation over states modelled as C11 graphs, allowing program execution to be viewed as an interleaving of program statements as in classical approaches to concurrency They provide a primitive assertion language for expressing properties of such states, which is manually applied to the message passing litmus test and Peterson’s algorithm adapted to C11.

A C11-Style Memory Model
Message Passing
Deductive Reasoning for Weak Memory
Extending Owicki–Gries to C11-Style Memory Models
Syntactic Extension
An Assertion Language for Verifying C11 Programs
Load Buffering
Message-Passing
Read–Read Coherence
Two-Way Message-Passing
Case Studies
Peterson’s Algorithm for C11
Verification and Automation
Related Work
Conclusion
Findings
A Appendix
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call