pub struct ProphecyGhost<T> { /* private fields */ }Expand description
A general-purpose prophecy variable.
A prophecy variable is allocated via ProphecyGhost::new
and resolved to a definitive value via ProphecyGhost::resolve.
In contrast to the similar Prophecy, this allows resolving on ghost computations
and permits dependent resolutions. However, the value()
is marked verifier::prophetic, which entails certain restrictions in the way it can be used.
See the module level documentation for a detailed comparison with the rationale
for these trade-offs.
See ProphecySeq for an example of a library verified using dependent resolutions.
Implementations§
Source§impl<T> ProphecyGhost<T>
impl<T> ProphecyGhost<T>
Sourcepub proof fn resolve_dependent<U>(tracked self, tracked u: &ProphecyGhost<U>, f: FnSpec<(U,), T>)
pub proof fn resolve_dependent<U>(tracked self, tracked u: &ProphecyGhost<U>, f: FnSpec<(U,), T>)
ensures
self.value() == f(u.value()),Sourcepub proof fn resolve_dependent_2<U, V>(tracked
self,
tracked u: &ProphecyGhost<U>,
tracked v: &ProphecyGhost<V>,
f: FnSpec<(U, V), T>,
)
pub proof fn resolve_dependent_2<U, V>(tracked self, tracked u: &ProphecyGhost<U>, tracked v: &ProphecyGhost<V>, f: FnSpec<(U, V), T>, )
ensures
self.value() == f(u.value(), v.value()),Sourcepub proof fn resolve_dependent_3<U, V, W>(tracked
self,
tracked u: &ProphecyGhost<U>,
tracked v: &ProphecyGhost<V>,
tracked w: &ProphecyGhost<W>,
f: FnSpec<(U, V, W), T>,
)
pub proof fn resolve_dependent_3<U, V, W>(tracked self, tracked u: &ProphecyGhost<U>, tracked v: &ProphecyGhost<V>, tracked w: &ProphecyGhost<W>, f: FnSpec<(U, V, W), T>, )
ensures
self.value() == f(u.value(), v.value(), w.value()),Auto Trait Implementations§
impl<T> Freeze for ProphecyGhost<T>
impl<T> RefUnwindSafe for ProphecyGhost<T>where
T: RefUnwindSafe,
impl<T> Send for ProphecyGhost<T>
impl<T> Sync for ProphecyGhost<T>
impl<T> Unpin for ProphecyGhost<T>where
T: Unpin,
impl<T> UnsafeUnpin for ProphecyGhost<T>
impl<T> UnwindSafe for ProphecyGhost<T>where
T: 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
Mutably borrows from an owned value. Read more
Source§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
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() }