Skip to main content

Resolution

Struct Resolution 

Source
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>

Source

pub uninterp spec fn atomic_update(self) -> AtomicUpdate<X, Y, Pred>

A view of the atomic update that has been resolved.

Source

pub open spec fn is_for(self, atomic_update: AtomicUpdate<X, Y, Pred>) -> bool

{ self.atomic_update() == atomic_update }
Source

pub uninterp spec fn input(self) -> X

A non-prophetic view of AtomicUpdate::input().

Source

pub uninterp spec fn output(self) -> Y

A non-prophetic view of AtomicUpdate::output().

Source

pub proof fn agree(&self)

ensures
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> 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
Source§

impl<Borrowed, VERUS_SPEC__A> BorrowSpec<Borrowed> for VERUS_SPEC__A
where VERUS_SPEC__A: Borrow<Borrowed> + ?Sized, Borrowed: ?Sized,

Source§

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

Source§

open spec fn obeys_borrow_spec() -> bool

{ true }
Source§

open spec fn borrow_spec(&self) -> &T

{ self }
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

Source§

exec fn obeys_from_spec() -> bool

Source§

exec fn from_spec(v: T) -> VERUS_SPEC__A

Source§

impl<T> FromSpecImpl<T> for T

Source§

open spec fn obeys_from_spec() -> bool

{ true }
Source§

open spec fn from_spec(v: T) -> T

{ v }
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, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

Source§

exec fn obeys_into_spec() -> bool

Source§

exec fn into_spec(self) -> T

Source§

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

Source§

open spec fn obeys_into_spec() -> bool

{ <U as FromSpec<Self>>::obeys_from_spec() }
Source§

open spec fn into_spec(self) -> U

{ <U as FromSpec<Self>>::from_spec(self) }
§

impl<A> SpecEq<&A> for A
where A: ?Sized,

§

impl<A> SpecEq<&mut A> for A
where A: ?Sized,

§

impl<A> SpecEq<A> for A
where A: ?Sized,

§

impl<A> SpecEq<Ghost<A>> for A

§

impl<A> SpecEq<Tracked<A>> for A

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

Source§

exec fn obeys_try_from_spec() -> bool

Source§

exec fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

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.
Source§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

Source§

exec fn obeys_try_into_spec() -> bool

Source§

exec fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

Source§

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

Source§

open spec fn obeys_try_into_spec() -> bool

{ <U as TryFromSpec<Self>>::obeys_try_from_spec() }
Source§

open spec fn try_into_spec(self) -> Result<U, <U as TryFrom<T>>::Error>

{ <U as TryFromSpec<Self>>::try_from_spec(self) }