Le marteau-pilon, forges et aciéries de Saint-Chamond, Joseph-Fortuné LAYRAUD, 1889
Creusot is a deductive verifier for Rust code. It verifies your code is safe from panics, overflows, and assertion failures. By adding annotations you can take it further and verify your code does the correct thing.
Creusot works by translating Rust code to WhyML, the verification and specification language of Why3. Users can then leverage the full power of Why3 to (semi)-automatically discharge the verification conditions!
See ARCHITECTURE.md for technical details.
If you need help using Creusot or would like to discuss, you can post on the discussions forum or join our Zulip chat!
If you would like to cite Creusot in academic contexts, we encourage you to use our ICFEM'22 publication.
To get an idea of what verifying a program with Creusot looks like, we encourage you to take a look at some of our test suite:
More examples are found in creusot/tests/should_succeed.
rustup
, to get the suitable Rust toolchainopam
, the package manager for OCamlcreusot
directory for the rest of the setup.
$ git clone https://github.com/creusot-rs/creusot
$ cd creusot
opam
switch with why3:
$ opam switch create -y . ocaml.4.14.1
$ eval $(opam env)
This will build why3 and its ocaml dependencies in a local _opam
directory.
$ cargo install --path creusot-rustc
$ cargo install --path cargo-creusot
this will build the cargo-creusot
and creusot-rustc
executables and place them in ~/.cargo/bin
.
$ cargo creusot setup install
this will download additional solvers (Alt-Ergo, Z3, CVC4, CVC5) and configure Why3 to use them.
$ git pull
$ eval $(opam env)
$ opam update
$ opam pin . -y
$ cargo install --path creusot-rustc
$ cargo install --path cargo-creusot
$ cargo creusot setup install
See the guide.
See HACKING.md for information on the developer workflow for hacking on the Creusot codebase.