[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing tests/aorai/test_recursion1.c (with preprocessing)
tests/aorai/test_recursion1.c:22:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead.
tests/aorai/test_recursion1.c:43:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead.
tests/aorai/test_recursion1.c:55:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead.
[aorai] Welcome to the Aorai plugin
[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing /tmp/aorai_test_recursion10.i (no preprocessing)
/* Generated by Frama-C */
enum aorai_ListOper {
    op_count = 2,
    op_countOne = 1,
    op_main = 0
};
enum aorai_OpStatusList {
    aorai_Terminated = 1,
    aorai_Called = 0
};
/*@
axiomatic string_len {
  logic ℤ string_len{L}(char *s) ;
  
  axiom strlen0{L}: ∀ char *s; \valid{L}(s) ⇒ string_len{L}(s) ≥ 0;
  
  axiom strlen1{L}:
    ∀ char *s;
      \valid{L}(s) ∧ *(s+0) ≡ '\000' ⇒ string_len{L}(s) ≡ 0;
  
  axiom strlen2{L}:
    ∀ char *s; \valid{L}(s) ⇒ *(s+string_len{L}(s)) ≡ '\000';
  
  axiom strlen3{L}:
    ∀ char *s;
      \valid{L}(s) ∧ *(s+0) ≢ '\000' ⇒
      string_len{L}(s) ≡ 1+string_len{L}(s+1) ∧ \valid{L}(s+1);
  
  axiom strlen4{L}:
    ∀ char *s;
      \valid{L}(s) ⇒
      (∀ ℤ i; 0 ≤ i < string_len{L}(s) ⇒ *(s+i) ≢ '\000');
  
  }
 */
/*@
predicate valid_string{L}(char *s) =
  \valid{L}(s) ∧ \valid{L}(s+(0 .. string_len{L}(s)));
 */
/*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */
/*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */
/*@ ghost int T0_S2 = 0; */
/*@ ghost int T0_init = 1; */
/*@ ghost int accept_S1 = 0; */
/*@ ensures aorai_CurOpStatus ≡ aorai_Called;
    ensures aorai_CurOperation ≡ op_countOne;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_in:
      assumes 1 ≡ T0_S2;
      ensures 1 ≡ T0_S2;
    
    behavior buch_state_T0_S2_out:
      assumes 0 ≡ T0_S2;
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_out:
      ensures 0 ≡ accept_S1;
 */
extern void countOne_pre_func(char *argv);

/*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1;
    ensures aorai_CurOpStatus ≡ aorai_Terminated;
    ensures aorai_CurOperation ≡ op_countOne;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_in:
      assumes 1 ≡ T0_S2;
      ensures 1 ≡ T0_S2;
    
    behavior buch_state_T0_S2_out:
      assumes 0 ≡ T0_S2;
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_out:
      ensures 0 ≡ accept_S1;
 */
extern void countOne_post_func(int res);

/*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1;
    requires valid_string(argv);
    ensures \result ≡ string_len(\old(argv));
    
    behavior Buchi_property_behavior:
      ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1;
      ensures 1 ≡ T0_S2;
 */
int countOne(char *argv)
{
  int __retres;
  int r;
  int tmp;
  countOne_pre_func(argv);
  r = 0;
  if ((int)*(argv + 0) == 0) {
    __retres = 0;
    goto return_label;
  }
  r ++;
  tmp = countOne(argv + 1);
  r += tmp;
  __retres = r;
  return_label: countOne_post_func(__retres);
  return __retres;
}

/*@ ensures aorai_CurOpStatus ≡ aorai_Called;
    ensures aorai_CurOperation ≡ op_count;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_in:
      assumes 1 ≡ accept_S1;
      ensures 1 ≡ T0_S2;
    
    behavior buch_state_T0_S2_out:
      assumes 0 ≡ accept_S1;
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_out:
      ensures 0 ≡ accept_S1;
 */
extern void count_pre_func(int argc, char **argv);

/*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1;
    ensures aorai_CurOpStatus ≡ aorai_Terminated;
    ensures aorai_CurOperation ≡ op_count;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_out:
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_in:
      assumes 1 ≡ T0_S2;
      ensures 1 ≡ accept_S1;
    
    behavior buch_state_accept_S1_out:
      assumes 0 ≡ T0_S2;
      ensures 0 ≡ accept_S1;
 */
extern void count_post_func(int res);

/*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init;
    requires
      argc > 0 ∧ \valid(argv) ∧ \valid(argv+(0 .. argc)) ∧
      (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv+i)));
    ensures \result ≥ 0;
    
    behavior Buchi_property_behavior:
      ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init;
      ensures 1 ≡ accept_S1;
 */
int count(int argc, char **argv)
{
  int s;
  count_pre_func(argc,argv);
  s = countOne(*(argv + 0));
  if (argc > 1) {
    int tmp_0;
    tmp_0 = count(argc - 1,argv + 1);
    s += tmp_0;
  }
  count_post_func(s);
  return s;
}

/*@ ensures aorai_CurOpStatus ≡ aorai_Called;
    ensures aorai_CurOperation ≡ op_main;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_out:
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_in:
      assumes 1 ≡ T0_init;
      ensures 1 ≡ accept_S1;
    
    behavior buch_state_accept_S1_out:
      assumes 0 ≡ T0_init;
      ensures 0 ≡ accept_S1;
 */
extern void main_pre_func(int argc, char **argv);

/*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init;
    ensures aorai_CurOpStatus ≡ aorai_Terminated;
    ensures aorai_CurOperation ≡ op_main;
    assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1;
    
    behavior buch_state_T0_S2_in:
      assumes 1 ≡ accept_S1;
      ensures 1 ≡ T0_S2;
    
    behavior buch_state_T0_S2_out:
      assumes 0 ≡ accept_S1;
      ensures 0 ≡ T0_S2;
    
    behavior buch_state_T0_init_out:
      ensures 0 ≡ T0_init;
    
    behavior buch_state_accept_S1_in:
      assumes 1 ≡ accept_S1;
      ensures 1 ≡ accept_S1;
    
    behavior buch_state_accept_S1_out:
      assumes 0 ≡ accept_S1;
      ensures 0 ≡ accept_S1;
 */
extern void main_post_func(int res);

/*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1;
    requires
      argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv)) ∧
      \valid(argv+(0 .. argc)) ∧
      (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv+i)));
    ensures \result ≡ 1;
    
    behavior aorai_acceptance:
      ensures 1 ≡ accept_S1;
    
    behavior Buchi_property_behavior:
      ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2;
      ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1;
      ensures 0 ≡ T0_init;
      ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1;
 */
int main(int argc, char **argv)
{
  int __retres;
  int somme;
  main_pre_func(argc,argv);
  somme = 0;
  if (argc > 0) somme = count(argc,argv);
  __retres = 1;
  main_post_func(__retres);
  return __retres;
}


