Expand description
Traits which describe basic concepts from order theory:
LeastElementandGreatestElementfor unique extremal values.LatticeandBoundedLattice, built up fromLowerSemilattice,UpperSemilatticeandBoundedLowerSemilattice,BoundedUpperSemilatticerespectively.TrySuccessor,SuccessorExceptForGreatestandSuccessorfor orders with unique successors for some, almost all, or all values respectively.TryPredecessor,PredecessorExceptForLeastandPredecessorfor orders with unique predecessors for some, almost all, or all values respectively.
Nothing too fancy going on in this crate, just providing a couple traits which are really handy to be able to use as trait bounds every once in a while.
Traitsยง
- Bounded
Lattice - A bounded lattice is a type which is both a
BoundedLowerSemilatticeand aBoundedUpperSemilattice. Every bounded lattice is also a regular lattice. - Bounded
Lower Semilattice - A
LowerSemilatticewith a least element. - Bounded
Upper Semilattice - An
UpperSemilatticewith a greatest element. - Greatest
Element - A partial order with a greatest element (which is necessarily unique).
- Lattice
- A lattice is a type which is both a
LowerSemilatticeand anUpperSemilattice. - Least
Element - A partial order with a least element (which is necessarily unique).
- Lower
Semilattice - A partial order in which for any two elements there exists a unique greatest lower bound.
- Predecessor
- A partial order where every element has a unique predecessor.
- Predecessor
Except ForLeast - A partial order where every element but the least element has a unique predecessor.
- Successor
- A partial order where every element has a unique successor.
- Successor
Except ForGreatest - A partial order where every element but the greatest element has a unique successor.
- TryPredecessor
- A partial order in which some elements have predecessors, i.e., unique greatest lesser values.
- TrySuccessor
- A partial order in which some elements have successors, i.e., unique least greater values.
- Upper
Semilattice - A partial order in which for any two elements there exists a unique least upper bound.