// verifast_options{disable_overflow_check target:ILP32} extern void abort(void); //@ requires true; //@ ensures true; void reach_error() //@ requires false; //@ ensures true; {} // Category: Loops // Verification result: TRUE extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) //@ requires (1 <= cond); //@ ensures (1 <= cond); { if(!(cond)) ERROR: {reach_error();abort();} return; } int main() //@ requires module(mod3__verifast_instrumented, true); //@ ensures junk(); { //@ open_module(); unsigned int x = __VERIFIER_nondet_int(); unsigned int y = 1; while(__VERIFIER_nondet_int()) //@ invariant ((y == 1) || ((x % 3) < 1)); { if(x % 3 == 1){ x += 2; y = 0;} else{ if(x % 3 == 2){ x += 1; y = 0;} else{ if(__VERIFIER_nondet_int()) //@ requires true; //@ ensures true; { x += 4; y = 1;} else{ x += 5; y = 1;} } } } if(y == 0) __VERIFIER_assert(x % 3 == 0); return 0; }