Infrastructure · Primitives
Compare
Relational check
Definition
Mechanism
Evaluate relation between two values: Equal, Less, Greater, Incomparable.
Invariants
- Single outcome: Compare(A, B) returns exactly one of Equal, Less, Greater, or Incomparable.
- Reflexive: A equals A.
- Operand reversal: Compare(B, A) preserves Equal and Incomparable, and swaps Less with Greater.
- Exact equality is transitive; a tolerance-based Equal does not carry this guarantee.
Risks
Failure modes
Tolerance chaining
under near-equality A≈B and B≈C without A≈C, so grouping by equality becomes order-dependent.
Undeclared coercion
values are converted by a rule the comparator did not declare, producing Equal, Less, or Greater where its declared relation would return Incomparable.
Relationships
Root pattern: builds on nothing in this library.
Used by
Composes with
Nondominated candidates across declared axes
References
Society
Protocol adaptation wrapper
Mind
Before relying on a concept, list what resembles it, what differs from it, and what depends on it
Reference
