pub enum FractionRA {
Frac(real),
Invalid,
}Variants§
Implementations§
Source§impl FractionRA
impl FractionRA
Trait Implementations§
Source§impl ResourceAlgebra for FractionRA
impl ResourceAlgebra for FractionRA
Source§open spec fn valid(self) -> bool
open spec fn valid(self) -> bool
{
match self {
FractionRA::Invalid => false,
FractionRA::Frac(frac) => (0 as real) < frac <= (1 as real),
}
}Source§open spec fn op(a: Self, b: Self) -> Self
open spec fn op(a: Self, b: Self) -> Self
{
match (a, b) {
(FractionRA::Invalid, _) => FractionRA::Invalid,
(_, FractionRA::Invalid) => FractionRA::Invalid,
(FractionRA::Frac(a_frac), FractionRA::Frac(b_frac)) => {
if !a.valid() || !b.valid() {
FractionRA::Invalid
} else if a_frac + b_frac <= (1 as real) {
FractionRA::Frac(a_frac + b_frac)
} else {
FractionRA::Invalid
}
}
}
}Source§proof fn commutative(a: Self, b: Self)
proof fn commutative(a: Self, b: Self)
Source§proof fn associative(a: Self, b: Self, c: Self)
proof fn associative(a: Self, b: Self, c: Self)
Auto Trait Implementations§
impl Freeze for FractionRA
impl RefUnwindSafe for FractionRA
impl Send for FractionRA
impl Sync for FractionRA
impl Unpin for FractionRA
impl UnsafeUnpin for FractionRA
impl UnwindSafe for FractionRA
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
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() }