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 X-Google-Thread: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.92.202 with SMTP id co10mr1036146wib.1.1363376852108; Fri, 15 Mar 2013 12:47:32 -0700 (PDT) Path: g1ni67900wig.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news.mi.ras.ru!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Tue, 12 Mar 2013 10:17:37 +0100 Organization: cbb software GmbH Message-ID: <1xb7kai1bwzyz$.jnr1zcguxscy.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-03-12T10:17:37+01:00 List-Id: On Mon, 11 Mar 2013 16:01:04 -0400, Robert A Duff wrote: > Anh Vo writes: > >> I have read ARM section 3.2.4, Subtype Predicates, I did not see any >> rules prohibiting from using attribute 'Succ as contained in the code >> nipet below. I would expect Prime'Succ (3) return 5 for next prime >> number. However, 4 is returned instead. Is this a correct behavior? > > It is standard-conforming behavior. Prime'Succ is the same as > Prime'Base'Succ. Is the profile same? Let S be a subtype of T, then is 'Succ contravariant in the result? E.g. function "'Succ" (X : S) return T'Base; for any subtype. Or it is just an erroneous inheritance of the base operation for fully covariant function "'Succ" (X : S) return S; Or, maybe, it is not even covariant in the argument. Which might be the case. Considering Prime'Succ (2) If 'Succ is convariant in the argument, this shall raise Constraint_Error because 2 is not Prime. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de