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

On Verifying Complex Properties using Symbolic Shape Analysis

Thomas Wies, Viktor Kuncak, Karen Zee, Andreas Podelski, Martin C. RinardarXiv 2006

Introduction

Verifying software that utilizes dynamic memory allocation remains a significant challenge in formal methods. When programs manipulate unbounded data structures—such as linked lists, trees with parent pointers, or skip lists—the "shape" of memory is constantly in flux. To prove such programs correct, a verifier must simultaneously reason about reachability, structural integrity, and data-dependent properties (e.g., sortedness). Historically, this required labor-intensive manual annotation of complex loop invariants.

This paper presents Bohne, a symbolic shape analysis tool designed to automate the verification of these complex properties. By combining specialized decision procedures through a novel "Boolean heap" abstraction, Bohne infers loop invariants for programs manipulating unbounded data structures with minimal manual intervention.

The Challenge of Heap Verification

The difficulty in verifying heap-manipulating programs stems from three primary requirements:

  1. Reachability: Determining if a node is accessible from a specific pointer.
  2. Structural Invariants: Ensuring the data structure maintains its intended form (e.g., ensuring a tree remains acyclic).
  3. Data Properties: Verifying the relationships between values stored within the structure (e.g., maintaining a sorted order).

Existing automated tools often suffer from a trade-off between specialization and precision. Some handle specific structures like lists but fail on trees; others focus on shape but lose track of numerical data. Bohne addresses these limitations by automating invariant discovery across a wide variety of structures using a generalized symbolic approach.

Methodology: The Bohne Framework

Bohne's architecture relies on several key technical innovations in symbolic shape analysis:

Boolean Heaps and Predicate Abstraction

Bohne partitions the heap into "abstract nodes" based on a set of predicates. For instance, a node might be categorized by whether it is reachable from the head of a list. This abstraction transforms an infinite state space into a finite, symbolic representation, allowing the tool to reason about the heap's general structure rather than individual memory cells.

Context-Sensitive Cartesian Post

At the heart of Bohne is the Context-Sensitive Cartesian Post algorithm. Unlike standard predicate abstraction, which precomputes how program statements affect predicates, Bohne recomputes these transitions on-the-fly using the current execution context. This "lazy precision" allows the tool to maintain high accuracy in complex heap configurations without the state explosion typical of eager abstraction.

Decision Procedure Integration

Bohne functions as a "dispatcher" between specialized logic solvers. It utilizes MONA (Monadic Second-Order Logic over trees) to reason about the structural backbone of data structures and CVC Lite to reason about the underlying data (such as integers). This integration allows the solvers to communicate: a structural property proved by MONA can become a premise for CVC Lite to prove a data-related property.

Implementation and Optimization

To ensure practical performance, the authors implemented an optimization suite designed to mitigate the cost of logic queries:

  • Semantic Caching: Results of expensive logic queries are stored and reused, significantly reducing redundant computations across different parts of the analysis.
  • Quantifier Instantiation: Universal formulas are simplified by "plugging in" specific program variables, easing the burden on underlying solvers.
  • Precondition Propagation: A fast initial pass identifies simple invariants that are carried over from the start of a function, streamlining the main analysis.

Experimental Evaluation

The authors evaluated Bohne on a suite of challenging data structure benchmarks, including:

  • Singly and Doubly Linked Lists: Operations such as list reversal and element addition.
  • Trees with Parent Pointers: Structures that are notoriously difficult to verify due to the presence of cycles.
  • Two-level Skip Lists: Complex multi-level pointer structures.
  • Sorted Lists: Verifying that insertion preserves the sorted invariant.

Key Results

Bohne successfully verified all benchmarks, demonstrating both automation and efficiency:

  • Automation: The tool automatically proved that List.reverse produces a valid list and that SortedList.insert maintains order.
  • Performance: Verification was completed in under 90 seconds for most benchmarks on 2006-era hardware. For example, List.reverse took 4 seconds, while the more complex ParentTree.add required 83 seconds.
  • Optimization Impact: The authors demonstrated that their optimizations were vital; for instance, disabling quantifier instantiation slowed the analysis by up to 3.6x.

Conclusion and Future Work

Bohne demonstrates that symbolic shape analysis can effectively automate the verification of complex data structures by bridging the gap between shape and data reasoning. However, some limitations remain. Currently, users must provide the initial "abstraction predicates"—the fundamental building blocks the tool uses to partition the heap. Future research could focus on the automatic discovery of these predicates. Additionally, while Bohne is highly efficient for individual data structures, scaling the analysis to large, multi-module software systems remains an ongoing challenge.

Summary updated

BibTeX
@misc{wies2006verifying,
  author = {Thomas Wies and Viktor Kuncak and Karen Zee and Andreas Podelski and Martin C. Rinard},
  title = {{On Verifying Complex Properties using Symbolic Shape Analysis}},
  year = {2006},
  eprint = {cs/0609104},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/cs/0609104},
}
Figure