Infrastructure · Primitives

Compare

Relational check

Definition

Mechanism

Evaluate relation between two values: Equal, Less, Greater, Incomparable.

Invariants

  1. Single outcome: Compare(A, B) returns exactly one of Equal, Less, Greater, or Incomparable.
  2. Reflexive: A equals A.
  3. Operand reversal: Compare(B, A) preserves Equal and Incomparable, and swaps Less with Greater.
  4. Exact equality is transitive; a tolerance-based Equal does not carry this guarantee.

Risks

Failure modes

  1. Tolerance chaining

    under near-equality A≈B and B≈C without A≈C, so grouping by equality becomes order-dependent.

  2. 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

ParetoFront

Nondominated candidates across declared axes

References

Mind

Webtrace

Before relying on a concept, list what resembles it, what differs from it, and what depends on it

Reference

Identity

Ref
Compare#15a0
Sema ID
sema:Compare#mh:SHA-256:15a079e73bd3c280efbe2b35ab4b082b2302ab65e5dd5eb1c4fba1a5f554cebe
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Compare#mh:SHA-256:ebab280da9048edf2cc508cf0e554b153e3afd516056b4c2ae51ca85ec6ad2e1