// verifast_options{disable_overflow_check target:ILP32} extern void abort(void); //@ requires true; //@ ensures true; void reach_error() //@ requires false; //@ ensures true; {} extern void __VERIFIER_assert(int cond); void __VERIFIER_assert(int cond) //@ requires (cond != 0); //@ ensures (cond != 0); { if (!(cond)) { ERROR: {reach_error();abort();} } return; } extern int __VERIFIER_nondet_int(); //@ requires true; //@ ensures true; int main() //@ requires module(sum01_2__verifast_instrumented, true); //@ ensures junk(); { //@ open_module(); int i, n=__VERIFIER_nondet_int(), sn=0; if (!(n < 1000 && n >= -1000)) return 0; for(i=1; i<=n; i++) //@ invariant (((sn == 0) && (i == 1)) || ((sn <= (n * 2)) && ((2 + sn) == (i * 2)))); { sn = sn + (2); } __VERIFIER_assert(sn==n*(2) || sn == 0); return 0; }