[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Soundness of table.sort
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 4 Nov 2015 13:02:48 -0200
> The manual at present does not spell out what properties "comp"
> should have to be a valid function. Maybe it should say "At most
> one of `comp(a,b)` and `comp(b,a)` may be true."
It says this about 'comp':
a function that receives two list elements and returns true when the
first element must come before the second in the final order
It does not take deep logic to conclude that no result is possible
if 'comp(a,b)' and 'comp(b,a)' are both true. But we can state that
'comp' must be asymmetric and transitive, if that helps.
-- Roberto