Skip to main content

VerifyDriver

Struct VerifyDriver 

Source
pub struct VerifyDriver<'target, 'tcx> {
    tcx: TyCtxt<'tcx>,
    target: &'target FunctionTarget<'tcx>,
    path_info: Vec<CallGroup<'tcx>>,
    engine: VerifyEngine<'tcx>,
    allow_repeat: usize,
}
Expand description

Orchestrates the three-stage verification pipeline (backward data-dependency analysis → forward state simulation → SMT checking) for a single function under analysis.

Each VerifyDriver instance bundles together:

  1. The problem statement (target) — which unsafe checkpoints and raw-pointer dereferences exist, what safety contracts they demand, and what entry assumptions (from #[rapx::requires]) and struct invariants apply.

  2. The reachability model (path_info) — SCC-aware acyclic paths from function entry to each checkpoint, produced by flattening the MIR control-flow graph with bounded loop unrolling.

  3. The verification engine (engine) — a stateless pipeline shared across all (checkpoint, path, property) triples.

  4. The loop-unrolling budget (allow_repeat) — caps how many extra iterations a loop body may appear beyond its first occurrence, trading completeness against path enumeration cost.

Verification proceeds in two phases per driver instance:

  • verify_function: checks safety properties at each unsafe checkpoint (callee #[rapx::requires] contracts).
  • verify_struct_invariants: checks struct invariants at return-block checkpoints (constructors) or at all path endpoints (non-constructor methods).

Fields§

§tcx: TyCtxt<'tcx>§target: &'target FunctionTarget<'tcx>§path_info: Vec<CallGroup<'tcx>>§engine: VerifyEngine<'tcx>§allow_repeat: usize

Implementations§

Source§

impl<'target, 'tcx> VerifyDriver<'target, 'tcx>

Source

pub fn new(tcx: TyCtxt<'tcx>, target: &'target FunctionTarget<'tcx>) -> Self

Source

pub fn new_with_repeat( tcx: TyCtxt<'tcx>, target: &'target FunctionTarget<'tcx>, allow_repeat: usize, ) -> Self

Source

pub fn tcx(&self) -> TyCtxt<'tcx>

Return the compiler type context owned by this driver.

Source

pub fn target(&self) -> &'target FunctionTarget<'tcx>

Return the function target managed by this driver.

Source

pub fn path_info(&self) -> &[CallGroup<'tcx>]

Return the per-callee call groups managed by this driver.

Source

pub fn verify_function(&self) -> VerificationReport<'tcx>

Run unsafe-checkpoint verification for the managed function target.

Source

fn check_or_property( &self, report: &mut VerificationReport<'tcx>, view: &CheckpointCheckView<'_, '_, 'tcx>, property_index: usize, or_property: &Property<'tcx>, )

Source

pub fn properties_for_callsite( &self, checkpoint: &Checkpoint<'tcx>, ) -> &'target [Property<'tcx>]

Return the required properties for a concrete unsafe checkpoint.

Dispatches on [CheckpointKind]: synthetic checkpoints (raw pointer dereference, static mut access) carry their properties in target.raw_ptr_deref_checks / target.static_mut_checks; real unsafe calls look up target.callee_requires by callee DefId.

Source

pub fn iter_callsite_checks( &self, ) -> impl Iterator<Item = CheckpointCheckView<'_, 'target, 'tcx>> + '_

Iterate over checkpoints together with their shared path tree and properties.

Source

pub fn verify_struct_invariants(&self) -> VerificationReport<'tcx>

Run struct invariant verification for the managed function target.

For constructors (functions returning Self), paths are filtered to return blocks to avoid unwinding paths where the struct may not be fully initialised. For methods, all whole-CFG paths from PathGraph::enumerate_paths_repeat are used directly.

Source

fn build_invariant_trees( &self, is_constructor: bool, ) -> FxHashMap<CheckpointLocation, PathTree>

Auto Trait Implementations§

§

impl<'target, 'tcx> !RefUnwindSafe for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> !Send for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> !Sync for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> !UnwindSafe for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> DynSend for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> DynSync for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> Freeze for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> Unpin for VerifyDriver<'target, 'tcx>

§

impl<'target, 'tcx> UnsafeUnpin for VerifyDriver<'target, 'tcx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V