BoundedLattice

Trait BoundedLattice 

Source
pub trait BoundedLattice: BoundedJoinSemilattice + BoundedMeetSemilattice { }
Expand description

A bounded lattice: a lattice with both bottom and top elements.

Laws (not enforced by type system):

  • All bounded join-semilattice laws
  • All bounded meet-semilattice laws
  • Absorption: a.join(a.meet(b)) == a and a.meet(a.join(b)) == a
  • Complement bounds: bottom().meet(a) == bottom() and top().join(a) == top()

§Example

use algebra_core::{BoundedJoinSemilattice, BoundedMeetSemilattice, BoundedLattice};

// bool is a bounded lattice
assert_eq!(bool::bottom(), false);
assert_eq!(bool::top(), true);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§