A Simple Sequential Reasoning Approach for Sound Modular Verification of Mainstream Multithreaded Programs

  • Authors:
  • Bart Jacobs;Jan Smans;Frank Piessens;Wolfram Schulte

  • Affiliations:
  • DistriNet, Dept. Computer Science, Katholieke Universiteit Leuven, Leuven, Belgium;DistriNet, Dept. Computer Science, Katholieke Universiteit Leuven, Leuven, Belgium;DistriNet, Dept. Computer Science, Katholieke Universiteit Leuven, Leuven, Belgium;Microsoft Research, Redmond, WA, USA

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2007

Quantified Score

Hi-index 0.01

Visualization

Abstract

Reasoning about multithreaded object-oriented programs is difficult, due to the non-local nature of object aliasing, data races, and deadlocks. We propose a programming model that prevents data races and deadlocks, and supports local reasoning in the presence of object aliasing and concurrency. Our programming model builds on the multi-threading and synchronization primitives as they are present in current mainstream languages. Java or C# programs developed according to our model can be annotated by means of stylized comments to make the use of the model explicit. We show that such annotated programs can be formally verified to comply with the programming model. In other words, if the annotated program verifies, the underlying Java or C# program is guaranteed to be free from data races and deadlocks, and it is sound to reason locally about program behavior. Our approach supports immutable objects as well as static fields and static initializers. We have implemented a verifier for programs developed according to our model in a custom build of the Spec# programming system, and have validated our approach on a case study.