fibo_2calls_2_false-unreach-call.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:15.0
disk size 757 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
extern int __VERIFIER_nondet_int();
extern void __VERIFIER_error();

int fibo1(int n);
int fibo2(int n);

int fibo1(int n) {
    if (n < 1) {
        return 0;
    } else if (n == 1) {
        return 1;
    } else {
        return fibo2(n-1) + fibo2(n-2);
    }
}

int fibo2(int n) {
    if (n < 1) {
        return 0;
    } else if (n == 1) {
        return 1;
    } else {
        return fibo1(n-1) + fibo1(n-2);
    }
}

// fibo 1-30
// 1, 1, 2, 3, 5,
// 8, 13, 21, 34, 55, 
// 89, 144, 233, 377, 610,
// 987, 1597, 2584, 4181, 6765,
// 10946, 17711, 28657, 46368, 75025,
// 121393, 196418, 317811, 514229, 832040

int main(void) {
    int x = 2;
    int result = fibo1(x);
    if (result == 1) {
        ERROR: __VERIFIER_error();
    }
    return 0;
}
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark