Expand description
Common SMT checking backend for the staged verifier.
The SMT layer consumes the abstract facts produced by verifying and
exposes one property-oriented entry point. Safety properties do not call Z3
directly. Instead, each property-specific module lowers its requirement into
one of the common SMT obligations below, and the common backend discharges
that obligation against the path-local abstract facts.
Current common obligations:
SmtObligation::Aligned: proveaddr(place) % align == 0.SmtObligation::NonZero: proveaddr(place) != 0.SmtObligation::Range: reserved for future bounds-style checks.
Current property lowering:
Align(p, T)lowers toAligned { place: p, align: align_of(T) }.NonNull(p)lowers toNonZero { place: p }.ValidPtr(p, T, n)is decomposed byvalid_ptr.rsinto primitive SMT checks that are implemented today, while unsupported primitives remain explicitUnknownnotes.
Future SPs should add small lowering modules next to align.rs and reuse
SmtModel, SmtQuery, and SmtCheckResult instead of constructing solver
queries ad hoc.
StructsΒ§
- Path
Cursor πCutoff - Pointer
Bounds π - Recovered index and length terms for a first-cut in-bounds proof.
- SmtCheck
Result - Result of one SMT check.
- SmtChecker
- SMT backend for verifier properties.
- SmtModel π
- Per-query SMT term builder over a forward visit result.
- SmtQuery
- Solver query built from path facts plus one negated obligation.
EnumsΒ§
- Slice
Index πKind - SmtObligation
- General SMT obligation produced by an SP-specific lowering.
- SmtPredicate
- Common boolean predicate asserted or refuted by SMT queries.
- SmtTerm
- Common SMT term used by diagnostics and property-independent query building.
- Type
Size πClass - Trivalent size classification for type-dependent composite SPs.
FunctionsΒ§
- abstract_
value_ πfrom_ operand - abstract_
value_ πfrom_ rvalue - allocated_
type_ πcompatible - allocation_
object_ πinvalidated - array_
elem_ πtype - binop_
label π - Render a compact binary operator label.
- call_
has_ πpointer_ add_ effect - Return true when a call summary carries pointer-add semantics.
- call_
has_ πpointer_ sub_ effect - const_
int_ πfrom_ debug - Extract a small integer constant from rustcβs debug representation.
- const_
param_ πname_ from_ debug - Extract a const generic parameter name, e.g.
Param(N)β"N". - contract_
expr_ πfrom_ place_ key - failed_
smt π - infer_
element_ πty - init_
type_ πcompatible - initialized_
element_ πty_ name - is_
as_ πptr_ call - Return true when a call summary extracts a pointer from a slice-like object.
- is_
len_ πcarrying_ ty - is_
pointer_ πadd_ call - Return true when a call summary is a typed pointer addition.
- is_
pointer_ πsub_ call - Return true when a call summary is a typed pointer subtraction.
- is_
unsigned_ πintegral_ ty - normalize_
init_ πty_ name - operand_
place π - Convert an operand into a place key when it names a MIR place.
- place_
label π - Compact human-readable label for a MIR place key.
- place_
name π - Stable SMT variable name for a place key.
- pointee_
stride_ πfrom_ types - pointee_
ty π - Return the pointee type of raw pointers and references.
- pointee_
ty_ πstr - Return a string label for the pointee type, for type-level alias checks.
- pointer_
range_ πnegated_ goal - ptr_
metadata_ πorigin - safe_
type_ πlayout - sanitize_
smt_ πname - Stable SMT identifier for diagnostic-only symbolic terms.
- short_
func_ πname - Return the final path segment of a rustc debug function name.
- smt_
term_ πconst_ u64 - smt_
term_ πfor_ value - ty_
has_ πparam_ const - value_
for_ πplace - Return the abstract value assigned to a place when it is tracked by local.
- value_
label π - Compact human-readable label for an abstract value.
Type AliasesΒ§
- Trace
Seen π - Value
Cursor π