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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 5 Apr 2013 18:11:54 +0200 Organization: cbb software GmbH Message-ID: <16wai67izvmu5.13yz864sx1cqd$.dlg@40tude.net> References: <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <1cfhriq4xpg9s$.3yl33z705wpn$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: rHWOzyHApalsT5sEUcbvVQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3419 Xref: number.nntp.dca.giganews.com comp.lang.ada:180935 Date: 2013-04-05T18:11:54+02:00 List-Id: On Fri, 5 Apr 2013 16:44:53 +0200, Stefan.Lucks@uni-weimar.de wrote: > On Fri, 5 Apr 2013, Dmitry A. Kazakov wrote: > >>> Numbers, naturals, integers, rationals and reals, are semantically exactly >>> same except for encoding [representation] and constraints. >> >> A quite common misunderstanding. Structure such as field is not same as a >> subset. To see the difference between R and Z consider the following >> predicate: >> >> forall x in S exists y such as x=1/y [multiplicative inverse] >> >> This is true for S=R and false for S=Z. > > Fair enough! > > But the same is true for N and Z: every in Z has an additive inverse, but > not every number in N. If the non-existence of a multiplicative inverse > would justify different root types for Z and R, why should the > non-existence of an additive inverse not justify different root types for > N and Z (Universal_Positive versus Universal_Integer). That depends solely on the application domain. When numbers are used as indices (ordinals) they require certain properties, e.g. to form an additive group. Other application domains require other properties. That is why the language shall not dictate which interfaces (and thus properties) a given type has to implement. > As it turns out, the fact that Naturals and Positives have the same > representation as Integers, while Float has a different one, matters more > than any "mathematical structure" ... Nope, representation never matter. Employee ID and task ID may have same representation. That does not mean anything. Nominal type equivalence was a corner stone of Ada design. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de