Cascade - (Competition Contribution)

Wei Wang, Clark W. Barrett

Abstract

Cascade is a static analysis tool for C programs that utilizes Bounded Model Checking (BMC) to detect bugs and verify correctness. By employing a novel partitioned memory model based on alias analysis, Cascade decomposes memory into independent regions, significantly enhancing the scalability of SMT solvers compared to traditional flat memory representations. This paper details the architecture and performance of Cascade as presented in the SV-COMP 2015 competition.

Introduction

Verifying C programs is notoriously difficult due to complex memory handling. Tools often use Bounded Model Checking (BMC), translating code into mathematical formulas for SMT (Satisfiability Modulo Theories) solvers. The primary bottleneck is the memory model. While a "flat model" (treating RAM as a single byte array) is precise, it is computationally expensive for solvers, which struggle with disjointness reasoning. This lack of scalability prevents the verification of complex programs.

Methods

Cascade introduces a partitioned memory model to bridge the gap between precision and performance. The tool's workflow is divided into preprocessing and symbolic execution phases.

The Cascade verification pipeline, highlighting the integration of preprocessing for memory partitioning with symbolic execution.

The pipeline consists of the following stages:

  1. Preprocessing & Alias Analysis: Cascade utilizes Steensgaard’s points-to analysis to identify potential aliasing between variables or memory regions.
  2. Memory Partitioning: Based on the analysis, memory is split into independent arrays. Variables that never alias are placed in separate partitions.
  3. Symbolic Execution: The tool performs forward symbolic execution over the program's Abstract Syntax Tree (AST), unrolling loops and inlining functions up to a user-defined bound.
  4. Verification Conditions (VCs): Logic formulas are generated where each memory partition is modeled as a separate SMT array.
  5. SMT Solving: These formulas are processed by solvers such as CVC4 or Z3. If a formula is satisfiable, a bug exists, and Cascade generates a "witness" trace.

Key Insights

  • Divide and Conquer: By proving disjointness upfront via alias analysis, Cascade reduces the solver's burden, allowing it to focus on program logic rather than memory layout.
  • Soundness: Cascade maintains soundness by ensuring potentially aliasing variables remain in the same partition, thus accounting for C's type-unsafe behaviors (e.g., pointer casting).
  • Iterative Deepening: Cascade handles BMC's bounded nature by using successively larger loop unrolls (up to 1024) until a result is reached or a timeout occurs.

Evaluation and Results

Cascade was evaluated using the SV-COMP 2015 benchmark suites, covering Bit Vectors, Control Flow, Heap Manipulation, and Memory Safety.

  • Bug Detection: The tool successfully identified invalid memory accesses, invalid frees, and memory leaks.
  • Competition Performance: Using a timeout of 850 seconds and specific inlining depths (2 for general assertions, 5 for memory safety), Cascade provided definitive SAFE or UNSAFE results, along with GraphML witnesses for debugging.

Limitations and Future Work

While effective, Cascade currently lacks support for floating-point arithmetic, function pointers, and concurrency. Additionally, like all BMC tools, it is susceptible to state explosion if required unrolling depths exceed its bounds (e.g., 1024), potentially leading to false SAFE reports. Future work may involve more advanced symbolic execution techniques to further optimize verification condition generation.

Summary updated

BibTeX
@inproceedings{wang2015cascade,
  author = {Wei Wang and Clark W. Barrett},
  title = {{Cascade - (Competition Contribution)}},
  booktitle = {TACAS},
  year = {2015},
  doi = {10.1007/978-3-662-46681-0\_33},
}
Figure