Formal semanticsmodels C++

BRiCk C++ semantics

Also known as BRiCk program logic

A separation-logic semantics of a large part of C++, written as weakest-precondition rules in Rocq on top of Iris. It is the model behind the BRiCk toolchain.

Stage 0 · Mechanized Written in Rocq (Iris separation logic) Open source · LGPL-2.1 with the BedRock netw… Last commit · today

What it covers

Models
C++, C++ as parsed by Clang 20 to 23; the documentation names no single C++ standard version.
Fragment
C++ as seen through Clang's syntax tree, after template instantiation: classes, virtual calls, constructors and destructors, sequentially consistent atomics and IEEE floats. Not covered: exceptions, coroutines, virtual inheritance, member pointer operators, inline assembly, relaxed atomics and initialization of globals. The features page lists every gap.
Written in
Rocq (Iris separation logic)
Usable in
Rocq
Validation
No published validation against compilers or conformance tests was found. The rules are stated as about 450 Rocq axioms, so they cannot be run on programs. A model of parts of the axioms exists, with 8 lemmas still unproved (Admitted). The project keeps its own regression tests, and known soundness bugs are tracked publicly with a "soundness" label.
Maintained by
SkyLabs AI

Stage

Computed from the evidence below; see the criteria. MechanizedMechanized. Written in a form a computer can check, rather than on paper. means a computer can check the definition.

Stage 0 Mechanized Met
  • Met: Machine-checked or machine-readable definition evidence
  • Met: Fragment and version are stated The features page lists supported and unsupported constructs as of October 2026, relative to Clang's syntax tree. It names no C++ standard version. evidence
Stage 1 Validated Next
  • Not met: Can be executed or tested The semantics is a set of axioms in weakest-precondition style; it cannot run programs.
  • Not met: Published results against conformance tests or real implementations No published conformance or differential-testing results.
Stage 2 Authoritative Later
  • Not met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: no; full coverage: no; tracks new versions: no. Not adopted or endorsed by the ISO C++ committee. Exceptions, coroutines, virtual inheritance and other features are not covered. No stated policy for new C++ versions. cpp2v does follow new Clang releases (Clang 23 support added 2026-11-05).

Coverage

Which parts of C++ the model defines.

Common features

Common features
FeatureSupportNotes
Machine integers Fixed-width integer arithmetic, overflow and bit operations. SupportedSupported.All integer types are modeled by size and signedness; the sizes come from the Clang target.
Source
All integer types are modeled by size and signedness; the sizes come from the Clang target. source
Floating point IEEE 754 floating-point arithmetic, including rounding and NaNs. PartialPartial.IEEE-754 half, single, double and quad precision via the Flocq library; x87 long double is abstract.
Source
IEEE-754 half, single, double and quad precision via the Flocq library; x87 long double is abstract. source
Heap and pointers Dynamically allocated memory, pointers or references, and aliasing. SupportedSupported.new, delete, pointers and pointer provenance are modeled; reinterpret_cast has no rule yet.
Source
new, delete, pointers and pointer provenance are modeled; reinterpret_cast has no rule yet. source
Arrays and buffers Indexed memory such as arrays, slices, vectors and byte buffers. PartialPartial.Implicit copy assignment of byte arrays has no working rule; variable-length arrays and flexible array members (compiler extensions) are not supported.
Source
Implicit copy assignment of byte arrays has no working rule; variable-length arrays and flexible array members (compiler extensions) are not supported. source
Loops Unbounded loops, which need invariants or bounds to verify. Supported
Recursion Functions that call themselves, directly or through others. UnknownUnknown.The documentation we found does not discuss recursive functions. The documentation we found does not discuss recursive functions.
Higher-order code Function pointers, closures and callbacks. PartialPartial.Calls through function pointers are modeled; calls through member function pointers are not.
Source
Calls through function pointers are modeled; calls through member function pointers are not. source
Threads and shared memory Concurrent threads with locks, atomics or message passing. PartialPartial.Concurrency is modeled, but only sequentially consistent atomics; weak memory is planned.
Source
Concurrency is modeled, but only sequentially consistent atomics; weak memory is planned. source
I/O and system calls Files, network, system calls and foreign-function calls. PartialPartial.No model of I/O or system calls; calls to outside functions (including variadic ones such as printf) are given specifications by the user.
Source
No model of I/O or system calls; calls to outside functions (including variadic ones such as printf) are given specifications by the user. source
Standard library Specifications or models for the language's standard library. PartialPartial.The standard library is not part of the semantics; the separate brick-libcpp project specifies parts of it.
Source
The standard library is not part of the semantics; the separate brick-libcpp project specifies parts of it. source

C++-specific features

C++-specific features
FeatureSupportNotes
Classes and virtual calls Inheritance, virtual functions and dynamic dispatch. PartialPartial.Classes, inheritance and virtual dispatch are modeled. Virtual inheritance is not; classes with bit-fields are opaque; dynamic_cast and typeid are partial.
Source
Classes, inheritance and virtual dispatch are modeled. Virtual inheritance is not; classes with bit-fields are opaque; dynamic_cast and typeid are partial. source
Templates Generic code instantiated at compile time. PartialPartial.Only instantiated templates are modeled; parameter packs and unresolved concepts are not.
Source
Only instantiated templates are modeled; parameter packs and unresolved concepts are not. source
Constructors and destructors Object lifetimes, RAII and destructor ordering. PartialPartial.Constructors, destructors and implicit destruction are modeled; lifetime-extended temporaries and initialization of globals are not.
Source
Constructors, destructors and implicit destruction are modeled; lifetime-extended temporaries and initialization of globals are not. source
Exceptions throw, catch and stack unwinding. Not supportedNot supported.throw and try are not modeled, and calls are assumed not to throw.
Source
throw and try are not modeled, and calls are assumed not to throw. source
Standard library (STL) Containers, iterators and algorithms from the C++ standard library. PartialPartial.Not part of the semantics; brick-libcpp specifies parts of the standard library.
Source
Not part of the semantics; brick-libcpp specifies parts of the standard library. source
Lambdas Anonymous functions with captures. PartialPartial.cpp2v translates lambdas, but lambda types at global scope are dropped as unsupported.
Source
cpp2v translates lambdas, but lambda types at global scope are dropped as unsupported. source

Used by

Toolchains in this index whose proofs are about this model.

  • BRiCk Prove concurrent C++ code correct in the Rocq proof assistant, using a separation logic for C++ built on Iris.

Sources

esc