Proving that your C++ code is correct under concurrency
Correctness of code with threads or shared memory: absence of data races, deadlock freedom, linearizability of concurrent data structures.
Change the question
Ranked by: support for this property, stage, coverage of the features you pick, and trust. Tools that work on compiled code rank lower. Ranking as JSON.
-
Write a test-like harness for your C code; CBMC checks every execution up to a loop bound, giving a counterexample or a bounded proof.
Partial.Threads (pthreads or __CPROVER_ASYNC) are explored up to the unwinding bound; sequential consistency by default, with --mm and goto-instrument options for weak memory models and race checks. AWS reported that code using concurrency was outside the scope of their CBMC proofs.
Source Partial — Threads (pthreads or __CPROVER_ASYNC) are explored up to the unwinding bound; sequential consistency by default, with --mm and goto-instrument options for weak memory models and race checks. AWS reported that code using concurrency was outside the scope of their CBMC proofs.- Effort
- Push-button
- Covers
- 5 of 16 C++ features
- Relies on
- A SAT or SMT solver decides; its answer is trusted and no proof certificate is kept. C model built into CBMC; tested by its own regression suite.
Stage 1 · Usable 0/5 strong -
Prove concurrent C++ code correct in the Rocq proof assistant, using a separation logic for C++ built on Iris.
Partial.Built for concurrent C++, but the logic requires every atomic access to be sequentially consistent. Weaker memory orders need extra axioms (BlueRock's NOVA proofs add the iRC11 relaxed-memory logic as axioms).
Source Partial — Built for concurrent C++, but the logic requires every atomic access to be sequentially consistent. Weaker memory orders need extra axioms (BlueRock's NOVA proofs add the iRC11 relaxed-memory logic as axioms).- Effort
- Interactive
- Covers
- 3 of 16 C++ features
- Relies on
- C++ is modeled by BRiCk's own axioms; no published validation against compilers. cpp2v prints Clang's syntax tree into Rocq; cpp2v itself is not verified.
Stage 0 · Research 1/5 strong
No option matches this effort level.
Verify C++, but not this property
- Alive2 — Atomic and volatile loads and stores, atomicrmw, cmpxchg and fence are rejected as unsupported by the LLVM-to-Alive2 converter.
- s2n-bignum — The machine model is sequential and single-core.
- Islaris — The paper states Islaris assumes single-threaded execution.
- LNSym — The machine state is a single sequential processor.
Ask something else about C++
- Everything
- No undefined behavior
- Functional correctness
- Equivalence
- Information flow
- Termination and liveness
New to this? Start with the glossary: auto-activeAuto-active verification. You write specifications and hints in the code; an automatic solver does the proving., interactiveInteractive theorem prover. A proof assistant where you write proofs step by step and the system checks each step., trusted computing baseTrusted computing base (TCB). Everything that must be correct for a proof to mean what it says..