// verifast_options{disable_overflow_check target:ILP32} /* shift_add algorithm for computing the product of two natural numbers */ extern void abort(void); //@ requires true; //@ ensures true; void reach_error() //@ requires false; //@ ensures true; {}extern int __VERIFIER_nondet_int(void); //@ requires true; //@ ensures true; void assume_abort_if_not(int cond) //@ requires true; //@ ensures (cond != 0); { if(!cond) {abort();} } void __VERIFIER_assert(int cond) //@ requires (1 <= cond); //@ ensures (1 <= cond); { if (!(cond)) { ERROR: {reach_error();} } return; } int main() //@ requires module(prodbin_ll_valuebound10__verifast_instrumented, true); //@ ensures junk(); { //@ open_module(); int a, b; long long x, y, z; a = __VERIFIER_nondet_int(); assume_abort_if_not(a>=0 && a<=10); b = __VERIFIER_nondet_int(); assume_abort_if_not(b>=0 && b<=10); assume_abort_if_not(b >= 1); x = a; y = b; z = 0; while (1) //@ invariant ((((((((((((((z == 0) && (y == (b / 2))) && ((a * 2) == x)) && (0 <= a)) && ((b % 2) != 1)) && (1 <= y)) && (a <= 10)) && (y <= 5)) || ((((((((1 <= (b % 2)) && ((z + (y * x)) == (b * a))) && ((a * 2) == x)) && (0 <= a)) && (1 <= b)) && (b <= 10)) && (a <= 10)) && ((( - 1 + b) / 2) == y))) || ((((((((z == 0) && ((y * x) == (b * a))) && (y <= 2)) && (0 <= a)) && (1 <= b)) && (1 <= y)) && (b <= 10)) && (a <= 10))) || (((((((z == 0) && (b == y)) && (0 <= a)) && (1 <= y)) && (b <= 10)) && (a == x)) && (a <= 10))) || (((((((0 <= y) && ((z + (y * x)) == (b * a))) && (0 <= a)) && (1 <= b)) && (b <= 10)) && (a <= 10)) && (y <= 1))) || ((((((((0 <= y) && ((z + (y * x)) == (b * a))) && (y <= 2)) && (0 <= a)) && (x == (z * 2))) && (1 <= b)) && (b <= 10)) && (a <= 10))) || (((((((((a == z) && (1 <= (b % 2))) && ((a * 4) == x)) && (0 <= a)) && (0 <= b)) && (((( -1 + b) / 2) % 2) != 1)) && ((( - 1 + b) / 4) == y)) && (b <= 10)) && (a <= 10))); { __VERIFIER_assert(z + x * y == (long long) a * b); if (!(y != 0)) break; if (y % 2 == 1) { z = z + x; y = y - 1; } x = 2 * x; y = y / 2; } __VERIFIER_assert(z == (long long) a * b); return 0; }