Module creusot_contracts::macros

source ·
Expand description

Specification are written using these macros

All of those are re-exported at the top of the crate.

Macros§

Attribute Macros§

  • A post-condition of a function or trait item
  • A loop invariant
  • Declares a trait item as being a law which is autoloaded as soon another trait item is used in a function
  • Declare a function as being a logical function
  • Allows specifying both a pre- and post-condition in a single statement.
  • Allows the body of a logical definition to be made visible to provers
  • This attribute can be used on a function or closure to instruct Creusot not to ensure as a postcondition that the return value of the function satisfies its type invariant.
  • Declare a function as being a predicate
  • Indicate that the function is pure: fulfilling the requires clauses ensures that this function will terminate, and will not panic.
  • A pre-condition of a function or trait item
  • Indicate that the function terminates: fulfilling the requires clauses ensures that this function will not loop forever.
  • Instructs Creusot to ignore the body of a declaration, assuming any contract the declaration has is valid.
  • Declares a variant for a function