https://github.com/verifast/verifast
Research prototype tool for modular formal verification of C, Rust and Java programs
https://github.com/verifast/verifast
Last synced: about 9 hours ago
JSON representation
Research prototype tool for modular formal verification of C, Rust and Java programs
- Host: GitHub
- URL: https://github.com/verifast/verifast
- Owner: verifast
- License: other
- Created: 2013-11-19T08:57:02.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2025-11-20T18:40:40.000Z (7 days ago)
- Last Synced: 2025-11-20T19:07:34.420Z (7 days ago)
- Language: Rust
- Homepage:
- Size: 13.5 MB
- Stars: 447
- Watchers: 20
- Forks: 67
- Open Issues: 110
-
Metadata Files:
- Readme: README.Linux.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - VeriFast - research prototype tool for modular formal verification of C, Rust and Java programs. (Projects / Verification)
- Awesome-Rust-Checker - VeriFast<sup>2</sup> - 3-642-20398-5_4)| - | - | Symbolic Execution | 2025-04-07 | (Verifiers)
- fucking-static-analysis - VeriFast - threaded and multithreaded C and Java programs annotated with preconditions and postconditions written in separation logic. To express rich specifications, the programmer can define inductive datatypes, primitive recursive pure functions over these datatypes, and abstract separation logic predicates. (Programming Languages)
- static-analysis - VeriFast - threaded and multithreaded C and Java programs annotated with preconditions and postconditions written in separation logic. To express rich specifications, the programmer can define inductive datatypes, primitive recursive pure functions over these datatypes, and abstract separation logic predicates. (Programming Languages)
README
Building VeriFast on Linux
==========================
Note: binary downloads are available, both ["nightly" builds](https://github.com/verifast/verifast#binaries) of the latest commit, and binaries for [named releases](https://github.com/verifast/verifast/releases).
Note: The instructions below may get out of date. When that happens, please submit an issue. In the meantime, guaranteed up-to-date instructions can be found by looking at the script, [.github/workflows/build.yml](https://github.com/verifast/verifast/blob/master/.github/workflows/build.yml), used by the Github Actions CI service that automatically builds and tests VeriFast after each commit. This script uses the `build_ubuntu` job, which runs on a Ubuntu 18.04 virtual machine. It first runs the command listed below `Build setup:`, and then the command listed below `Build:`.
Devcontainer
------------
The easiest way to get started is to use VSCode's support for Dev Containers. Simply choose the Dev Containers: Clone Repository in Container Volume command from the VSCode Command Palette, and enter the `https://github.com/verifast/verifast` repository URL.
On Linux, you can run the VeriFast IDE from inside the dev container by creating a file `.devcontainer/devcontainer.local.json` with the following contents:
```json
{
"runArgs": [
"-e", "DISPLAY=${localEnv:DISPLAY}",
"-v", "/tmp/.X11-unix:/tmp/.X11-unix"
]
}
```
In a host terminal, run `xhost +local:docker` to ensure the container has access to your X11 server.
An alternative is to use the VeriFast VSCode extension. This works even in GitHub Codespaces.
Dependencies
------------
To install the software needed to build VeriFast, run [setup-build.sh](https://github.com/verifast/verifast/blob/master/setup-build.sh). This script does the following:
- It installs some non-OCaml-based dependencies using `apt-get`:
```
sudo apt-get install -y --no-install-recommends \
git wget ca-certificates m4 \
patch unzip libgtk2.0-dev \
valac libgtksourceview2.0-dev \
cmake build-essential
```
- It installs LLVM/Clang 13.0.0 (a language front-end and tooling infrastructure for languages in the C language family).
- It installs the OCaml-based dependencies:
- OCaml 4.13.0
- Findlib 1.9.1 (for the `ocamlfind` tool, used by Z3's install script and dune)
- OCaml-Num 1.4 (arbitrary-precision arithmetic)
- Ocamlbuild 0.14.0 (to build Camlp4)
- Camlp4 4.13+1 (an OCaml preprocessor, for the streams notation used in VeriFast's parser)
- GTK+ (a cross-platform GUI toolkit)
- Lablgtk 2.18.11 (OCaml bindings to GTK+)
- Z3 4.8.5 (a powerful theorem prover, including OCaml bindings)
- Dune 2.9.1 (to build and install other OCaml dependencies)
- Cap'n Proto 0.9.1 (fast data interchange format)
- Capnp 3.4.0 (OCaml plugin for Cap'n Proto)
- Other dependencies, mainly to support Capnp:
- Csexp 1.5.1
- Sexplib0 0.14.0
- Base 0.14.1
- Res 5.0.1
- Stdio 0.14.0
- Cppo 1.6.8
- Ocplib-endian 1.1
- Stdint 0.7.0
- Result 1.5
It does so by downloading a [vf-llvm-clang-build](https://github.com/NielsMommen/vf-llvm-clang-build/releases/tag/v1.0.0) and [VFDeps](https://github.com/verifast/vfdeps) package with pre-compiled versions of these dependencies. Note: these binaries are location-dependent. They need to be below `/tmp/vf-llvm-clang-build-$VERSION` and `/tmp/vfdeps-$VERSION`, where `$VERSION` is the version (Git hash) of the package; that is, extract the archives into `/tmp`. (You can also extract it elsewhere and then create symlinks called `vf-llvm-clang-build-$VERSION` and `/tmp/vfdeps-$VERSION` that point there.) To see which version is currently being used, see [config.sh](https://github.com/verifast/verifast/blob/master/config.sh).
Building VeriFast
-----------------
To build VeriFast:
1. `cd src`
2. Make sure all dependencies are in your `PATH`. For example: `export PATH=/tmp/vfdeps-$VERSION/bin:$PATH`.
3. `make`
If `make` fails (probably due to broken intermediate output files left by earlier failed attempts), try `make clean; make depend; make`.