// verifast_options{disable_overflow_check target:ILP32} extern void abort(void);//@ requires true; //@ ensures true; extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); void reach_error() //@ requires false; //@ ensures true; { __assert_fail("0", "Fibonacci01-1.c", 3, "reach_error"); } /* * 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 ((((2 <= n) && (n <= (result + 1))) || ((n <= 0) && ((result == 1) || (result == 0)))) || ((result == 1) && (1 == n))); { if (n < 1) { return 0; } else if (n == 1) { return 1; } else { return fibonacci(n-1) + fibonacci(n-2); } } int main() //@ requires module(Fibonacci01_1__verifast_instrumented_modified, true); //@ ensures junk(); { int x = __VERIFIER_nondet_int(); if (x > 46 || x == -2147483648) { return 0; } int result = fibonacci(x); if (result >= x - 1) { return 0; } else { ERROR: {reach_error();abort();} } }