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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w1g2000prd.googlegroups.com!not-for-mail From: Eric Hughes Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Mon, 14 Apr 2008 08:50:21 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9a3ad8ca-9f44-42db-9f7c-c5f9e3ee60f3@w1g2000prd.googlegroups.com> References: <47F26C46.3010607@obry.net> <44d88b93-6a90-4c18-8785-2164934ba700@a9g2000prl.googlegroups.com> <47F652F7.9050502@obry.net> <47f7028d$1_6@news.bluewin.ch> <47F749CB.30806@obry.net> <96x8my4o4m7e.fskzcb6i31ty$.dlg@40tude.net> <276e98e3-3b3b-4cbf-b85c-dcae79f11ec5@b5g2000pri.googlegroups.com> <013e1d52-c25f-49ea-83ef-6ac4860858bf@s13g2000prd.googlegroups.com> <8g2rpvi2ahu0$.1ebsyq5yu1whf.dlg@40tude.net> NNTP-Posting-Host: 166.70.57.218 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1208188221 23082 127.0.0.1 (14 Apr 2008 15:50:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 Apr 2008 15:50:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w1g2000prd.googlegroups.com; posting-host=166.70.57.218; posting-account=5RIiTwoAAACt_Eu87gmPAJMoMTeMz-rn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20938 Date: 2008-04-14T08:50:21-07:00 List-Id: On Apr 14, 3:07 am, "Dmitry A. Kazakov" wrote: > If you are aiming at Liskov substitutability > principle, But I'm not aiming for that. It's related, to be sure, but it's not the same. If you don't acknowledge that a universal type is a different creature than an ordinary type, then you would have to see only preexisting relationships. > > So I can now outline what the relationship ought to be: > > -- The set of values of an implemented type is > > a _subset_ of the terms of the universal type. > > Counterexample: NaN of Float. I take from what you're saying that the ordinary way of bringing floating point arithmetic into a language is not an implementation of universal Real numbers. That's true. We can talk about optimal encodings and less-than-optimal encodings, if you'd like, but I really don't see how the exceptional values of floating point numbers violate the spirit of the rule. NaN, but even more so overflow and underflow, even though they're defined for hardware implementations, could well be forbidden as accessible values from within the language. You clearly couldn't eliminate this kind of type from ordinary use soon, because it's well-embedded in practice and skills. The issue then becomes whether it would be beneficial to also have a Real-implementing type in the pattern I've mentioned. The differences would be small. Since a calculation that results in an exceptional value raises an exception, such a value that would otherwise be assigned is simply not assigned (or even made visible). I think that takes care of all the modification that would be needed. > The set of values of a derived type is neither subset or superset. It is a > different set. If you insist, but this is not derivation. > > -- The set of operators on an implemented type > > _satisfy_ the axioms of the universal type. > > This cannot work because any implementation is necessarily a DFA. ??? Eric