pub struct BooleanSemiring(/* private fields */);Expand description
Boolean semiring for ordinary exact relation semantics.
BooleanSemiring is the first built-in annotation family in G4. It keeps
the exact meaning already used by the published unary, binary, and n-ary
relations:
falseis zero and represents absence;trueis one and represents presence or identity;adduses logical OR;muluses logical AND.
§Examples
use relmath::annotated::{BooleanSemiring, Semiring};
let direct = BooleanSemiring::FALSE;
let first_leg = BooleanSemiring::TRUE;
let second_leg = BooleanSemiring::TRUE;
assert_eq!(direct.add(&first_leg), BooleanSemiring::TRUE);
assert_eq!(first_leg.mul(&second_leg), BooleanSemiring::TRUE);
assert!(BooleanSemiring::zero().is_zero());
assert!(BooleanSemiring::one().is_one());Implementations§
Source§impl BooleanSemiring
impl BooleanSemiring
Trait Implementations§
Source§impl Clone for BooleanSemiring
impl Clone for BooleanSemiring
Source§fn clone(&self) -> BooleanSemiring
fn clone(&self) -> BooleanSemiring
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BooleanSemiring
impl Debug for BooleanSemiring
Source§impl Default for BooleanSemiring
impl Default for BooleanSemiring
Source§fn default() -> BooleanSemiring
fn default() -> BooleanSemiring
Returns the “default value” for a type. Read more
Source§impl From<BooleanSemiring> for bool
impl From<BooleanSemiring> for bool
Source§fn from(value: BooleanSemiring) -> Self
fn from(value: BooleanSemiring) -> Self
Converts to this type from the input type.
Source§impl From<bool> for BooleanSemiring
impl From<bool> for BooleanSemiring
Source§impl Hash for BooleanSemiring
impl Hash for BooleanSemiring
Source§impl Ord for BooleanSemiring
impl Ord for BooleanSemiring
Source§fn cmp(&self, other: &BooleanSemiring) -> Ordering
fn cmp(&self, other: &BooleanSemiring) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BooleanSemiring
impl PartialEq for BooleanSemiring
Source§impl PartialOrd for BooleanSemiring
impl PartialOrd for BooleanSemiring
Source§impl Semiring for BooleanSemiring
impl Semiring for BooleanSemiring
impl Copy for BooleanSemiring
impl Eq for BooleanSemiring
impl StructuralPartialEq for BooleanSemiring
Auto Trait Implementations§
impl Freeze for BooleanSemiring
impl RefUnwindSafe for BooleanSemiring
impl Send for BooleanSemiring
impl Sync for BooleanSemiring
impl Unpin for BooleanSemiring
impl UnsafeUnpin for BooleanSemiring
impl UnwindSafe for BooleanSemiring
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