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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.42.82.79 with SMTP id c15mr1577933icl.13.1425396789316; Tue, 03 Mar 2015 07:33:09 -0800 (PST) X-Received: by 10.140.83.165 with SMTP id j34mr434551qgd.8.1425396789286; Tue, 03 Mar 2015 07:33:09 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!hl2no3404028igb.0!news-out.google.com!n6ni191qar.0!nntp.google.com!w8no139942qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Mar 2015 07:33:09 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.186.238.53; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 31.186.238.53 References: <851b7d3c-4ac3-4fba-852d-c2975050da74@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: SPARK internal error? From: Maciej Sobczak Injection-Date: Tue, 03 Mar 2015 15:33:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 1919 X-Received-Body-CRC: 97705870 Xref: news.eternal-september.org comp.lang.ada:25092 Date: 2015-03-03T07:33:09-08:00 List-Id: > The following passes and makes gnatprove produce > warning addressing range/pre/post/loop_invariant: >=20 > procedure Sort (A : in out My_Array) is > begin > for I in A'Range loop > declare > X : My_Array (I .. A'Last) :=3D (others =3D> 0); Yes, in the line above. But why? We have a precondition that guarantees the= re are no empty slices here - and even without it, the fact that we are wit= hin the for loop over A'Range should already guarantee that both I and A'La= st have safe values. Something is wrong here. And of course, partially sorting a temporary array does not help in the pro= of that the main array becomes sorted as well... --=20 Maciej Sobczak * http://www.inspirel.com/