pub struct PositiveReal(/* private fields */);Expand description
Natural numbers, i.e., integers that are greater or equal to 0.
Implementations§
Source§impl PositiveReal
impl PositiveReal
Trait Implementations§
Source§impl AddLogic for PositiveReal
impl AddLogic for PositiveReal
Source§impl DivLogic for PositiveReal
impl DivLogic for PositiveReal
Source§impl MulLogic for PositiveReal
impl MulLogic for PositiveReal
Source§impl RA for PositiveReal
impl RA for PositiveReal
Source§fn op(self, other: Self) -> Option<PositiveReal>
fn op(self, other: Self) -> Option<PositiveReal>
(open, inline)
Some(self + other)Source§fn factor(self, factor: Self) -> Option<Self>
fn factor(self, factor: Self) -> Option<Self>
(open, inline)
let _ = PositiveReal::ext_eq; if self.to_real() > factor.to_real() { Some(PositiveReal::new(self.to_real() - factor.to_real())) } else { None }
ensures
match result { Some(c) => factor.op(c) == Some(self), None => forall<c: Self> factor.op(c) != Some(self), }
Source§fn eq(self, other: Self) -> bool
fn eq(self, other: Self) -> bool
(open, inline)
self.ext_eq(other)ensures
result == (self == other)Source§fn commutative(a: Self, b: Self)
fn commutative(a: Self, b: 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)
⚠
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_idemp(self)
fn core_idemp(self)
⚠
requires
self.core() != Noneensures
let c = self.core().unwrap_logic(); c.op(c) == Some(c)
ensures
self.core().unwrap_logic().op(self) == Some(self)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 associative_none(a: Self, b: Self, c: Self, bc: Self)
fn associative_none(a: Self, b: Self, c: Self, bc: Self)
Source§fn associative_some(a: Self, b: Self, c: Self, ab: Self, bc: Self)
fn associative_some(a: Self, b: Self, c: Self, ab: Self, bc: Self)
Specialized version of
Self::associative, in the case where a.op(b) and b.op(c)
are both valid. Read moreSource§fn incl_transitive(a: Self, b: Self, c: Self)
fn incl_transitive(a: Self, b: Self, c: Self)
Auto Trait Implementations§
impl Freeze for PositiveReal
impl RefUnwindSafe for PositiveReal
impl Send for PositiveReal
impl Sync for PositiveReal
impl Unpin for PositiveReal
impl UnwindSafe for PositiveReal
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