From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f5142427a147e149 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!13g2000cwe.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Equivalent keys/elements in Ada.Containers Maps and Sets Date: 24 Jan 2007 12:56:03 -0800 Organization: http://groups.google.com Message-ID: <1169672163.617949.214430@13g2000cwe.googlegroups.com> References: <45b60602$0$24602$39db0f71@news.song.fi> <1169567122.501077.189450@s48g2000cws.googlegroups.com> <45b69499$0$31527$39db0f71@news.song.fi> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1169672179 14983 127.0.0.1 (24 Jan 2007 20:56:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 24 Jan 2007 20:56:19 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 13g2000cwe.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:8514 Date: 2007-01-24T12:56:03-08:00 List-Id: On Jan 23, 4:43 pm, "Randy Brukardt" wrote: > > This function "<" is a strict ordering relation for T, as required for > > Ada.Containers.Ordered_Maps/Sets. But the "equivalence" relation induced > > by this "<" is not transitive: X and Y are "equivalent" (both X < Y and > > Y < X are False) and Y and Z are "equivalent" (both Y < Z and Z < Y are > > False) but X and Z are not "equivalent" (because X < Z is True). > I don't believe this function meets the requirements. It has to be the case > that the function is reversible (we can't know the order of the operands) > and it can't be the case that > neither (X < Z) nor (Z < X) nor (X = Z) (where "=" means equivalent). > > One of these three things has to hold, or the function is not acceptable. This doesn't make sense to me. "Equivalent" is defined in terms of "<" (A.18.9(78/2)), and it's defined in such a way that neither (X < Z) nor (Z < X) nor (X === Z) [using === for "equivalent"] will tautologically be true. Thus, it's logically impossible to come up with a function "<" that is "unacceptable" according to the last criterion you state. As far as I can tell from the wording of the RM (A.18.9(79/2)), the function "<" that Niklas wrote does indeed meet the requirements: it's irreflexive (A < A is false for all A), asymmetric (A < B and B < A are not both true, for all A and B), and transitive (A < B and B < C implies A < C, for all A, B, and C---because, in this case, there are no such A, B, and C for which the first two relations hold). If there is some other requirement that "<" should meet but doesn't, then that requirement is missing from the RM. -- Adam