WAT: opCmp and opEquals woes
via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jul 27 06:06:22 PDT 2014
In order to get an overview for myself I've summarized the
various properties of different types of orders as they are
described in Wikipedia (right or wrong). I post it here in case
others have an interest in it (or corrections/extensions to it):
* Preorder:
a ≤ a (reflexivity)
if a ≤ b and b ≤ c then a ≤ c (transitivity)
* Non-strict Partial Order:
a ≤ a (reflexivity);
if a ≤ b and b ≤ c then a ≤ c (transitivity).
if a ≤ b and b ≤ a then a = b (antisymmetry);
* Strict Partial Order:
not a < a (irreflexivity),
if a < b and b < c then a < c (transitivity), and
if a < b then not b < a (asymmetry; implied by irreflexivity and
transitivity).
* Total Order:
a ≤ b or b ≤ a (totality).
If a ≤ b and b ≤ c then a ≤ c (transitivity);
If a ≤ b and b ≤ a then a = b (antisymmetry);
* Pseudo-Order:
not (a < b and b < a) (antisymmetry)
if a < b then a < c or c < b (co-transivity/comparison)
if not (a < b or b < a) then a = b (equality)
a#b === a < b or b < a (apartness/negation of equality)
http://en.wikipedia.org/wiki/Apartness_relation
* Total Preorder:
x ≲ b or b ≲ a (totality).
if a ≲ b and b ≲ c then a ≲ c (transitivity).
x ≲ b (reflexivity; implied by transitivity and totality)
* Strict Weak Order: (complement of a total preorder)
not a < a (irreflexivity).
if a < b and b < c then a < c (transitivity).
if a < b then not b < a (asymmetry; implied by irreflexivity and
transitivity).
if a is incomparable with y, and b is incomparable with z, then a
is incomparable with c (transitivity of incomparability).
More information about the Digitalmars-d
mailing list