// verifast_options{disable_overflow_check target:ILP32} extern void abort(void); //@ requires true; //@ ensures true; void reach_error() //@ requires false; //@ ensures true; {} /* * Recursive computation of fibonacci numbers. * * Author: Matthias Heizmann * Date: 2013-07-13 * */ extern int __VERIFIER_nondet_int(void); //@ requires true; //@ ensures true; int fibonacci(int n) //@ requires true; //@ ensures ((((((((((((8 <= result) && (6 == n)) || (n < 1)) || ((2 == n) && (1 <= result))) || ((4 == n) && (3 <= result))) || ((3 == n) && (2 <= result))) || ((5 == n) && (5 <= result))) || ((7 == n) && (13 <= result))) || ((1 <= result) && (1 == n))) || (33 < result)) || ((21 <= result) && (8 == n))) && (0 <= result)); { if (n < 1) { return 0; } else if (n == 1) { return 1; } else { return fibonacci(n-1) + fibonacci(n-2); } } int main() //@ requires module(Fibonacci03__verifast_instrumented, true); //@ ensures junk(); { //@ open_module(); int x = __VERIFIER_nondet_int(); if (x > 46) { return 0; } int result = fibonacci(x); if (x < 9 || result >= 34) { return 0; } else { ERROR: {reach_error();abort();} } return 0; }