pub struct Ag<T>(pub T);Expand description
The ‘agreement’ Resource Algebra.
This has the property that all resource with the same id have the same value (they ‘agree’).
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T> RA for Ag<T>
impl<T> RA for Ag<T>
Source§fn op(self, other: Self) -> Option<Self>
fn op(self, other: Self) -> Option<Self>
(open)
if self.0 == other.0 { Some(self) } else { None }Source§fn factor(self, factor: Self) -> Option<Self>
fn factor(self, factor: Self) -> Option<Self>
(open)
self.op(factor)ensures
match result { Some(c) => factor.op(c) == Some(self), None => forall<c: Self> factor.op(c) != Some(self), }
Source§fn commutative(a: Self, b: Self)
fn commutative(a: Self, b: Self)
(open(pub(self)), law) ⚠
ensures
a.op(b) == b.op(a)Source§fn associative(a: Self, b: Self, c: Self)
fn associative(a: Self, b: Self, c: Self)
(open(pub(self)), law) ⚠
ensures
a.op(b).and_then_logic(|ab : Self| ab.op(c)) == b.op(c).and_then_logic(|bc| a.op(bc))
Source§fn core(self) -> Option<Self>
fn core(self) -> Option<Self>
(open)
Some(self)ensures
match result { Some(c) => c.op(c) == Some(c) && c.op(self) == Some(self), None => true }
Source§fn core_is_maximal_idemp(self, i: Self)
fn core_is_maximal_idemp(self, i: Self)
⚠
requires
i.op(i) == Some(i)requires
i.op(self) == Some(self)ensures
match self.core() { Some(c) => i.incl(c), None => false, }
Source§fn incl_eq(self, other: Self) -> bool
fn incl_eq(self, other: Self) -> bool
(open, sealed) Read more
Source§fn incl_eq_op(a: Self, b: Self, x: Self) -> bool
fn incl_eq_op(a: Self, b: Self, x: Self) -> bool
(open, sealed) Read more
Source§fn update_nondet(self, s: Set<Self>) -> bool
fn update_nondet(self, s: Set<Self>) -> bool
This is used in
Resource::update_nondet. Read moreSource§fn incl_transitive(a: Self, b: Self, c: Self)
fn incl_transitive(a: Self, b: Self, c: Self)
Auto Trait Implementations§
impl<T> Freeze for Ag<T>where
T: Freeze,
impl<T> RefUnwindSafe for Ag<T>where
T: RefUnwindSafe,
impl<T> Send for Ag<T>where
T: Send,
impl<T> Sync for Ag<T>where
T: Sync,
impl<T> Unpin for Ag<T>where
T: Unpin,
impl<T> UnwindSafe for Ag<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