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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ade418da030a5253 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.190.251.MISMATCH!transit4.readnews.com!transit3.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Message-Id: <4b938750$0$2334$4d3efbfe@news.sover.net> From: "Peter C. Chapin" Subject: Re: Trouble cutting loops with SPARK. Advice? Newsgroups: comp.lang.ada Date: Sun, 07 Mar 2010 06:04:06 -0500 References: <4b92bb37$0$2342$4d3efbfe@news.sover.net> <484e7806-9242-4c20-a057-cbc34fd67f03@g28g2000yqh.googlegroups.com> User-Agent: KNode/0.10.9 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Organization: SoVerNet (sover.net) NNTP-Posting-Host: 3f49eee6.news.sover.net X-Trace: DXC=UC5=_VJ\JBO?LifWAfoK_BK6_LM2JZB_CPZkHV4Sc`GL:WUUlR<856O?<8`J8^bV9Bjg9g1e]@moL X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:9454 Date: 2010-03-07T06:04:06-05:00 List-Id: Phil Thornley wrote: > The problem is that the value of the variables that provide the loop > bounds (in your code the variable Characters_To_Copy) can be changed > within the loop, so any reference to Characters_To_Copy within an > assertion in the loop means the *current* value, not the value that > defined the loop bound. The Examiner doesn't check to see whether > Characters_To_Copy is changed within the loop (it just assumes that it > might be changed), so in this case you have to state that it is > unchanged in the loop assertion. Great! Thanks for the help. That does make things a bit clearer. The assertion you showed works for me as well, but I'll try to take away a more general lesson from this. I'm in the process of proving a more complete program free of runtime errors and so far I've got about 1/2 of it done. However, I'm pretty sure the situation I described here comes up several times in the remaining code (with variations, of course). Thanks again. Peter