[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table.sort gives wrong result on partially ordered set
- From: Andrew Gierth <andrew@...>
- Date: Mon, 04 Jan 2021 01:22:28 +0000
>>>>> "Egor" == Egor Skriptunoff <egor.skriptunoff@gmail.com> writes:
>> The specific requirement that is violated is that the < relation
>> used for the sort must be a strict partial order with this
>> additional requirement: the relation (not (a < b or b < a)) must be
>> an equivalence relation.
Egor> Interesting.
Egor> But this condition is too complex to be included in the manual.
Egor> It would be more natural to simply replace "strict partial order"
Egor> with "strict total order" :-)
"strict weak order" is the correct minimum requirement - a total order
is not necessary. (A strict weak order can be considered as a total
order over classes of equivalent elements; if you're sorting data where
distinguishable values can sort equally, e.g. objects sorted by some
property value, this distinction matters.)
The documentation is incorrect to state that a strict partial order is
sufficient. (I believe I may have pointed this out before.)
--
Andrew.