Crate creusot_contracts
source ·Expand description
The “standard library” of Creusot.
To start using Creusot, you should always import that crate. The recommended way is to have a glob import:
use creusot_contracts::*;
§Writing specifications
To start writing specification, use the requires
and ensures
macros:
use creusot_contracts::*;
#[requires(x < i32::MAX)]
#[ensures(result@ == x@ + 1)]
fn add_one(x: i32) -> i32 {
x + 1
}
For a more detailed explanation, see the guide.
Re-exports§
pub use prelude::*;
Modules§
- Definitions for ghost code
- Definitions for pearlite code
- Specification are written using these macros
- Raw pointers with ghost code
- Definition of
Snapshot
- Some useful logical items
Macros§
- A macro to easily implements the various
#[law]
s ofOrdLogic
.