pub struct Resolution<X, Y, Pred> { /* private fields */ }Expand description
The resolution of an atomic update.
This ghost state acts as a certificate than an AtomicUpdate has been resolved successfully.
It is constructed and returned by try_open_atomic_update in the success case and can be used to prove that an atomic update resolves,
or to reason about the input and output of an atomic update (see Resolution::agree).
Since this object is constructed after the atomic update has been resolved, it provides access to the prophecy variables of the atomic update without being prophetic itself. This can be helpful for more advanced data structures, where the atomic update is passed around between threads before it is resolved.
Note that this object is helpful, but not necessary, for proving that an atomic update resolves. In the vast majority of cases, this object can safely be discarded.
Implementations§
Source§impl<X, Y, Pred> Resolution<X, Y, Pred>
impl<X, Y, Pred> Resolution<X, Y, Pred>
Sourcepub uninterp spec fn atomic_update(self) -> AtomicUpdate<X, Y, Pred>
pub uninterp spec fn atomic_update(self) -> AtomicUpdate<X, Y, Pred>
A view of the atomic update that has been resolved.
Sourcepub open spec fn is_for(self, atomic_update: AtomicUpdate<X, Y, Pred>) -> bool
pub open spec fn is_for(self, atomic_update: AtomicUpdate<X, Y, Pred>) -> bool
{ self.atomic_update() == atomic_update }Sourcepub uninterp spec fn input(self) -> X
pub uninterp spec fn input(self) -> X
A non-prophetic view of AtomicUpdate::input().
Sourcepub uninterp spec fn output(self) -> Y
pub uninterp spec fn output(self) -> Y
A non-prophetic view of AtomicUpdate::output().
Sourcepub proof fn agree(&self)
pub proof fn agree(&self)
self.atomic_update().resolves() == true,self.atomic_update().input() == self.input(),self.atomic_update().output() == self.output(),The atomic update agrees with its own resolution.
This proves than an AtomicUpdate::resolves(),
and also makes sure that the input and output
of the resolution agree with the atomic update.
Auto Trait Implementations§
impl<X, Y, Pred> Freeze for Resolution<X, Y, Pred>
impl<X, Y, Pred> RefUnwindSafe for Resolution<X, Y, Pred>where
Pred: RefUnwindSafe,
impl<X, Y, Pred> Send for Resolution<X, Y, Pred>
impl<X, Y, Pred> Sync for Resolution<X, Y, Pred>
impl<X, Y, Pred> Unpin for Resolution<X, Y, Pred>where
Pred: Unpin,
impl<X, Y, Pred> UnsafeUnpin for Resolution<X, Y, Pred>
impl<X, Y, Pred> UnwindSafe for Resolution<X, Y, Pred>where
Pred: UnwindSafe,
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
Source§impl<Borrowed, VERUS_SPEC__A> BorrowSpec<Borrowed> for VERUS_SPEC__A
impl<Borrowed, VERUS_SPEC__A> BorrowSpec<Borrowed> for VERUS_SPEC__A
Source§exec fn obeys_borrow_spec() -> bool
exec fn obeys_borrow_spec() -> bool
Source§exec fn borrow_spec(&self) -> &Borrowed
exec fn borrow_spec(&self) -> &Borrowed
Source§impl<T> BorrowSpecImpl<T> for Twhere
T: ?Sized,
impl<T> BorrowSpecImpl<T> for Twhere
T: ?Sized,
Source§open spec fn obeys_borrow_spec() -> bool
open spec fn obeys_borrow_spec() -> bool
{ true }Source§open spec fn borrow_spec(&self) -> &T
open spec fn borrow_spec(&self) -> &T
{ self }Source§impl<T> FromSpecImpl<T> for T
impl<T> FromSpecImpl<T> for T
Source§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<A> SpecEq<&A> for Awhere
A: ?Sized,
impl<A> SpecEq<&mut A> for Awhere
A: ?Sized,
impl<A> SpecEq<A> for Awhere
A: ?Sized,
impl<A> SpecEq<Ghost<A>> for A
impl<A> SpecEq<Tracked<A>> for A
Source§impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: TryFrom<T>,
impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: TryFrom<T>,
Source§exec fn obeys_try_from_spec() -> bool
exec fn obeys_try_from_spec() -> bool
Source§impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: TryInto<T>,
impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: TryInto<T>,
Source§exec fn obeys_try_into_spec() -> bool
exec fn obeys_try_into_spec() -> bool
Source§impl<T, U> TryIntoSpecImpl<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryIntoSpecImpl<U> for Twhere
U: TryFrom<T>,
Source§open spec fn obeys_try_into_spec() -> bool
open spec fn obeys_try_into_spec() -> bool
{ <U as TryFromSpec<Self>>::obeys_try_from_spec() }