pub struct VerusCommutativeProof { /* private fields */ }Expand description
A machine-checked proof of commutativity, verified by Verus.
Created by the verus_proof_commutative_fold!, verus_proof_commutative_map!,
verus_proof_commutative_filter!, and verus_proof_commutative_effect! macros,
one per closure shape, each generating the precise obligation that makes reordering
unobservable for that shape (final accumulator, output multiset, retained multiset,
or captured state, respectively). The obligation is generated by the macro directly
from the actual closure body — it symbolically executes the body in both orders
(x then y, and y then x) from equal initial states and requires the
observable results to be equal — so users never write (and cannot weaken) the
assertion. Users only declare the types involved and, optionally, provide a proof
script to help the SMT solver, which is itself checked by Verus.
When the crate is verified with cargo verus verify, Verus checks the obligation
(which also proves the closure body panic-free, e.g. no arithmetic overflow). Under
normal compilation, the proof is erased and this type simply marks the property as
proven. This type only implements CommutativeProof, so it cannot be used to
fulfill a different property (e.g. idempotent = ...).
Trait Implementations§
Source§impl<T, B: Boundedness> CommutativeProof<T, B> for VerusCommutativeProof
impl<T, B: Boundedness> CommutativeProof<T, B> for VerusCommutativeProof
Source§fn register_proof(&self, _expr: &Expr)
fn register_proof(&self, _expr: &Expr)
Source§fn take_hook(&mut self) -> Option<OrderingHook<T, B>>
fn take_hook(&mut self) -> Option<OrderingHook<T, B>>
Auto Trait Implementations§
impl Freeze for VerusCommutativeProof
impl RefUnwindSafe for VerusCommutativeProof
impl Send for VerusCommutativeProof
impl Sync for VerusCommutativeProof
impl Unpin for VerusCommutativeProof
impl UnsafeUnpin for VerusCommutativeProof
impl UnwindSafe for VerusCommutativeProof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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