Specification Language
Specifications describe conditions on function calls, program states, and data. They are written as Rust attributes and macro invocations.
Syntax
Specification :=
FunctionContract
| TypeInvariant
| ContractStatement
Lexical Rules defines the notation and Rust syntax used throughout this reference. Logic Expressions defines the expressions from which specification conditions are formed.
The remaining chapters describe the places where these conditions apply:
- Function Contracts: requirements on calls and guarantees on return.
- Statement Annotations: assertions and assumptions at a point in a function body.
- Type Invariants: conditions associated with a type.
Each construct is described by its syntax, semantics, examples, and implementation boundaries. The Grammar Index collects all productions.