// verifast_options{disable_overflow_check target:ILP32} extern void abort(void); //@ requires true; //@ ensures true; void reach_error() //@ requires false; //@ ensures true; {} void __VERIFIER_assert(int cond) //@ requires (1 <= cond); //@ ensures (1 <= cond); { if (!(cond)) { ERROR: {reach_error();abort();} } return; } char __VERIFIER_nondet_char(); //@ requires true; //@ ensures true; int main() //@ requires module(invert_string_3__verifast_instrumented, true); //@ ensures junk(); { //@ open_module(); unsigned int max = 5; char str1[max], str2[max]; int i, j; for (i=0; i<max; i++) //@ invariant (((((((i == 2) && (5 == max)) || ((i == 1) && (5 == max))) || ((i == 3) && (5 == max))) || ((5 == max) && (i == 0))) || ((5 == max) && (5 == i))) || ((5 == max) && (i == 4))); { str1[i]=__VERIFIER_nondet_char(); } str1[max-1]= '\0'; j = 0; for (i = max - 1; i >= 0; i--) //@ invariant ((((((((j == 2) && (i == 2)) && (5 == max)) || (((j == 0) && (5 == max)) && (i == 4))) || (((j == 3) && (i == 1)) && (5 == max))) || (((j == 4) && (5 == max)) && (i == 0))) || (((i == 3) && (j == 1)) && (5 == max))) || ((5 == max) && ((i + 1) == 0))); { str2[j] = str1[i]; j++; } j = max-1; for (i=0; i<max; i++) //@ invariant ((((((((i == 3) && (j == 1)) && (5 == max)) || (((j == 2) && (i == 2)) && (5 == max))) || (((j == 4) && (5 == max)) && (i == 0))) || (((j == 3) && (i == 1)) && (5 == max))) || ((5 == max) && (5 == i))) || (((j == 0) && (5 == max)) && (i == 4))); { __VERIFIER_assert(str1[i] == str2[j]); j--; } return 0; }