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] While/if conditions and slicing



Hello,

Le 13/03/2020 à 08:15, Virgile Prevosto a écrit :
> 
> I haven't checked in detail, hence the answer below should be taken with a grain of salt, but I tend
> to think that this is due to the way loops are represented internally by Frama-C. Namely, the Loop
> AST node does not contain directly the test.

To make the test appear outside the loop you can use syntactic unrolling, which is handy but doesn't
scale well. You can play with `-ulevel n` or loop specific pragma in order to obtain the slice you
wanted.

int f() {
  int x = 1;
  /*@ loop pragma UNROLL_LOOP 1; @*/
  while (x > 0) {
    x--;
  }
  return x;
}



/* Generated by Frama-C */
int f(void)
{
  int x = 1;
  x --;
  return x;
}


Best,

-- 
François