Skip to main content
QUICK REVIEW

[Paper Review] Automating Deductive Verification for Weak-Memory Programs

Alexander J. Summers, Péter Müller|arXiv (Cornell University)|Mar 18, 2017
Logic, programming, and type systemsComputer Science31 references1 citations
TL;DR

This paper presents the first automated deductive verification approach for weak-memory programs by encoding advanced separation logics—Relaxed Separation Logic (RSL), Fenced Separation Logic (FSL), and FSL++—into the Viper verification infrastructure. The method enables fully automated verification of C11 programs with minimal user annotations, achieving verification times under one minute and reducing annotation overhead by one to two orders of magnitude compared to Coq-based proofs.

ABSTRACT

Writing correct programs for weak memory models such as the C11 memory model is challenging because of the weak consistency guarantees these models provide. The first program logics for the verification of such programs have recently been proposed, but their usage has been limited thus far to manual proofs. Automating proofs in these logics via first-order solvers is non-trivial, due to reasoning features such as higher-order assertions, modalities and rich permission resources. In this paper, we provide the first implementation of a weak memory program logic using existing deductive verification tools. We tackle three recent program logics: Relaxed Separation Logic and two forms of Fenced Separation Logic, and show how these can be encoded using the Viper verification infrastructure. In doing so, we illustrate several novel encoding techniques which could be employed for other logics. Our work is implemented, and has been evaluated on examples from existing papers as well as the Facebook open-source Folly library.

Motivation & Objective

  • To address the challenge of verifying weak-memory programs under the C11 memory model, which is difficult due to non-sequentially consistent executions and complex memory operations.
  • To overcome the limitations of existing manual or interactive proofs in Coq, which require high user effort and hinder broader adoption of weak-memory program logics.
  • To enable fully automated verification of C11 programs using deductive verification tools, reducing annotation overhead and increasing scalability.
  • To demonstrate the feasibility and efficiency of encoding modern weak-memory program logics into an existing verification stack like Viper, enabling reuse of mature automation.

Proposed method

  • Encoding RSL, FSL, and FSL++ into Viper’s intermediate verification language, translating complex concurrency and logical features into a simpler sequential logic.
  • Using Viper’s existing verification back-ends to automate proof search, leveraging built-in support for separation logic, permissions, and first-order reasoning.
  • Applying novel encoding techniques for higher-order assertions, modalities, and custom permission structures, including support for counting permissions and bitwise arithmetic.
  • Handling complex patterns like spin loops and fetch-and-add operations natively, without requiring explicit loop invariants in many cases.
  • Manually encoding advanced features such as ghost state and invariants in Viper to simulate future extensions, ensuring compatibility with real-world examples.
  • Validating the encoding on benchmarks from the literature and production code (e.g., Folly library), including error-seeded variants to test soundness.

Experimental results

Research questions

  • RQ1Can modern weak-memory program logics like RSL, FSL, and FSL++ be effectively encoded into an automated verification stack like Viper?
  • RQ2Does encoding these logics into Viper enable fully automated verification with significantly reduced annotation overhead compared to interactive Coq-based proofs?
  • RQ3Can the resulting system verify realistic C11 programs—including complex libraries like Folly’s reader-writer spinlock—efficiently and correctly?
  • RQ4To what extent can the encoding handle advanced features such as custom permission structures, ghost state, and atomic operations without manual intervention?

Key findings

  • The encoding successfully automates verification of C11 programs using RSL, FSL, and FSL++ logics, achieving verification times under one minute on average.
  • Annotation overhead is reduced by one to two orders of magnitude compared to Coq-based mechanized proofs, enabling broader adoption of these logics.
  • The approach verified five out of seven core functions in Facebook’s Folly reader-writer spinlock, with two requiring alternative implementations due to idioms beyond current logic scope.
  • The prototype successfully verified the Rust ARC library with custom permission structures by strengthening access modes and using counting permissions.
  • The encoding supports complex patterns like spin loops and atomic fetch-and-increment operations natively, without requiring explicit loop invariants.

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.