pub struct Prophecy<T> { /* private fields */ }Expand description
A “prophecy variable” that predicts some value of type T.
A prophecy can be allocated by calling Prophecy::<T>::new() in exec mode.
The result is a prophecy variable whose view is an arbitrary value of type T.
A prophecy can be resolved by calling Prophecy::<T>::resolve() in exec mode.
This call ensures that the view of the prophecy variable is equal to the value
passed to resolve(). This call (and in particular, its argument v) must be
exec-mode to avoid circular dependency on the value of the prophecy variable.
The value cannot have any “ghost content” (not even via Ghost);
hence the T: Structural trait bound.
We make an informal soundness argument based on the paper
The Future is Ours: Prophecy Variables in Separation Logic.
The argument goes as follows:
For any execution of the program, there is some sequence of calls to resolve(),
whose values do not depend on spec- or proof-mode values. Those values can be
plugged into the arbitrary ghost values chosen by new(), for the corresponding
prophecy variables, to justify the proof accompanying the program. Since both
new() and resolve() are exec-mode, there is no ambiguity about which new()
call corresponds to a particular resolve() value.
Implementations§
Source§impl<T> Prophecy<T>where
T: Structural,
impl<T> Prophecy<T>where
T: Structural,
Auto Trait Implementations§
impl<T> Freeze for Prophecy<T>
impl<T> RefUnwindSafe for Prophecy<T>where
T: RefUnwindSafe,
impl<T> Send for Prophecy<T>where
T: Send,
impl<T> Sync for Prophecy<T>where
T: Sync,
impl<T> Unpin for Prophecy<T>where
T: Unpin,
impl<T> UnwindSafe for Prophecy<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
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() }