Assume-Guarantee Synthesis for Concurrent Reactive Programs with Partial Information

Roderick Bloem, Krishnendu Chatterjee, Swen Jacobs, Robert Könighofer

Introduction

Writing concurrent software is notoriously difficult due to non-deterministic interleavings and complex process interactions. Reactive synthesis offers a path to automated correctness by generating code from high-level specifications, such as Linear Temporal Logic (LTL). However, traditional synthesis methods often fall into two extremes: cooperative synthesis, which produces brittle code that breaks if other components change, and adversarial synthesis, which is often too restrictive to find a solution.

Assume-Guarantee Synthesis (AGS) provides a robust middle ground. It assumes that other system components are adversarial but will at least adhere to their own specifications. This paper extends AGS to handle partial information, ensuring that synthesized components respect the privacy of local variables in a concurrent system.

Complexity and Decidability

A core contribution of this work is a comprehensive complexity analysis of the AGS problem across three dimensions: informedness (perfect vs. partial), memory (bounded vs. unbounded), and specification type.

Complexity of Assume-Guarantee Synthesis across different memory and information models.

As shown in the table above, the difficulty varies significantly. A critical finding is that while the unbounded memory case with partial information is generally undecidable, the bounded memory case remains manageable (ranging from NP-Complete to PSPACE-Complete). This theoretical insight justifies the authors' focus on "bounded synthesis" as a pragmatic path forward for real-world software.

SMT-Based Bounded Synthesis

To address these computational challenges, the authors propose an algorithm using Satisfiability Modulo Theories (SMT). The process involves:

  1. Program Sketches: Developers provide code templates with "holes" (non-deterministic choices) represented by ?.
  2. Encoding: The synthesis problem is encoded into SMT constraints.
  3. Iterative Bounding: By iteratively increasing the "bound" (the amount of memory or state the synthesized part can use), the tool transforms a potentially undecidable problem into a series of solvable search problems.
  4. Optimization: The tool supports user-defined cost functions, allowing the synthesizer to find the "simplest" or most memory-efficient solution.

Evaluation and Key Results

The tool was evaluated on several classic concurrency benchmarks and real-world case studies:

  • Peterson’s Mutual Exclusion Protocol: The tool successfully synthesized the protocol with local variable constraints in 74 seconds. Without these constraints, previous tools produced "cheating" solutions that relied on global visibility impossible in real distributed systems.
  • Linux Driver Bug Fix: The tool synthesized minimal atomic sections for a Linux i2c driver in 54 seconds, effectively fixing a known real-world race condition.
  • Scalability: For protocols like double buffering, the tool handled buffer sizes up to $N=15$ using bitvectors, demonstrating that SMT-based approaches can manage reasonably complex state logic.

Conclusion

By bridging the gap between theoretical AGS and practical software constraints like partial information and bounded memory, this work enables the creation of more robust and modular concurrent systems. While synthesizing very large-scale systems remains a challenge, the use of bounded synthesis and SMT solvers provides a viable path for automatically fixing concurrency bugs and completing complex program sketches.

Summary updated

BibTeX
@inproceedings{bloem2015assume,
  author = {Roderick Bloem and Krishnendu Chatterjee and Swen Jacobs and Robert Könighofer},
  title = {{Assume-Guarantee Synthesis for Concurrent Reactive Programs with Partial Information}},
  booktitle = {TACAS},
  year = {2015},
  doi = {10.1007/978-3-662-46681-0\_50},
}
Figure