guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: sorted?


From: Maxime Devos
Subject: RE: sorted?
Date: Thu, 12 Dec 2024 16:40:14 +0100

Van: tomas@tuxteam.de
Verzonden: maandag 9 december 2024 21:38
Aan: Mikael Djurfeldt
CC: Stefan Schmiedl; guile-user@gnu.org
Onderwerp: Re: sorted?

>On Mon, Dec 09, 2024 at 08:45:33PM +0100, Mikael Djurfeldt wrote:
>> On Mon, Dec 9, 2024 at 8:23 PM <tomas@tuxteam.de> wrote:
>> 
>> >   (lambda (p1 p2) (< (car p1) (car p2)))
>> >
>> > Then you'd need a corresponding equal, because otherwise you
>> > end up with things which are neither less nor equal nor greater,
>> > i.e. the ordering isn't total, which is bad for sorting :)
>> >
>> 
>> `sort' assumes that the elements belong to a "strict total order", which
>> means that the connectedness-axiom is true, which means that a = b is
>> *equivalent to* not (a < b or a > b). So, we don't need equal.
>
>I think we need one of = or >, which we both don't have. We just have <,
which is one too few.

You do have >, ‘a > b’ is the same as ‘b < a’. This usually isn’t mentioned in 
the axioms of orderings because it’s simply notation – whenever you mirror the 
symbol of a binary relation, that is simply notation for swapping the arguments 
(in logic those would be called terms I think) (a < b  = b > a).

>From ‘<’, you have ‘=’, by the equivalence mentioned above.

Just because it’s not passed explicitly, doesn’t mean you don’t have it – you 
can derive ‘=’ from the axioms and some logic.

Did you see my previous mail, where I said pretty much the same as what Tomas 
is writing (except about sorted? instead of sort)?

Best regards,
Maxime Devos


reply via email to

[Prev in Thread] Current Thread [Next in Thread]