comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <PChapin@vtc.vsc.edu>
Subject: Re: SPARK loop VCs that go "one beyond" the loop?
Date: Sun, 04 Mar 2012 14:44:41 -0500
Date: 2012-03-04T14:44:41-05:00	[thread overview]
Message-ID: <vpqdnYMbkompW87S4p2dnAA@giganews.com> (raw)
In-Reply-To: <MPG.29bdc816fbebb1ae989692@news.zen.co.uk>

On 2012-03-04 13:43, Phil Thornley wrote:

> I would like to give a more considered reply than I have time for just
> now, however:
>
> I am fairly sure that what you need to add to the assertion is the
> result of the earlier check:
>     Event_Array(I).Description_Size<= Description'Length
>
> You may also need to state that the upper bound on J is not changed by
> the loop body:
>     Event_Array = Event_Array%

I tried changing the assertion to

   --# assert Event_Array(I).Description_Size <= Description'Length and
   --#        (J - 1) < Description'Length;

but that didn't help by itself. When I tried adding Event_Array = 
Event_Array% that didn't seem to do anything. I have a feeling that 
because Event_Array has mode 'in' the Examiner is already considering 
its constancy.

I did notice, however, that there was a hypothesis that talked about 
Event_Array(i__loop__2__entry). It seemed to me that the hypothesis was 
somewhat related to my conclusion so as a guess I tried

   --# assert Event_Array(I).Description_Size <= Description'Length and
   --#        I = I% and
   --#        (J - 1) < Description'Length;

That worked! However, I'm still trying to understand the general 
principle that can guide me in these situations. I feel like I have to 
resort to semi-random attempts until I stumble into something that works.

Anyway, thanks for your hint.

Peter



  reply	other threads:[~2012-03-04 19:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-04 16:11 SPARK loop VCs that go "one beyond" the loop? Peter C. Chapin
2012-03-04 18:43 ` Phil Thornley
2012-03-04 19:44   ` Peter C. Chapin [this message]
2012-03-06 10:17     ` mark.lorenzen
2012-03-20 18:18     ` Phil Thornley
2012-03-25 10:57       ` Peter C. Chapin
2012-03-25 14:14         ` Phil Thornley
replies disabled

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