Bounded Model Checking for Hyperproperties

Tzu-Han Hsu, César Sánchez, Borzoo Bonakdarpour

Abstract

This paper introduces a bounded model checking (BMC) algorithm for hyperproperties expressed in HyperLTL, which — to the best of our knowledge — is the first such algorithm. Just as the classic BMC technique for LTL primarily aims at finding bugs, our approach also targets identifying counterexamples. BMC for LTL is reduced to SAT solving, because LTL describes a property via inspecting individual traces. Our BMC approach naturally reduces to QBF solving, as HyperLTL allows explicit and simultaneous quantification over multiple traces. We report on successful and efficient model checking, implemented in our tool called HyperQube, of a rich set of experiments on a variety of case studies, including security, concurrent data structures, path planning for robots, and mutation testing.

Introduction

In traditional formal verification, trace properties (expressed in LTL) check if individual executions of a system satisfy a requirement. However, many critical requirements, such as observational determinism in security or linearizability in concurrent systems, are hyperproperties. These describe relationships between multiple executions. For instance, non-interference requires that two runs with identical public inputs but different secret inputs produce the same public outputs.

While Bounded Model Checking (BMC) is a staple for finding bugs in LTL properties by reducing them to SAT queries, it has historically struggled with hyperproperties. Hyperproperties involve quantification over multiple traces (e.g., "for all traces $\pi_1, \pi_2 \dots$"), a structure that does not map cleanly to standard SAT-based BMC without exponential blowup.

Methodology: From SAT to QBF

The core innovation of this work is the reduction of HyperLTL BMC to Quantified Boolean Formula (QBF) solving. Unlike LTL, where a single trace is unrolled, HyperLTL requires reasoning about multiple traces simultaneously. The universal ($\forall$) and existential ($\exists$) quantifiers in HyperLTL map directly to the quantifier alternation available in QBF solvers.

Finite Trace Semantics

To handle the finite "unrolling" of a system up to a bound $k$, the authors define four distinct semantics:

  1. Pessimistic: Assumes eventualities (e.g., "eventually $p$ happens") are never fulfilled beyond the bound. This is ideal for finding counterexamples.
  2. Optimistic: Assumes eventualities are fulfilled beyond the bound, which can be used to prove properties if the query is unsatisfiable.
  3. Halting Variants: These are specialized for systems that eventually terminate. By identifying "halt" states, the tool can make sound and complete decisions on finite traces.
Figure 1: Example of a Kripke structure with halting states used for finite-trace semantics.

The figure above illustrates a Kripke structure where specific states are labeled with halt. This labeling allows the BMC algorithm to distinguish between a trace that has reached a terminal state and one that is simply truncated by the bound $k$.

Implementation: HyperQube

The proposed techniques are implemented in HyperQube. The tool takes a system model (Kripke structure) and a HyperLTL formula, unrolls the system to a specified bound, and generates a QBF query for a solver like QuAbS.

Case Studies and Results

HyperQube was evaluated across several domains:

  • Concurrent Data Structures: It successfully identified subtle linearizability bugs in the SNARK algorithm (a concurrent deque) within 8 to 25 minutes.
  • Security: It verified non-interference in multi-threaded programs, using halting semantics to provide definitive proofs for terminating systems.
  • Robot Path Planning: The tool was used for strategy synthesis. By treating existential trace quantifiers as paths to be found, HyperQube outperformed previous SMT-based methods by an order of magnitude.
  • Symmetry and Fairness: It checked symmetry in Lamport’s Bakery algorithm and non-repudiation in communication protocols.

Conclusion

A key insight is that QBF is the "natural" logic for HyperLTL BMC, avoiding the state-space explosion of previous "flattening" approaches. Furthermore, the use of optimistic semantics allows BMC—traditionally a bug-finding tool—to serve as a proof engine for certain classes of properties. Future work involves integrating abstraction-refinement (CEGAR) loops and leveraging the continued performance improvements in QBF solver technology.

Summary updated

BibTeX
@inproceedings{hsu2021bounded,
  author = {Tzu-Han Hsu and César Sánchez and Borzoo Bonakdarpour},
  title = {{Bounded Model Checking for Hyperproperties}},
  booktitle = {TACAS},
  year = {2021},
  url = {https://openreview.net/forum?id=YX5FPEra6G},
}
Figure