/prusti-dev

A static verifier for Rust, based on the Viper verification infrastructure.

Primary LanguageRustOtherNOASSERTION

WARNING: We are currently upgrading Prusti to work with the latest version of the Rust compiler. As a result, the version of Prusti in the master branch has severe regressions. If you want to see the code of Prusti that matches the version used in Prusti Assistant, you can find it at the commit tagged with rustc-2018-06-07.

Prusti

Test Test on crates Deploy Test coverage Project chat

Prusti is a prototype verifier for Rust, built upon the the Viper verification infrastructure.

By default Prusti verifies absence of panics by proving that statements such as unreachable!() and panic!() are unreachable. Overflow checking can be enabled with a configuration flag, otherwise all integers are treated as unbounded. In Prusti, the functional behaviour of a function can be specified by using annotations, among which are preconditions, postconditions, and loop invariants. The tool checks them, reporting error messages when the code does not adhere to the provided specification.

For a tutorial and more information, check out the wiki page.

Using Prusti

The easiest way to try out Prusti is by using the "Prusti Assistant" extension for VS Code.

Alternatively, if you wish to use Prusti from the command line there are two options:

  • Download the precompiled binaries for Ubuntu, Windows, or MacOS from a GitHub release.
  • Compile from the source code, running ./x.py setup and ./x.py build --release.