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: a07f3367d7,b49755ab898bcffd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!f14g2000vbn.googlegroups.com!not-for-mail From: Phil Thornley Newsgroups: comp.lang.ada Subject: Re: SPARK again : for-loop vs single loop - a strange case Date: Fri, 28 May 2010 04:50:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <2b6ae662-77e2-4d1a-a2b2-3df54f8ab98e@v37g2000vbv.googlegroups.com> NNTP-Posting-Host: 80.177.171.182 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275047451 23116 127.0.0.1 (28 May 2010 11:50:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 28 May 2010 11:50:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f14g2000vbn.googlegroups.com; posting-host=80.177.171.182; posting-account=Fz1-yAoAAACc1SDCr-Py2qBj8xQ-qC2q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12119 Date: 2010-05-28T04:50:51-07:00 List-Id: On 28 May, 10:00, Yannick Duch=EAne (Hibou57) wrote: > [...] So I removed the L <=3D Length and left L >=3D 1 =A0 > only, which was shown to be enough. > > Without you, I would not have been able to guess the trouble was there, a= s =A0 > to me, it was obvious L >=3D 1, as the type of L, which is really =A0 > Length_Type, has Length_Type'First =3D 1. > > This is still strange in some way, as if I do L >=3D Length_Type'First, i= t =A0 > works. > > So the Assert clause even drops implicit hypotheses about numeric type = =A0 > bounds ? I was thinking this ones were preserved even after an Assert =A0 > clause. > > I was pretty sure Assert was still preserving somethings, as I feel I =A0 > remember I have read something suggesting that in one of the Praxis's =A0 > documentation and in yours as well (do not remember which PDF file, and = =A0 > there many to check). This thread persuaded me to finally check precisely what the Examiner generates for local variables (I have always just assumed that it doesn't do anything - looking back through the release notes, this changed in Release 7.2). The statement about this is in GenRTCs section 4.5.2.1; hypotheses are generated that local variables are in-type if various conditions are met that ensure that no out-of-type value can be assigned in the procedure (no 'significant' data flow errors, no read from external variables and no use of Unchecked_Conversion). So the fact that adding L >=3D Length_Type'First allows the Simplifier to prove the check suggests that you are not getting these hypotheses - possibly for one of the above reasons. If you should be getting these hypotheses then post (or email) the complete SPARKable code. Cheers, Phil