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,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: SPARK again : for-loop vs single loop - a strange case Date: Thu, 27 May 2010 21:36:41 +0200 Organization: Ada At Home Message-ID: NNTP-Posting-Host: VsdMw8HJ6uo7b6guDb/gnA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:12096 Date: 2010-05-27T21:36:41+02:00 List-Id: Hi all, This will require some further investigation on my own side, however, I would like to open a topic about it, if ever someone wants to share about the same matter. I was proving something built around a for-loop. Every thing was going, when I've meet a trouble and decided to switch to a classic loop and an exit statement and a local variable. There was a Check clause in the for-loop, which was looking like this: for L in T range 1 .. N loop ... --# assert ...; ... --# check (2 ** (T'Pos (L) + 1)) = ((2 ** T'Pos (L)) * 2); ... end loop; This Check clause was proved by the Simplifier without any trouble. I then switch to a class loop, looking like this: L := 1; loop ... --# assert ...; ... --# check (2 ** (T'Pos (L) + 1)) = ((2 ** T'Pos (L)) * 2); exit when L = Length; L := L + 1; ... end loop; Then, the Simplifier was not able anymore to prove this Check. I don't understand, as this Check should only depends on a basic rule, a rule by definition. So why the same rule is not applied when I use a classic loop instead of a for-loop ? Does SPARK changes its strategy depending on the structure of the surrounding source so that it may or may not found a match to a rule depending on this context ? I've checked multiple times, this does not seems to be an error, it do the same each time I switch from one to the other.