pub struct GhostPersistentISingleton<T> { /* private fields */ }Expand description
A resource that asserts duplicable client knowledge of a persistent singleton
For the authoritative resource of the whole set, see GhostISetAuth
Implementations§
Source§impl<T> GhostPersistentISingleton<T>
impl<T> GhostPersistentISingleton<T>
Sourcepub proof fn duplicate(tracked &self) -> tracked result : GhostPersistentISingleton<T>
pub proof fn duplicate(tracked &self) -> tracked result : GhostPersistentISingleton<T>
result@ == self@,result.id() == self.id(),Duplicate the GhostPersistentISingleton
Sourcepub proof fn agree(tracked self: &GhostPersistentISingleton<T>, tracked auth: &GhostISetAuth<T>)
pub proof fn agree(tracked self: &GhostPersistentISingleton<T>, tracked auth: &GhostISetAuth<T>)
self.id() == auth.id(),ensuresauth@.contains(self@),Agreement between a GhostPersistentISingleton and a corresponding GhostISetAuth
Verus might not have full context of the GhostISetAuth and a corresponding GhostPersistentISingleton.
However, whenever we know that they refer to the same resource (i.e., have matching ids) we
can assert that the GhostPersistentISingleton is a subset of the GhostISetAuth.
proof fn test(tracked &auth: GhostISetAuth<int>, tracked &pt: GhostPersistentISingleton<int>)
requires
auth.id() == sub.id(),
pt@ == 1int
ensures
auth@.contains(1int)
{
pt.agree(auth);
assert(auth@.contains(1int));
}Sourcepub proof fn combine(
tracked self,
tracked other: GhostPersistentISingleton<T>,
) -> tracked r : GhostPersistentISubset<T>
pub proof fn combine( tracked self, tracked other: GhostPersistentISingleton<T>, ) -> tracked r : GhostPersistentISubset<T>
self.id() == other.id(),ensuresr.id() == self.id(),r@ == iset![self @, other @],self@ != other@ ==> r@.len() == 2,self@ == other@ ==> r@.len() == 1,We can combine two GhostPersistentISingletons into a GhostPersistentISubset
Sourcepub proof fn disjoint(tracked &mut self, tracked other: &GhostISingleton<T>)
pub proof fn disjoint(tracked &mut self, tracked other: &GhostISingleton<T>)
old(self).id() == other.id(),ensuresfinal(self).id() == old(self).id(),final(self)@ == old(self)@,final(self)@ != other@,Shows that a GhostPersistentISingleton and a GhostISingleton are not owning the same value
Sourcepub proof fn disjoint_subset(tracked &mut self, tracked other: &GhostISubset<T>)
pub proof fn disjoint_subset(tracked &mut self, tracked other: &GhostISubset<T>)
old(self).id() == other.id(),ensuresfinal(self).id() == old(self).id(),final(self)@ == old(self)@,!other@.contains(final(self)@),Shows that if a GhostPersistentISingleton and a GhostISubset are not owning the same value
Sourcepub proof fn subset(tracked self) -> tracked r : GhostPersistentISubset<T>
pub proof fn subset(tracked self) -> tracked r : GhostPersistentISubset<T>
r.id() == self.id(),r@ == iset![self @],Convert the GhostPersistentISingleton a GhostPersistentISubset
Auto Trait Implementations§
impl<T> Freeze for GhostPersistentISingleton<T>
impl<T> RefUnwindSafe for GhostPersistentISingleton<T>where
T: RefUnwindSafe,
impl<T> Send for GhostPersistentISingleton<T>where
T: Send,
impl<T> Sync for GhostPersistentISingleton<T>where
T: Sync,
impl<T> Unpin for GhostPersistentISingleton<T>where
T: Unpin,
impl<T> UnsafeUnpin for GhostPersistentISingleton<T>
impl<T> UnwindSafe for GhostPersistentISingleton<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() }