# CBMC

> Bounded model checker for C and C++ programs that verifies assertions, memory safety and undefined behavior.

CBMC is an open-source Bounded Model Checker for C and C++ programs, hosted by the diffblue organization on GitHub. It explores all paths through code for all inputs within a bound and checks that assertions hold, with the latest release listed as cbmc-6.11.0.

## What It Is

CBMC is a formal verification tool for C and C++. According to its documentation, it explores all possible paths through your code on all possible inputs and checks that all assertions are true. It can also check for memory safety errors such as buffer overflows and for undefined behavior such as signed integer overflow. Because it is a bounded model checker, using it may require restricting inputs to some bounded size, and the result is assurance that the code behaves as expected for all such inputs.

## How Verification Works

The README states that verification is performed by unwinding the loops in the program and passing the resulting equation to a decision procedure. It checks array bounds, pointer safety, exceptions and user-specified assertions. It supports C89, C99, most of C11, C17, C23 and most compiler extensions from gcc and Visual Studio. It also supports SystemC using Scoot and can check C and C++ for consistency with other languages such as Verilog. The documentation also covers code contracts in CBMC.

## Installation and Documentation

Windows users can install binaries from .msi packages on the releases page. Linux users can use distribution repositories, the .deb package from each release, or compile from source. On macOS it is available through Homebrew. The documentation site includes an Installation Guide, User Guide, Reference Guide and Developer Guide, plus generated CProver source documentation.

## Features
- Bounded model checking of C and C++ programs
- Assertion checking
- Array bounds and buffer overflow checking
- Pointer safety checking
- Exception checking
- Undefined behavior detection such as signed integer overflow
- Supports C89, C99, most of C11, C17, C23 and gcc/Visual Studio extensions
- SystemC support using Scoot
- Consistency checking against other languages such as Verilog
- Code contracts

## Integrations
Homebrew, SystemC, Verilog

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Open Source

## Version
cbmc-6.11.0

## Links
- Website: https://diffblue.github.io/cbmc
- Documentation: https://diffblue.github.io/cbmc/index.html
- Repository: https://github.com/diffblue/cbmc
- EveryDev.ai: https://www.everydev.ai/tools/cbmc
