NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Checking Refinement of Asynchronous Programs Against Context-Free Specifications

Pascal Baumann, Moses Ganardi, Rupak Majumdar, Ramanathan S. Thinniyam, Georg Zetzsche · DOI

Introduction

In the realm of formal verification, ensuring the correctness of complex, concurrent software remains a significant challenge. Modern multithreaded systems often rely on asynchronous programming models where tasks are spawned to execute atomically. A critical aspect of verifying these systems is ensuring they adhere to resource-usage protocols, such as memory management and file handle lifecycle rules. This research, conducted by scientists at the Max Planck Institute for Software Systems (MPI-SWS), addresses the complexity of verifying asynchronous programs against context-free specifications, specifically focusing on Dyck languages.

The Verification Challenge

Asynchronous programs operate by spawning tasks that are added to a buffer and executed one at a time. Because tasks can recursively spawn further tasks, the number of pending operations can grow without bound, leading to an infinite state space. While previous verification techniques could handle regular specifications (modeled by finite-state automata), many essential safety properties are context-free.

A primary example is reference counting, where every resource acquisition (inc) must be matched by a corresponding release (dec). This requirement for balanced operations is mathematically represented by Dyck languages (the language of balanced parentheses). Until this work, the decidability and computational complexity of checking asynchronous implementations against such specifications were not fully understood.

Methodology: Bridging the Complexity Gap

The researchers established that checking whether an asynchronous program follows a Dyck specification is EXPSPACE-complete. To prove this, they employed a multi-stage reduction process:

  1. VASS Inclusion: The problem was first reduced to checking if the language of a Vector Addition System with States (VASS)—a standard model for concurrent systems—is contained within a Dyck language.
  2. Downward Closure: To manage the task-spawning nature of the programs, the authors utilized "downward closure." This technique approximates the complex behavior of individual tasks with simpler regular languages that still capture all potential specification violations.
  3. Tame Pumping: A significant technical hurdle was that the ordering required for Dyck languages does not satisfy the "well-quasi-ordering" (WQO) property, which is usually necessary for infinite-state verification. The authors introduced a new property called tame-pumping for context-free grammars, allowing for the construction of regular approximations from scratch without relying on WQO.
  4. Succinct Representations: To keep memory requirements within the EXPSPACE bound, the algorithm utilizes succinct data structures, including transducers and binary encodings, to manage the vast state space.

Key Insights and Results

The most striking finding is complexity parity: verifying a program against a complex Dyck specification is no more computationally difficult than checking simple reachability (e.g., whether a task buffer can ever become empty). Both problems are EXPSPACE-complete.

Furthermore, the research provides a constructive algorithmic pipeline. By transforming program tasks into regular languages via downward closure and reducing the result to a succinct VASS, the system can systematically check for "offset," "dip," or "mismatch" violations in the resource protocol. The authors grounded these theoretical results by linking the Dyck inclusion problem to real-world design patterns, such as reference counting in Linux device drivers.

Limitations and Future Outlook

While this work marks a major theoretical milestone, several areas remain for future exploration:

  • Atomic Execution: The current model assumes tasks execute to completion without interruption. Extending the theory to "context-switched" models where tasks can be preempted is a necessary next step for broader applicability.
  • General Context-Free Languages: Dyck languages are a subset of context-free languages. Whether these results extend to the entire class of context-free specifications remains an open question.
  • Practical Implementation: Although EXPSPACE is a favorable theoretical bound for this class of problem, practical software model checkers will require further heuristics to handle real-world codebases efficiently.

This research demonstrates that sophisticated resource-usage patterns can be verified with the same theoretical complexity as basic reachability, opening new doors for the automated verification of concurrent systems.

Summary updated

BibTeX
@inproceedings{baumann2023checking,
  author = {Pascal Baumann and Moses Ganardi and Rupak Majumdar and Ramanathan S. Thinniyam and Georg Zetzsche},
  title = {{Checking Refinement of Asynchronous Programs Against Context-Free Specifications}},
  booktitle = {ICALP},
  year = {2023},
  doi = {10.4230/lipics.icalp.2023.110},
}
Figure