Skip to content

LeastUpperBound ​

The join of two values in a lattice: the least value at or above both.

LeastUpperBound(a, b)The join of two values in a lattice: the least value at or above both.
Typed signatures
TypePackageApplies
(any, any) -> unknownstructuresalways

Domain: Structures

Details
  • The Lattice protocol's member, and what Max folds when its arguments' type is a lattice.

Examples

Basic #

In a linear order, the larger of the two

live ↗
InLeastUpperBound(3,5)\mathrm{LeastUpperBound}(3, 5)Out55
Scope #

Under dominance, the join of two incomparable partitions

live ↗
InLeastUpperBound(IntegerPartition⁡([3,1,1,1]),IntegerPartition⁡([2,2,2]))\mathrm{LeastUpperBound}({\operatorname{IntegerPartition}}([3, 1, 1, 1]), {\operatorname{IntegerPartition}}([2, 2, 2]))OutIntegerPartition⁡([3,2,1]){\operatorname{IntegerPartition}}([3, 2, 1])
About
Examples2

See also: GreatestLowerBound, Max, Compare