comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pcc482719@gmail.com>
Subject: Re: Trouble cutting loops with SPARK. Advice?
Date: Sun, 07 Mar 2010 06:04:06 -0500
Date: 2010-03-07T06:04:06-05:00	[thread overview]
Message-ID: <4b938750$0$2334$4d3efbfe@news.sover.net> (raw)
In-Reply-To: 484e7806-9242-4c20-a057-cbc34fd67f03@g28g2000yqh.googlegroups.com

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




  reply	other threads:[~2010-03-07 11:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06 20:33 Trouble cutting loops with SPARK. Advice? Peter C. Chapin
2010-03-07 10:22 ` Phil Thornley
2010-03-07 11:04   ` Peter C. Chapin [this message]
2010-03-07 11:41     ` Phil Thornley
2010-03-07 11:20   ` Simon Wright
2010-03-07 11:43     ` Phil Thornley
2010-03-07 16:27       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox