CBMC is a Bounded Model Checker for C and C++ programs. It supports C89, C99, most of C11 and most compiler extensions provided by gcc and Visual Studio. It also supports SystemC using Scoot. It allows verifying array bounds (buffer overflows), pointer safety, exceptions and user-specified assertions. Furthermore, it can check C and C++ for consistency with other languages, such as Verilog. The verification is performed by unwinding the loops in the program and passing the resulting equation to a decision procedure.
For full information see cprover.org.
For an overview of the various tools that are part of CProver and how to use them see TOOLS_OVERVIEW.md.
Get the latest release
Get the current develop version: git clone https://github.com/diffblue/cbmc.git
For windows you can install cbmc binaries via the .msi's found on the releases page.
Note that we depend on the Visual C++ redistributables. You likely already have these, if not please download and run vcredist.x64.exe from Microsoft to install them prior to running cbmc.
For different linux environments, you have these choices:
Install CBMC through the .deb
package built by each release, available
on the releases page. To
do that, download the .deb
package and run apt install cbmc-x.y.deb
with root
privileges, with x.y
being substituted for the version
you are attempting to install.
NOTE: Because of libc/libc++ ABI compatibility and package dependency names, if you follow this path make sure you install the package appropriate for the version of operating system you are using.
For macOS there is a package available in Homebrew/core. Assuming you have homebrew installed, you can run
$ brew install cbmc
to install CBMC, or if you already have it installed via homebrew
$ brew upgrade cbmc
to get an up-to-date version.
Homebrew will always update formulas to their latest version available, so you may periodically see an upgraded version of CBMC being downloaded regardless of whether you explicitly requested that or not. If you would rather this didn't happen, you can pin the CBMC version with:
$ brew pin cbmc
If instead of the latest version, you would want to install a historic version, you can do so with a homebrew tap that we maintain. Instructions for that are available in the documentation
If you encounter a problem please file a bug report:
git clone git@github.com:YOURNAME/cbmc.git
develop
branch (default branch)develop
branchNew contributors can look through the mini projects page for small, focussed feature ideas.
4-clause BSD license, see LICENSE
file.