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] Issue to express assigns on arrays


  • Subject: [Frama-c-discuss] Issue to express assigns on arrays
  • From: dmentre at linux-france.org (David MENTRE)
  • Date: Thu, 26 Mar 2009 12:21:20 +0100

Hello,

I have following code:
------
#include <string.h>

#define MAX 12

int a[MAX];
char *c[MAX];

/*@ assigns a[..];
 */
void assign_int(void)
{
  int i;

  //@ loop invariant 0 <= i && i <= MAX;
  for (i = 0; i < MAX; i++) {
    a[i] = 0x45;
  }
}

/*@ assigns c[..];
 */
void assign_char(void)
{
  int i;

  //@ loop invariant 0 <= i && i <= MAX;
  for (i = 0; i < MAX; i++) {
    c[i] = strndup("something", MAX);
  }
}

/*@ assigns a[..];
    assigns c[..];
 */
void main(void)
{
  assign_int();
  assign_char();
}
------

On this code, I cannot prove properties "assigns a[..];" for
assign_int() and "assigns c[..];" for assign_char(). However the
assignation seems obvious to me.

I have tried "assigns a[0..11];" without success.

Could somebody explain to me what I have overlooked?

Yours,
david