Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] [Jessie] loop invariant


  • Subject: [Frama-c-discuss] [Jessie] loop invariant
  • From: Claude.Marche at inria.fr (Claude Marche)
  • Date: Thu, 22 Aug 2013 17:17:30 +0200
  • In-reply-to: <CAEtoXR21n9RPnwGE_UQ7zDjqrNPjhhRMuG5kQdzM=SjH7z+9CA@mail.gmail.com>
  • References: <CAEtoXR21n9RPnwGE_UQ7zDjqrNPjhhRMuG5kQdzM=SjH7z+9CA@mail.gmail.com>


On 08/22/2013 04:55 PM, Rovedy Aparecida Busquim e Silva wrote:
> Hi,
> 
> We have a function to be proved (attached).
> 
> To include the code annotations we followed the tutorial
> (www.acm.org/conferences/sac/sac2013/T4-Handout.pdf
> <http://www.acm.org/conferences/sac/sac2013/T4-Handout.pdf>).
> 
> First, we have included the "loop assigns".
> 
> After that, we have tried to include one "loop invariant" for each
> variable of the "loop assigns".
> 
> The analysis of the loop has run without errors when there were not if
> clauses in the code. After including the if clauses the analysis has
> given four errors.

I don't understand what you mean by "without the if clauses". could you
send exactly your other version that has no error ?

Apart from that, there are dubious annotations in your code, see remark
below

> We are using the plugin Jessie, Carbon version.

more than 2 years old, 3 versions appeared after, you should consider
upgrading...

> /*@ loop invariant 0 <= j <= 3;
>     loop invariant soma >= 0.0;  
>     loop invariant \forall integer k; 0 <= k < 3 ==> (soma <= soma +
> acel[k]);                    

this formula is equivalent to

\forall integer k; 0 <= k < 3 ==> (0 <= acel[k]);

is it really what you want to specify ? It doesn't even depend on the
loop variables.

- Claude