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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9ed2b1e061ff269d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: Subtypes boundaries Date: Tue, 15 Jun 2010 01:31:47 +0200 Organization: Ada At Home Message-ID: References: <87nhicFa1kU1@mid.individual.net> <87nijlFa1kU2@mid.individual.net> <2b13f46b-65f9-450a-bb66-68c6093791c4@s9g2000yqd.googlegroups.com> NNTP-Posting-Host: PS0QnrgsJzqTWblCjdHWPQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news1.google.com comp.lang.ada:11733 Date: 2010-06-15T01:31:47+02:00 List-Id: Le Mon, 14 Jun 2010 23:01:17 +0200, Gautier write-only = a =E9crit: > To my surprise, it looks legal Ada. The base type of IDEFIX is ASTERIX, by definition. [ARM 2005 3.5(5)] just says: > For a subtype_indication containing a range_constraint, either directl= y = > or as part of some other scalar_constraint, the type of the range shal= l > resolve to that of the type determined by the subtype_mark of the > subtype_indication. Nowhere in 3.5 I could find something explicitly stating when the error = = must be detected (compile time or runtime). If the ranges was defined using non-literal, like values of type ASTERIX= , = and if these was variables, then there would be no other way except a = runtime detection of an error. What disturbed me, is that a literal here, match an ASTERIX while it is = = statically out-of range ? Needs investigation in the RM (or may be the reference lacks something = here ?). What is the RM part involved here ? -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.