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!l53g2000cwa.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Equivalent keys/elements in Ada.Containers Maps and Sets Date: 24 Jan 2007 08:50:28 -0800 Organization: http://groups.google.com Message-ID: <1169657427.881916.284570@l53g2000cwa.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.162.65.129 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1169657445 10817 127.0.0.1 (24 Jan 2007 16:50:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 24 Jan 2007 16:50:45 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: l53g2000cwa.googlegroups.com; posting-host=66.162.65.129; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news2.google.com comp.lang.ada:8494 Date: 2007-01-24T08:50:28-08:00 List-Id: On Jan 23, 7:43 pm, "Randy Brukardt" wrote: > > I haven't a clue as to what wording is missing. The original wording that > Matt and I had proposed simply gave a bunch of relationships that had to be > true. Then the mathemations got at it and rephrased it into mathematical > terms that make it hard to tell if it is actually right. (I can never > remember which is which of reflective, transitive, and symmetric). I simply > gave up at that point and trusted them... The requisite term for ordered associative containers is "strict weak ordering". An equivalence relation that is not transitive is not a strict weak ordering, and that's why the relation would not be acceptable. > > > Equality implies equivalence, so there is no puzzle. (But note that > > > equivalence does not imply equality -- hence two separate generic > > > formal functions.) > > Well, equality *ought to* imply equivalence. But Matt, you can't reason from > what was intended, but rather what the RM words require. How could it work otherwise? You first search for the element (using equivalence -- that's what "search" means), and if the (equivalent) element is found, you then compare the elements for equality. It cannot be the case that elements could be equal without also being equivalent, because you must search for the element first, and a successful search implies that the elements must be equivalent. > No, Matt is just reasoning from what he'd like to be true, not what the RM > implies. You'll note he didn't give any RM paragraph references. Because I was using the Dewar Rule. > I don't believe Matt was referring in any way to the actual > wording of the RM. I don't see any wording that would require any > relationship between "=" and Equivalent_Elements, and this is needed. It cannot be any other way, for the reason I gave above. > Nothing is "implied" by the RM. Please explain how you think that these > issues are covered by the RM wording, as opposed to what we intended the RM > to say. In the case of ordered associative containers, the less-than operator must define a "strict weak ordering". That's the most succinct statement of the precondition, since that term has a precise definition in discrete mathematics. With respect to the requirement that equality implies equivalence, I would argue that that requirement already ennunciated by existing wording (though I suppose an AARM note wouldn't hurt anything). I'm a pragmatist in these matters. No matter what the RM says (or doesn't say), the developer has all the incentive he needs to do the right thing. If he doesn't do the right thing, then his program simply won't work... -Matt