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] Unable to prove assigns clause for array


  • Subject: [Frama-c-discuss] Unable to prove assigns clause for array
  • From: Boris.Hollas at de.bosch.com (Hollas Boris (CR/AEY1))
  • Date: Mon, 30 Mar 2009 18:12:42 +0200

Hello,

I'm trying to verify the following code:


/*@ requires \valid(a+ (0..aLength-1));
    requires aLength >= 2;
    assigns a[0..aLength-2];
*/
void foo(int a[], int aLength) {
  int j;
  const int x;

  x = a[aLength-1];
  /*@    loop invariant x == a[aLength-1];
         loop invariant 0 <= j;
  */
  for(j=0; j<aLength-1; j++) {
    a[j] = 0;
  }
}


However, I'm unable to prove assigns a[0..aLength-2]. I recall that David Mentre had a similar problem proving an assigns clause on arrays.

In addition, Simplify (but not Alt-Ergo) is unable to check  x = a[aLength-1] for arithmetic overflow.

Any suggestions?

- Boris