Struct vstd::rwlock::RwLockToks::State
source · pub struct State<K, V, Pred: InvariantPredicate<K, V>> {
pub k: K,
pub pred: PhantomData<Pred>,
pub flag_exc: bool,
pub flag_rc: nat,
pub storage: Option<V>,
pub pending_writer: Option<()>,
pub writer: Option<()>,
pub pending_reader: Multiset<()>,
pub reader: Multiset<V>,
}
Fields§
§k: K
§pred: PhantomData<Pred>
§flag_exc: bool
§flag_rc: nat
§storage: Option<V>
§pending_writer: Option<()>
§writer: Option<()>
§pending_reader: Multiset<()>
§reader: Multiset<V>
Implementations§
source§impl<K, V, Pred: InvariantPredicate<K, V>> State<K, V, Pred>
impl<K, V, Pred: InvariantPredicate<K, V>> State<K, V, Pred>
pub fn initialize_full(post: Self, k: K, t: V) -> bool
pub fn initialize_full_enabled(k: K, t: V) -> bool
pub fn acquire_read_start(pre: Self, post: Self) -> bool
pub fn acquire_read_start_strong(pre: Self, post: Self) -> bool
pub fn acquire_read_start_enabled(pre: Self) -> bool
pub fn acquire_read_end(pre: Self, post: Self) -> bool
pub fn acquire_read_end_strong(pre: Self, post: Self) -> bool
pub fn acquire_read_end_enabled(pre: Self) -> bool
pub fn acquire_read_end_asserts(pre: State<K, V, Pred>)
pub fn acquire_read_abandon(pre: Self, post: Self) -> bool
pub fn acquire_read_abandon_strong(pre: Self, post: Self) -> bool
pub fn acquire_read_abandon_enabled(pre: Self) -> bool
pub fn acquire_read_abandon_asserts(pre: State<K, V, Pred>)
pub fn acquire_exc_start(pre: Self, post: Self) -> bool
pub fn acquire_exc_start_strong(pre: Self, post: Self) -> bool
pub fn acquire_exc_start_enabled(pre: Self) -> bool
pub fn acquire_exc_start_asserts(pre: State<K, V, Pred>)
pub fn acquire_exc_end(pre: Self, post: Self) -> bool
pub fn acquire_exc_end_strong(pre: Self, post: Self) -> bool
pub fn acquire_exc_end_enabled(pre: Self) -> bool
pub fn acquire_exc_end_asserts(pre: State<K, V, Pred>)
pub fn release_exc(pre: Self, post: Self, x: V) -> bool
pub fn release_exc_strong(pre: Self, post: Self, x: V) -> bool
pub fn release_exc_enabled(pre: Self, x: V) -> bool
pub fn release_exc_asserts(pre: State<K, V, Pred>, x: V)
pub fn read_guard_asserts(pre: State<K, V, Pred>, x: V)
pub fn read_match_asserts(pre: State<K, V, Pred>, x: V, y: V)
pub fn next_by( pre: State<K, V, Pred>, post: State<K, V, Pred>, step: Step<K, V, Pred> ) -> bool
pub fn next(pre: State<K, V, Pred>, post: State<K, V, Pred>) -> bool
pub fn next_strong_by( pre: State<K, V, Pred>, post: State<K, V, Pred>, step: Step<K, V, Pred> ) -> bool
pub fn next_strong(pre: State<K, V, Pred>, post: State<K, V, Pred>) -> bool
pub fn init_by(post: State<K, V, Pred>, step: Config<K, V, Pred>) -> bool
pub fn init(post: State<K, V, Pred>) -> bool
pub fn invariant(&self) -> bool
sourcepub open spec fn exc_bit_matches(&self) -> bool
pub open spec fn exc_bit_matches(&self) -> bool
{
(if self.flag_exc { 1 } else { 0 as int })
== (if self.pending_writer.is_Some() { 1 } else { 0 as int }) as int
+ (if self.writer.is_Some() { 1 } else { 0 as int }) as int
}
sourcepub open spec fn count_matches(&self) -> bool
pub open spec fn count_matches(&self) -> bool
{
self.flag_rc
== self.pending_reader.count(()) + self.reader.count(self.storage.get_Some_0())
}
sourcepub open spec fn reader_agrees_storage(&self) -> bool
pub open spec fn reader_agrees_storage(&self) -> bool
{
forall |t: V| imply(
#[trigger] self.reader.count(t) > 0,
equal(self.storage, Option::Some(t)),
)
}
sourcepub open spec fn writer_agrees_storage(&self) -> bool
pub open spec fn writer_agrees_storage(&self) -> bool
{ imply(self.writer.is_Some(), self.storage.is_None()) }
sourcepub open spec fn writer_agrees_storage_rev(&self) -> bool
pub open spec fn writer_agrees_storage_rev(&self) -> bool
{ imply(self.storage.is_None(), self.writer.is_Some()) }
sourcepub open spec fn sto_user_inv(&self) -> bool
pub open spec fn sto_user_inv(&self) -> bool
{ self.storage.is_some() ==> Pred::inv(self.k, self.storage.unwrap()) }
Auto Trait Implementations§
impl<K, V, Pred> RefUnwindSafe for State<K, V, Pred>
impl<K, V, Pred> Send for State<K, V, Pred>
impl<K, V, Pred> Sync for State<K, V, Pred>
impl<K, V, Pred> Unpin for State<K, V, Pred>
impl<K, V, Pred> UnwindSafe for State<K, V, Pred>
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