[kernel] Parsing share/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing tests/spec/model1.c (with preprocessing)
[kernel] Parsing tests/spec/model2.c (with preprocessing)
/* Generated by Frama-C */
struct S {
   int bar ;
};
/*@
model struct S { ℤ foo };
*/
void reset(struct S *s);

void inc(struct S *s);

void dec(struct S *s);

int is_pos(struct S *s);

void main(void)
{
  struct S s;
  reset(& s);
  inc(& s);
  /*@ assert s.foo > 0; */ ;
  /*@ loop variant s.foo; */
  while (1) {
    int tmp;
    tmp = is_pos(& s);
    if (! tmp) break;
    dec(& s);
  }
  /*@ assert s.foo ≤ 0; */ ;
  return;
}

/*@ type invariant foobar(struct S s) = s.bar ≡ s.foo;

*/
/*@ requires \valid(s);
    ensures (*\old(s)).foo ≡ 0;
    assigns *s; */
void reset(struct S *s)
{
  if (s->bar == 0) ;
  return;
}

/*@ requires \valid(s);
    ensures (*\old(s)).foo > \at((*s).foo,Pre);
    assigns *s;
 */
void inc(struct S *s)
{
  s->bar += 5;
  return;
}

/*@ requires \valid(s);
    ensures (*\old(s)).foo < \at((*s).foo,Pre);
    assigns *s;
 */
void dec(struct S *s)
{
  (s->bar) --;
  return;
}

/*@ requires \valid(s);
    assigns \nothing;
    
    behavior is_true:
      assumes (*s).foo > 0;
      ensures \result ≡ 1;
    
    behavior is_false:
      assumes (*s).foo ≤ 0;
      ensures \result ≡ 0;
 */
int is_pos(struct S *s)
{
  int tmp;
  if (s->bar > 0) tmp = 1; else tmp = 0;
  return tmp;
}


