Dataset Viewer
Auto-converted to Parquet Duplicate
id
int64
2
219
file
stringlengths
9
30
original_program
stringlengths
388
8.62k
normalized_program
stringlengths
0
4.23k
baseline_decision
stringclasses
2 values
median_timing
float64
5.53
29.6
split
stringclasses
1 value
2
prodbin-ll_unwindbound1_2.c
/* shift_add algorithm for computing the product of two natural numbers This task is incorrect, here is an explanation why: - The first assertion z + x * y == (long long) a * b is a loop invariant, so it can never be violated. */ extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "prodbin-ll.c", 14, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int a, b; long long x, y, z; a = __VERIFIER_nondet_int(); b = __VERIFIER_nondet_int(); assume_abort_if_not(b >= 1); x = a; y = b; z = 0; while (counter++ < 1) { __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; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int a, b; long long x, y, z; a = __VERIFIER_nondet_int(); b = __VERIFIER_nondet_int(); assume(b >= 1); x = a; y = b; z = 0; while (counter++ < 1) { 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; } return 0; }
TRUE
7.158302
easy
4
condmf_1.c
/* * Benchmarks contributed by Divyesh Unadkat[1,2], Supratik Chakraborty[1], Ashutosh Gupta[1] * [1] Indian Institute of Technology Bombay, Mumbai * [2] TCS Innovation labs, Pune * */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "condmf.c", 10, "reach_error"); } extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } extern int __VERIFIER_nondet_int(void); void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume_abort_if_not(N <= 2147483647 / sizeof(int)); int i; int *a = malloc(sizeof(int) * N); for (i = 0; i < N; i++) { a[i] = 0; } for (i = 0; i < N; i++) { if (N % 2 == 1) { a[i] = a[i] + 2; } else { a[i] = a[i] + 1; } } for (i = 0; i < N; i++) { __VERIFIER_assert(a[i] % 2 == N % 2); } return 1; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume(N <= 2147483647 / sizeof(int)); int i; int *a = malloc(sizeof(int) * N); for (i = 0; i < N; i++) { a[i] = 0; } for (i = 0; i < N; i++) { if (N % 2 == 1) { a[i] = a[i] + 2; } else { a[i] = a[i] + 1; } } for (i = 0; i < N; i++) { assert(a[i] % 2 == N % 2); } return 1; }
FALSE
6.094589
easy
6
cohencu-ll_valuebound1_2.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 1); n = 0; x = 0; y = 1; z = 6; while (1) { __VERIFIER_assert(y == 3 * n * n + 3 * n + 1); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 1); n = 0; x = 0; y = 1; z = 6; while (1) { assert(y == 3 * n * n + 3 * n + 1); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
6.603491
easy
9
fermat2-ll_unwindbound20_1.c
/* program computing a divisor for factorisation, by Bressoud */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "fermat2-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int A, R; long long u, v, r; A = __VERIFIER_nondet_int(); R = __VERIFIER_nondet_int(); // assume_abort_if_not(A >= 1); assume_abort_if_not(((long long)R - 1) * ((long long)R - 1) < A); // assume_abort_if_not(A <= R * R); assume_abort_if_not(A % 2 == 1); u = ((long long)2 * R) + 1; v = 1; r = ((long long)R * R) - A; while (counter++ < 20) { __VERIFIER_assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r != 0)) { break; } if (r > 0) { r = r - v; v = v + 2; } else { r = r + u; u = u + 2; } } // return (u - v) / 2; return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int A, R; long long u, v, r; A = __VERIFIER_nondet_int(); R = __VERIFIER_nondet_int(); assume(((long long)R - 1) * ((long long)R - 1) < A); assume(A % 2 == 1); u = ((long long)2 * R) + 1; v = 1; r = ((long long)R * R) - A; while (counter++ < 20) { assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r != 0)) { break; } if (r > 0) { r = r - v; v = v + 2; } else { r = r + u; u = u + 2; } } return 0; }
TRUE
11.88339
easy
10
egcd-ll_valuebound20_6.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 20); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 20); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } __VERIFIER_assert(q * r - p * s + 1 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 20); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 20); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } assert(q * r - p * s + 1 == 0); return 0; }
TRUE
8.651028
easy
11
cohencu-ll_valuebound20_11.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 20); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(y * z - 18 * x - 12 * y + 2 * z - 6 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 20); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(y * z - 18 * x - 12 * y + 2 * z - 6 == 0); return 0; }
TRUE
7.495957
easy
12
ps5-ll_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps5-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y + x; } __VERIFIER_assert(k * y == y * y); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k <= 256); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y + x; } assert(k * y == y * y); return 0; }
TRUE
8.038956
easy
13
egcd3-ll_unwindbound50_4.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 50) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 50) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 50) { __VERIFIER_assert(v == b * d); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 50) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 50) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 50) { assert(v == b * d); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
7.900499
easy
15
mono-crafted_11_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "mono-crafted_11.c", 3, "reach_error"); } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } int main() { unsigned int x = 0; while (x < 100000000) { if (x < 10000000) { x++; } else { x += 2; } } __VERIFIER_assert((x % 2) == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { unsigned int x = 0; while (x < 100000000) { if (x < 10000000) { x++; } else { x += 2; } } assert((x % 2) == 0); return 0; }
TRUE
9.559742
easy
16
ps4-ll_valuebound5_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
TRUE
7.14367
easy
17
cohencu-ll_valuebound20_7.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 20); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(6 * a * x - x * z + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 20); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(6 * a * x - x * z + 12 * x == 0); return 0; }
TRUE
7.20885
easy
18
cohencu-ll_valuebound50_8.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 50); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 50); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
TRUE
14.948693
easy
20
egcd-ll_valuebound100_5.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 100); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 100); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { __VERIFIER_assert(((((1 <= y && x <= 100) && 1 <= x) && s * y + q * x + 2 * a == b + 2 * (p * x) + r * y * 2)&& r * y + p * x == a) && y <= 100); if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } __VERIFIER_assert(p * x + r * y - b == 0); return 0; }
TRUE
5.929698
easy
21
prod4br-ll_valuebound10_1.c
/* algorithm for computing the product of two natural numbers */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "prod4br-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 10); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 10); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { __VERIFIER_assert(q + a * b * p == (long long)x * y); if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; /*fix a bug here--- was (a+b-1)*/ } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 10); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 10); assume(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { assert(q + a * b * p == (long long)x * y); if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; } } return 0; }
TRUE
7.347085
easy
22
hard-ll_valuebound1_6.c
/* hardware integer division program, by Manna returns q==A//B */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "hard-ll.c", 8, "reach_error"); } extern unsigned int __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { unsigned int A, B; long long r, d, p, q; A = __VERIFIER_nondet_uint(); assume_abort_if_not(A >= 0 && A <= 1); B = __VERIFIER_nondet_uint(); assume_abort_if_not(B >= 0 && B <= 1); assume_abort_if_not(B >= 1); r = A; d = B; p = 1; q = 0; while (1) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } __VERIFIER_assert(A == d * q + r); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { unsigned int A, B; long long r, d, p, q; A = __VERIFIER_nondet_uint(); assume(A >= 0 && A <= 1); B = __VERIFIER_nondet_uint(); assume(B >= 0 && B <= 1); assume(B >= 1); r = A; d = B; p = 1; q = 0; while (1) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } assert(A == d * q + r); return 0; }
TRUE
10.938657
easy
23
benchmark24_conjunctive_1.c
#include <assert.h> void reach_error(void) { assert(0); } extern int __VERIFIER_nondet_int(void); extern _Bool __VERIFIER_nondet_bool(void); void __VERIFIER_assert(int cond) { if (!cond) { reach_error(); } } /* 24.cfg: names=i k n beforeloop= beforeloopinit= precondition=i==0 && k==n && n>=0 loopcondition=i<n loop=k--; i+=2; postcondition=2*k>=n-1 afterloop= learners= conj */ int main() { int i = __VERIFIER_nondet_int(); int k = __VERIFIER_nondet_int(); int n = __VERIFIER_nondet_int(); if (!(i == 0 && k == n && n >= 0)) { return 0; } while (i < n) { k--; i += 2; } __VERIFIER_assert(2 * k >= n - 1); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int i = __VERIFIER_nondet_int(); int k = __VERIFIER_nondet_int(); int n = __VERIFIER_nondet_int(); if (!(i == 0 && k == n && n >= 0)) { return 0; } while (i < n) { k--; i += 2; } assert(2 * k >= n - 1); return 0; }
TRUE
7.514136
easy
25
cohencu-ll_valuebound2_5.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 2); n = 0; x = 0; y = 1; z = 6; while (1) { __VERIFIER_assert((z * z) - 12 * y - 6 * z + 12 == 0); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 2); n = 0; x = 0; y = 1; z = 6; while (1) { assert((z * z) - 12 * y - 6 * z + 12 == 0); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
6.318962
easy
26
cohencu-ll_unwindbound20_7.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 20) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(6 * a * x - x * z + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 20) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(6 * a * x - x * z + 12 * x == 0); return 0; }
FALSE
8.920112
easy
27
lcm1_unwindbound2_5.c
/* * algorithm for computing simultaneously the GCD and the LCM, * by Sankaranarayanan */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "lcm1.c", 8, "reach_error"); } extern unsigned __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { unsigned a, b; unsigned x, y, u, v; a = __VERIFIER_nondet_uint(); b = __VERIFIER_nondet_uint(); assume_abort_if_not(a >= 1); // infinite loop if remove assume_abort_if_not(b >= 1); assume_abort_if_not(a <= 65535); assume_abort_if_not(b <= 65535); x = a; y = b; u = b; v = 0; while (counter++ < 2) { if (!(x != y)) { break; } while (counter++ < 2) { if (!(x > y)) { break; } x = x - y; v = v + u; } while (counter++ < 2) { if (!(x < y)) { break; } y = y - x; u = u + v; } } __VERIFIER_assert(x == y); // x == gcd(a,b) // u + v == lcm(a,b) return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { unsigned a, b; unsigned x, y, u, v; a = __VERIFIER_nondet_uint(); b = __VERIFIER_nondet_uint(); assume(a >= 1); assume(b >= 1); assume(a <= 65535); assume(b <= 65535); x = a; y = b; u = b; v = 0; while (counter++ < 2) { if (!(x != y)) { break; } while (counter++ < 2) { if (!(x > y)) { break; } x = x - y; v = v + u; } while (counter++ < 2) { if (!(x < y)) { break; } y = y - x; u = u + v; } } assert(x == y); return 0; }
FALSE
5.995583
easy
28
ps4-ll_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(k * y - (y * y) == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(k * y - (y * y) == 0); return 0; }
TRUE
6.793911
easy
31
cohencu-ll_unwindbound5_2.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 5) { __VERIFIER_assert(y == 3 * n * n + 3 * n + 1); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 5) { assert(y == 3 * n * n + 3 * n + 1); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
6.323649
easy
32
bh2017-ex-add_2.c
// Source: Rémy Boutonnet, Nicolas Halbwachs: "Improving the results of program analysis by abstract interpretation beyond the decreasing sequence", FMSD 2017. // Example "additional". #include <assert.h> extern void abort(void); void reach_error() { assert(0); } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } extern _Bool __VERIFIER_nondet_bool(); int main() { int m = 0; int n = 0; while (1) { __VERIFIER_assert(n <= 60); if (__VERIFIER_nondet_bool()) { if (__VERIFIER_nondet_bool()) { if (m < 60) { m++; } else { m = 0; } } } if (__VERIFIER_nondet_bool()) { if (__VERIFIER_nondet_bool()) { if (n < 60) { n++; } else { n = 0; } } } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int m = 0; int n = 0; while (1) { assert(n <= 60); if (__VERIFIER_nondet_bool()) { if (__VERIFIER_nondet_bool()) { if (m < 60) { m++; } else { m = 0; } } } if (__VERIFIER_nondet_bool()) { if (__VERIFIER_nondet_bool()) { if (n < 60) { n++; } else { n = 0; } } } } return 0; }
TRUE
5.714815
easy
33
egcd-ll_unwindbound10_3.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { __VERIFIER_assert(b == x * q + y * s); if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { assert(b == x * q + y * s); if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } return 0; }
TRUE
6.995007
easy
34
geo1-ll_valuebound2_1.c
/* Geometric Series computes x=(z-1)* sum(z^k)[k=0..k-1] , y = z^k returns 1+x-y == 0 */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "geo1-ll.c", 9, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); assume_abort_if_not(z >= 0 && z <= 2); k = __VERIFIER_nondet_int(); assume_abort_if_not(k >= 0 && k <= 2); assume_abort_if_not(z >= 1); assume_abort_if_not(k >= 1); x = 1; y = z; c = 1; while (1) { __VERIFIER_assert(x * z - x - y + 1 == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } // geo1 x = x * (z - 1); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); assume(z >= 0 && z <= 2); k = __VERIFIER_nondet_int(); assume(k >= 0 && k <= 2); assume(z >= 1); assume(k >= 1); x = 1; y = z; c = 1; while (1) { assert(x * z - x - y + 1 == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } x = x * (z - 1); return 0; }
TRUE
6.488659
easy
35
cohencu_1.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { __VERIFIER_assert(z == 6 * n + 6); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { assert(z == 6 * n + 6); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
5.525088
easy
36
egcd-ll_unwindbound50_3.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 50) { __VERIFIER_assert(b == x * q + y * s); if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 50) { assert(b == x * q + y * s); if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } return 0; }
TRUE
6.7482
easy
39
egcd-ll_unwindbound10_5.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } __VERIFIER_assert(p * x + r * y - b == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } assert(p * x + r * y - b == 0); return 0; }
FALSE
28.141715
easy
40
divbin2_valuebound1_2.c
/* A division algorithm, by Kaldewaij returns A//B */ #include <limits.h> extern void abort(void); #include <assert.h> void reach_error() { assert(0); } extern unsigned __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { unsigned A, B; unsigned q, r, b; A = __VERIFIER_nondet_uint(); assume_abort_if_not(A >= 0 && A <= 1); B = 1; q = 0; r = A; b = B; while (1) { if (!(r >= b)) { break; } b = 2 * b; } while (1) { if (!(b != B)) { break; } q = 2 * q; b = b / 2; if (r >= b) { q = q + 1; r = r - b; } } __VERIFIER_assert(A == q * b + r); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { unsigned A, B; unsigned q, r, b; A = __VERIFIER_nondet_uint(); assume(A >= 0 && A <= 1); B = 1; q = 0; r = A; b = B; while (1) { if (!(r >= b)) { break; } b = 2 * b; } while (1) { if (!(b != B)) { break; } q = 2 * q; b = b / 2; if (r >= b) { q = q + 1; r = r - b; } } assert(A == q * b + r); return 0; }
TRUE
10.971793
easy
42
cohencu-ll_valuebound10_10.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 10); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(z * z - 12 * y - 6 * z + 12 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 10); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(z * z - 12 * y - 6 * z + 12 == 0); return 0; }
TRUE
8.636287
easy
43
egcd-ll_unwindbound5_5.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 5) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } __VERIFIER_assert(p * x + r * y - b == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { long long a, b, p, q, r, s; int x, y; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 5) { if (!(a != b)) { break; } if (a > b) { a = a - b; p = p - q; r = r - s; } else { b = b - a; q = q - p; s = s - r; } } assert(p * x + r * y - b == 0); return 0; }
FALSE
17.674721
easy
44
cohencu-ll_valuebound100_8.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 100); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 100); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
TRUE
16.596338
easy
45
dll-rb-cnstr_1-2_4.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } typedef enum { RED, BLACK } Colour; typedef struct TSLL { struct TSLL *next; struct TSLL *prev; Colour colour; } SLL; int main() { // create the head SLL *list = malloc(sizeof(SLL)); list->next = NULL; list->prev = NULL; list->colour = BLACK; SLL *end = list; // create an arbitrarily long tail while (__VERIFIER_nondet_int()) { // create a node end->next = malloc(sizeof(SLL)); end->next->prev = end; end = end->next; end->next = NULL; if (__VERIFIER_nondet_int()) { // mark the node as black end->colour = BLACK; } else { // mark the node as red and follow it by a black node end->colour = RED; end->next = malloc(sizeof(SLL)); end->next->prev = end; end = end->next; end->next = NULL; end->colour = BLACK; } } end = NULL; end = list; // check the invariant while (NULL != end) { if (RED == end->colour) { end = end->next; end = end->next; } __VERIFIER_assert(end->next); end = end->next; } // destroy the list while (NULL != list) { if (RED == list->colour) { // we can remove two nodes at once end = list->next; free(list); list = end->next; free(end); } else { // we can remove only one node end = list->next; free(list); list = end; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef enum { RED, BLACK } Colour; typedef struct TSLL { struct TSLL *next; struct TSLL *prev; Colour colour; } SLL; int main() { SLL *list = malloc(sizeof(SLL)); list->next = NULL; list->prev = NULL; list->colour = BLACK; SLL *end = list; while (__VERIFIER_nondet_int()) { end->next = malloc(sizeof(SLL)); end->next->prev = end; end = end->next; end->next = NULL; if (__VERIFIER_nondet_int()) { end->colour = BLACK; } else { end->colour = RED; end->next = malloc(sizeof(SLL)); end->next->prev = end; end = end->next; end->next = NULL; end->colour = BLACK; } } end = NULL; end = list; while (NULL != end) { if (RED == end->colour) { end = end->next; end = end->next; } assert(end->next); end = end->next; } while (NULL != list) { if (RED == list->colour) { end = list->next; free(list); list = end->next; free(end); } else { end = list->next; free(list); list = end; } } return 0; }
FALSE
8.813345
easy
46
ps4-ll_valuebound5_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } return 0; }
TRUE
8.592629
easy
47
sqrt1_2.c
/* Compute the floor of the square root of a natural number */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "sqrt1.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int n, a, s, t; n = __VERIFIER_nondet_int(); a = 0; s = 1; t = 1; while (1) { __VERIFIER_assert(s == (a + 1) * (a + 1)); // the above 2 should be equiv to if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int n, a, s, t; n = __VERIFIER_nondet_int(); a = 0; s = 1; t = 1; while (1) { assert(s == (a + 1) * (a + 1)); if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } return 0; }
TRUE
8.730134
easy
49
modnf_1.c
/* * Benchmarks contributed by Divyesh Unadkat[1,2], Supratik Chakraborty[1], Ashutosh Gupta[1] * [1] Indian Institute of Technology Bombay, Mumbai * [2] TCS Innovation labs, Pune * */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "modnf.c", 10, "reach_error"); } extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } extern int __VERIFIER_nondet_int(void); void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume_abort_if_not(N <= 2147483647 / sizeof(int)); int i; int sum[1]; int *a = malloc(sizeof(int) * N); sum[0] = 0; for (i = 0; i < N; i++) { sum[0] = sum[0] + 1; } for (i = 0; i < N; i++) { a[i] = sum[0] % N; } for (i = 0; i < N; i++) { __VERIFIER_assert(a[i] == 1); } return 1; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume(N <= 2147483647 / sizeof(int)); int i; int sum[1]; int *a = malloc(sizeof(int) * N); sum[0] = 0; for (i = 0; i < N; i++) { sum[0] = sum[0] + 1; } for (i = 0; i < N; i++) { a[i] = sum[0] % N; } for (i = 0; i < N; i++) { assert(a[i] == 1); } return 1; }
FALSE
8.301404
easy
50
cohencu-ll_unwindbound2_8.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 2) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 2) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
FALSE
9.324964
easy
52
sll-buckets-2_3.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } typedef struct TSLL { struct TSLL *next; int data; } SLL; typedef struct TBCK { struct TBCK *next; SLL *list; int data; } BCK; int main() { // create the head BCK *bucket = malloc(sizeof(BCK)); bucket->data = 0; bucket->list = NULL; bucket->next = malloc(sizeof(BCK)); BCK *bcki = bucket->next; bcki->data = 1; bcki->list = NULL; bcki->next = malloc(sizeof(BCK)); bcki = bcki->next; bcki->data = 2; bcki->list = NULL; bcki->next = NULL; struct TSLL *item = NULL; struct TSLL *itr = NULL; while (__VERIFIER_nondet_int()) { item = malloc(sizeof(SLL)); item->next = NULL; if (__VERIFIER_nondet_int()) { item->data = 0; } else if (__VERIFIER_nondet_int()) { item->data = 1; } else { item->data = 2; } bcki = bucket; __VERIFIER_assert(item != NULL); while (bcki->data != item->data) { bcki = bcki->next; } if (bcki->list == NULL) { bcki->list = item; } else { itr = bcki->list; while (itr->next != NULL) { itr = itr->next; } itr->next = item; } } bcki = bucket; while (bcki != NULL) { item = bcki->list; bcki->list = NULL; while (item != NULL) { itr = item; item = item->next; free(itr); } bucket = bcki; bcki = bcki->next; free(bucket); bucket = NULL; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef struct TSLL { struct TSLL *next; int data; } SLL; typedef struct TBCK { struct TBCK *next; SLL *list; int data; } BCK; int main() { BCK *bucket = malloc(sizeof(BCK)); bucket->data = 0; bucket->list = NULL; bucket->next = malloc(sizeof(BCK)); BCK *bcki = bucket->next; bcki->data = 1; bcki->list = NULL; bcki->next = malloc(sizeof(BCK)); bcki = bcki->next; bcki->data = 2; bcki->list = NULL; bcki->next = NULL; struct TSLL *item = NULL; struct TSLL *itr = NULL; while (__VERIFIER_nondet_int()) { item = malloc(sizeof(SLL)); item->next = NULL; if (__VERIFIER_nondet_int()) { item->data = 0; } else if (__VERIFIER_nondet_int()) { item->data = 1; } else { item->data = 2; } bcki = bucket; assert(item != NULL); while (bcki->data != item->data) { bcki = bcki->next; } if (bcki->list == NULL) { bcki->list = item; } else { itr = bcki->list; while (itr->next != NULL) { itr = itr->next; } itr->next = item; } } bcki = bucket; while (bcki != NULL) { item = bcki->list; bcki->list = NULL; while (item != NULL) { itr = item; item = item->next; free(itr); } bucket = bcki; bcki = bcki->next; free(bucket); bucket = NULL; } return 0; }
TRUE
8.603912
easy
54
sqrt1-ll_valuebound50_5.c
/* Compute the floor of the square root of a natural number */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "sqrt1-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); assume_abort_if_not(n >= 0 && n <= 50); a = 0; s = 1; t = 1; while (1) { // the above 2 should be equiv to if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } __VERIFIER_assert(s == (a + 1) * (a + 1)); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); assume(n >= 0 && n <= 50); a = 0; s = 1; t = 1; while (1) { if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } assert(s == (a + 1) * (a + 1)); return 0; }
TRUE
8.191747
easy
56
cohendiv-ll_unwindbound10_5.c
/* Cohen's integer division returns x % y http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohendiv.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohendiv-ll.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long q, r, a, b; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 1); q = 0; r = x; a = 0; b = 0; while (counter++ < 10) { if (!(r >= y)) { break; } a = 1; b = y; while (counter++ < 10) { __VERIFIER_assert(r >= 0); if (!(r >= 2 * b)) { break; } a = 2 * a; b = 2 * b; } r = r - b; q = q + a; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long q, r, a, b; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(y >= 1); q = 0; r = x; a = 0; b = 0; while (counter++ < 10) { if (!(r >= y)) { break; } a = 1; b = y; while (counter++ < 10) { assert(r >= 0); if (!(r >= 2 * b)) { break; } a = 2 * a; b = 2 * b; } r = r - b; q = q + a; } return 0; }
TRUE
8.15483
easy
57
ps4-ll_valuebound20_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 20); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(k * y - (y * y) == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 20); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(k * y - (y * y) == 0); return 0; }
TRUE
9.826356
easy
58
egcd3-ll_valuebound1_5.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 1); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } __VERIFIER_assert(p * x - q * x + r * y - s * y == a); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 1); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } assert(p * x - q * x + r * y - s * y == a); return 0; }
TRUE
20.010889
easy
59
egcd3-ll_unwindbound10_1.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 10) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 10) { __VERIFIER_assert(a == y * r + x * p); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 10) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 10) { assert(a == y * r + x * p); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
28.416481
easy
60
ps2-ll_valuebound10_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps2-ll.c", 3, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int k; long long y, x, c; k = __VERIFIER_nondet_int(); assume_abort_if_not(k >= 0 && k <= 10); y = 0; x = 0; c = 0; while (1) { __VERIFIER_assert((y * y) - 2 * x + y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y + x; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int k; long long y, x, c; k = __VERIFIER_nondet_int(); assume(k >= 0 && k <= 10); y = 0; x = 0; c = 0; while (1) { assert((y * y) - 2 * x + y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y + x; } return 0; }
TRUE
8.701909
easy
62
functions_1-1_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "functions_1-1.c", 3, "reach_error"); } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } return; } unsigned int f(unsigned int z) { return z + 2; } int main(void) { unsigned int x = 0; while (x < 0x0fffffff) { x = f(x); } __VERIFIER_assert(!(x % 2)); }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } unsigned int f(unsigned int z) { return z + 2; } int main(void) { unsigned int x = 0; while (x < 0x0fffffff) { x = f(x); } assert(!(x % 2)); }
TRUE
9.249355
easy
64
cohencu_10.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(z * z - 12 * y - 6 * z + 12 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(z * z - 12 * y - 6 * z + 12 == 0); return 0; }
TRUE
9.205766
easy
65
cohencu-ll_unwindbound5_9.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 5) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(2 * y * y - 3 * x * z - 18 * x - 10 * y + 3 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 5) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(2 * y * y - 3 * x * z - 18 * x - 10 * y + 3 * z - 10 == 0); return 0; }
TRUE
26.882769
easy
66
egcd3-ll_unwindbound5_4.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 5) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 5) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 5) { __VERIFIER_assert(v == b * d); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 5) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 5) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 5) { assert(v == b * d); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
10.028069
easy
67
ps4-ll_valuebound1_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 1); y = 0; x = 0; c = 0; while (1) { __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 1); y = 0; x = 0; c = 0; while (1) { assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } return 0; }
TRUE
9.468882
easy
68
benchmark46_disjunctive_1.c
#include <assert.h> void reach_error(void) { assert(0); } extern int __VERIFIER_nondet_int(void); extern _Bool __VERIFIER_nondet_bool(void); void __VERIFIER_assert(int cond) { if (!cond) { reach_error(); } } /* 46.cfg: names= x y z precondition= y>0 || x>0 || z>0 loopcondition= #loop=if (x>0) x++; else x--; x=-1 * x; branchcondition=x>0 branch=x++; branchcondition=y>0 branch=y++; branchcondition= branch=z++; postcondition=x>0 || y>0 || z>0 learners=linear disjunctive */ int main() { int x = __VERIFIER_nondet_int(); int y = __VERIFIER_nondet_int(); int z = __VERIFIER_nondet_int(); if (!(y > 0 || x > 0 || z > 0)) { return 0; } while (__VERIFIER_nondet_bool()) { if (x > 0) { x++; } if (y > 0) { y++; } else { z++; } } __VERIFIER_assert(x > 0 || y > 0 || z > 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x = __VERIFIER_nondet_int(); int y = __VERIFIER_nondet_int(); int z = __VERIFIER_nondet_int(); if (!(y > 0 || x > 0 || z > 0)) { return 0; } while (__VERIFIER_nondet_bool()) { if (x > 0) { x++; } if (y > 0) { y++; } else { z++; } } assert(x > 0 || y > 0 || z > 0); return 0; }
TRUE
8.320772
easy
69
egcd2-ll_unwindbound5_2.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd2-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume_abort_if_not(xy < 2147483647); assume_abort_if_not(yy < 2147483647); while (counter++ < 5) { if (!(b != 0)) { break; } c = a; k = 0; while (counter++ < 5) { __VERIFIER_assert(a == y * r + x * p); if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return a; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume(xy < 2147483647); assume(yy < 2147483647); while (counter++ < 5) { if (!(b != 0)) { break; } c = a; k = 0; while (counter++ < 5) { assert(a == y * r + x * p); if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return a; }
TRUE
15.291736
easy
71
cohendiv-ll_unwindbound5_4.c
/* Cohen's integer division returns x % y http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohendiv.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohendiv-ll.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long q, r, a, b; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 1); q = 0; r = x; a = 0; b = 0; while (counter++ < 5) { if (!(r >= y)) { break; } a = 1; b = y; while (counter++ < 5) { __VERIFIER_assert(x == q * y + r); if (!(r >= 2 * b)) { break; } a = 2 * a; b = 2 * b; } r = r - b; q = q + a; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long q, r, a, b; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(y >= 1); q = 0; r = x; a = 0; b = 0; while (counter++ < 5) { if (!(r >= y)) { break; } a = 1; b = y; while (counter++ < 5) { assert(x == q * y + r); if (!(r >= 2 * b)) { break; } a = 2 * a; b = 2 * b; } r = r - b; q = q + a; } return 0; }
TRUE
15.892489
easy
72
sqrt1-ll_valuebound50_4.c
/* Compute the floor of the square root of a natural number */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "sqrt1-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); assume_abort_if_not(n >= 0 && n <= 50); a = 0; s = 1; t = 1; while (1) { // the above 2 should be equiv to if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } __VERIFIER_assert(t == 2 * a + 1); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); assume(n >= 0 && n <= 50); a = 0; s = 1; t = 1; while (1) { if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } assert(t == 2 * a + 1); return 0; }
TRUE
9.062395
easy
73
geo3-ll_valuebound2_1.c
/* Geometric Series computes x = sum(z^k)[k=0..k-1], y = z^(k-1) */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "geo3-ll.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int z, a, k; long long x, y, c, az; z = __VERIFIER_nondet_int(); assume_abort_if_not(z >= 0 && z <= 2); a = __VERIFIER_nondet_int(); assume_abort_if_not(a >= 0 && a <= 2); k = __VERIFIER_nondet_int(); assume_abort_if_not(k >= 0 && k <= 2); x = a; y = 1; c = 1; az = (long long)a * z; while (1) { __VERIFIER_assert(z * x - x + a - az * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + a; y = y * z; } return x; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int z, a, k; long long x, y, c, az; z = __VERIFIER_nondet_int(); assume(z >= 0 && z <= 2); a = __VERIFIER_nondet_int(); assume(a >= 0 && a <= 2); k = __VERIFIER_nondet_int(); assume(k >= 0 && k <= 2); x = a; y = 1; c = 1; az = (long long)a * z; while (1) { assert(z * x - x + a - az * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + a; y = y * z; } return x; }
TRUE
11.296797
easy
74
egcd2-ll_valuebound1_5.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd2-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 1); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume_abort_if_not(xy < 2147483647); assume_abort_if_not(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } __VERIFIER_assert(q * x + s * y == 0); return a; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 1); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume(xy < 2147483647); assume(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } assert(q * x + s * y == 0); return a; }
TRUE
19.303467
easy
76
ps4-ll_valuebound5_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(k * y - (y * y) == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 5); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(k * y - (y * y) == 0); return 0; }
TRUE
11.212627
easy
77
ps5-ll_unwindbound1_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps5-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (counter++ < 1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y + x; } __VERIFIER_assert(k * y == y * y); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k <= 256); y = 0; x = 0; c = 0; while (counter++ < 1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y + x; } assert(k * y == y * y); return 0; }
FALSE
14.820796
easy
80
sqrt1-ll_unwindbound50_5.c
/* Compute the floor of the square root of a natural number */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "sqrt1-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); a = 0; s = 1; t = 1; while (counter++ < 50) { // the above 2 should be equiv to if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } __VERIFIER_assert(s == (a + 1) * (a + 1)); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int n; long long a, s, t; n = __VERIFIER_nondet_int(); a = 0; s = 1; t = 1; while (counter++ < 50) { if (!(s <= n)) { break; } a = a + 1; t = t + 2; s = s + t; } assert(s == (a + 1) * (a + 1)); return 0; }
TRUE
9.41492
easy
81
ps4-ll_unwindbound20_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 20) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 20) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
TRUE
9.656724
easy
82
cohencu-ll_valuebound5_7.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(6 * a * x - x * z + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(6 * a * x - x * z + 12 * x == 0); return 0; }
TRUE
9.067731
easy
84
cohencu_7.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(6 * a * x - x * z + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int a, n, x, y, z; a = __VERIFIER_nondet_int(); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(6 * a * x - x * z + 12 * x == 0); return 0; }
TRUE
18.995898
easy
85
geo1-u2_unwindbound100_1.c
/* Geometric Series computes x=(z-1)* sum(z^k)[k=0..k-1] , y = z^k returns 1+x-y == 0 */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "geo1-u.c", 9, "reach_error"); } extern unsigned int __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { unsigned int z, k; long long x, y, c; z = __VERIFIER_nondet_uint(); k = __VERIFIER_nondet_uint(); x = 1; y = z; c = 1; while (counter++ < 100) { __VERIFIER_assert(x * z - x - y + 1 == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } // geo1 x = x * (z - 1); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { unsigned int z, k; long long x, y, c; z = __VERIFIER_nondet_uint(); k = __VERIFIER_nondet_uint(); x = 1; y = z; c = 1; while (counter++ < 100) { assert(x * z - x - y + 1 == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } x = x * (z - 1); return 0; }
TRUE
18.901654
easy
86
ps4-ll_unwindbound10_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 10) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 10) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
TRUE
19.198429
easy
88
egcd3-ll_valuebound50_3.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 50); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 50); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { __VERIFIER_assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 50); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 50); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
20.930458
easy
89
ps6-ll_unwindbound10_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps6-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (counter++ < 10) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y * y + x; } __VERIFIER_assert(-2 * y * y * y * y * y * y - 6 * y * y * y * y * y - 5 * y * y * y * y + y * y + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k <= 256); y = 0; x = 0; c = 0; while (counter++ < 10) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(-2 * y * y * y * y * y * y - 6 * y * y * y * y * y - 5 * y * y * y * y + y * y + 12 * x == 0); return 0; }
TRUE
19.221911
easy
91
egcd2-ll_valuebound2_1.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd2-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 2); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 2); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume_abort_if_not(xy < 2147483647); assume_abort_if_not(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { __VERIFIER_assert(a == k * b + c); if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return a; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 2); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 2); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume(xy < 2147483647); assume(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { assert(a == k * b + c); if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return a; }
TRUE
18.969865
easy
92
fermat1_3.c
/* program computing a divisor for factorisation, by Knuth 4.5.4 Alg C ? */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "fermat1.c", 5, "reach_error"); } extern double __VERIFIER_nondet_double(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int A, R; int u, v, r; A = __VERIFIER_nondet_double(); R = __VERIFIER_nondet_double(); assume_abort_if_not((R - 1) * (R - 1) < A); // assume_abort_if_not(A <= R * R); assume_abort_if_not(A % 2 == 1); u = 2 * R + 1; v = 1; r = R * R - A; while (1) { if (!(r != 0)) { break; } while (1) { if (!(r > 0)) { break; } r = r - v; v = v + 2; } while (1) { __VERIFIER_assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r < 0)) { break; } r = r + u; u = u + 2; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int A, R; int u, v, r; A = __VERIFIER_nondet_double(); R = __VERIFIER_nondet_double(); assume((R - 1) * (R - 1) < A); assume(A % 2 == 1); u = 2 * R + 1; v = 1; r = R * R - A; while (1) { if (!(r != 0)) { break; } while (1) { if (!(r > 0)) { break; } r = r - v; v = v + 2; } while (1) { assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r < 0)) { break; } r = r + u; u = u + 2; } } return 0; }
TRUE
28.853645
easy
93
prod4br-ll_unwindbound1_1.c
/* algorithm for computing the product of two natural numbers */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "prod4br-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; while (counter++ < 1) { __VERIFIER_assert(q + a * b * p == (long long)x * y); if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; /*fix a bug here--- was (a+b-1)*/ } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(y >= 1); a = x; b = y; p = 1; q = 0; while (counter++ < 1) { assert(q + a * b * p == (long long)x * y); if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; } } return 0; }
TRUE
19.292911
easy
95
mannadiv_unwindbound100_1.c
/* Division algorithm from "Z. Manna, Mathematical Theory of Computation, McGraw-Hill, 1974" return x1 // x2 */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "mannadiv.c", 9, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x1, x2; int y1, y2, y3; x1 = __VERIFIER_nondet_int(); x2 = __VERIFIER_nondet_int(); assume_abort_if_not(x1 >= 0); assume_abort_if_not(x2 != 0); y1 = 0; y2 = 0; y3 = x1; while (counter++ < 100) { __VERIFIER_assert(y1 * x2 + y2 + y3 == x1); if (!(y3 != 0)) { break; } if (y2 + 1 == x2) { y1 = y1 + 1; y2 = 0; y3 = y3 - 1; } else { y2 = y2 + 1; y3 = y3 - 1; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x1, x2; int y1, y2, y3; x1 = __VERIFIER_nondet_int(); x2 = __VERIFIER_nondet_int(); assume(x1 >= 0); assume(x2 != 0); y1 = 0; y2 = 0; y3 = x1; while (counter++ < 100) { assert(y1 * x2 + y2 + y3 == x1); if (!(y3 != 0)) { break; } if (y2 + 1 == x2) { y1 = y1 + 1; y2 = 0; y3 = y3 - 1; } else { y2 = y2 + 1; y3 = y3 - 1; } } return 0; }
TRUE
21.493673
easy
99
cohencu-ll_unwindbound20_3.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 20) { __VERIFIER_assert(x == n * n * n); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); n = 0; x = 0; y = 1; z = 6; while (counter++ < 20) { assert(x == n * n * n); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
19.279843
easy
105
ps2-ll_unwindbound1_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps2-ll.c", 3, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int k; long long y, x, c; k = __VERIFIER_nondet_int(); y = 0; x = 0; c = 0; while (counter++ < 1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y + x; } __VERIFIER_assert((y * y) - 2 * x + y == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int k; long long y, x, c; k = __VERIFIER_nondet_int(); y = 0; x = 0; c = 0; while (counter++ < 1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y + x; } assert((y * y) - 2 * x + y == 0); return 0; }
TRUE
14.707405
easy
106
trex01-1_1.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "trex01-1.c", 3, "reach_error"); } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } return; } _Bool __VERIFIER_nondet_bool(); int __VERIFIER_nondet_int(); void f(int d) { int x = __VERIFIER_nondet_int(), y = __VERIFIER_nondet_int(), k = __VERIFIER_nondet_int(), z = 1; if (!(k <= 1073741823)) { return; } L1: while (z < k) { z = 2 * z; } __VERIFIER_assert(z >= 2); L2: while (x > 0 && y > 0) { _Bool c = __VERIFIER_nondet_bool(); if (c) { P1: x = x - d; y = __VERIFIER_nondet_bool(); z = z - 1; } else { y = y - d; } } } int main() { _Bool c = __VERIFIER_nondet_bool(); if (c) { f(1); } else { f(2); } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } _Bool __VERIFIER_nondet_bool(); int __VERIFIER_nondet_int(); void f(int d) { int x = __VERIFIER_nondet_int(), y = __VERIFIER_nondet_int(), k = __VERIFIER_nondet_int(), z = 1; if (!(k <= 1073741823)) { return; } L1: while (z < k) { z = 2 * z; } assert(z >= 2); L2: while (x > 0 && y > 0) { _Bool c = __VERIFIER_nondet_bool(); if (c) { P1: x = x - d; y = __VERIFIER_nondet_bool(); z = z - 1; } else { y = y - d; } } } int main() { _Bool c = __VERIFIER_nondet_bool(); if (c) { f(1); } else { f(2); } return 0; }
FALSE
13.740664
easy
107
egcd3-ll_valuebound1_3.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 1); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { __VERIFIER_assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 1); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (1) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (1) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (1) { assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
19.634074
easy
108
egcd2-ll_valuebound1_6.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd2-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 1); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume_abort_if_not(xy < 2147483647); assume_abort_if_not(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } __VERIFIER_assert(p * x + r * y == a); return a; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 1); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume(xy < 2147483647); assume(yy < 2147483647); while (1) { if (!(b != 0)) { break; } c = a; k = 0; while (1) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } assert(p * x + r * y == a); return a; }
TRUE
23.117975
easy
111
prod4br-ll_valuebound1_3.c
/* algorithm for computing the product of two natural numbers */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "prod4br-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; /*fix a bug here--- was (a+b-1)*/ } } __VERIFIER_assert(a * b == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 1); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; } } assert(a * b == 0); return 0; }
TRUE
13.923135
easy
114
pcompf_1.c
/* * Benchmarks contributed by Divyesh Unadkat[1,2], Supratik Chakraborty[1], * Ashutosh Gupta[1] [1] Indian Institute of Technology Bombay, Mumbai [2] TCS * Innovation labs, Pune * */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "pcompf.c", 10, "reach_error"); } extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } extern int __VERIFIER_nondet_int(void); void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume_abort_if_not(N <= 2147483647 / sizeof(int)); int i; long long *a = malloc(sizeof(long long) * N); long long *b = malloc(sizeof(long long) * N); long long *c = malloc(sizeof(long long) * N); a[0] = 6; b[0] = 1; c[0] = 0; for (i = 1; i < N; i++) { a[i] = a[i - 1] + 6; } for (i = 1; i < N; i++) { b[i] = b[i - 1] + a[i - 1]; } for (i = 1; i < N; i++) { c[i] = c[i - 1] + b[i - 1]; } for (i = 0; i < N; i++) { __VERIFIER_assert(c[i] == i * i); } return 1; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume(N <= 2147483647 / sizeof(int)); int i; long long *a = malloc(sizeof(long long) * N); long long *b = malloc(sizeof(long long) * N); long long *c = malloc(sizeof(long long) * N); a[0] = 6; b[0] = 1; c[0] = 0; for (i = 1; i < N; i++) { a[i] = a[i - 1] + 6; } for (i = 1; i < N; i++) { b[i] = b[i - 1] + a[i - 1]; } for (i = 1; i < N; i++) { c[i] = c[i - 1] + b[i - 1]; } for (i = 0; i < N; i++) { assert(c[i] == i * i); } return 1; }
FALSE
20.368077
easy
115
cohencu-ll_valuebound5_8.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(a * z - 6 * a - 2 * y + 2 * z - 10 == 0); return 0; }
TRUE
18.025293
easy
116
hard-ll_valuebound2_4.c
/* hardware integer division program, by Manna returns q==A//B */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "hard-ll.c", 8, "reach_error"); } extern unsigned int __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { unsigned int A, B; long long r, d, p, q; A = __VERIFIER_nondet_uint(); assume_abort_if_not(A >= 0 && A <= 2); B = __VERIFIER_nondet_uint(); assume_abort_if_not(B >= 0 && B <= 2); assume_abort_if_not(B >= 1); r = A; d = B; p = 1; q = 0; while (1) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { __VERIFIER_assert(A == q * B + r); if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { unsigned int A, B; long long r, d, p, q; A = __VERIFIER_nondet_uint(); assume(A >= 0 && A <= 2); B = __VERIFIER_nondet_uint(); assume(B >= 0 && B <= 2); assume(B >= 1); r = A; d = B; p = 1; q = 0; while (1) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { assert(A == q * B + r); if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
TRUE
27.542672
easy
117
hard2_unwindbound1_1.c
/* hardware integer division program, by Manna returns q==A//B */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "hard2.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); B = 1; r = A; d = B; p = 1; q = 0; while (counter++ < 1) { __VERIFIER_assert(q == 0); if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (counter++ < 1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); B = 1; r = A; d = B; p = 1; q = 0; while (counter++ < 1) { assert(q == 0); if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (counter++ < 1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
TRUE
12.977526
easy
121
dll-queue-1_4.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } typedef struct TSLL { struct TSLL *next; struct TSLL *prev; int data; } SLL; int main() { // create the head SLL *head = malloc(sizeof(SLL)); head->next = NULL; head->prev = NULL; head->data = 0; SLL *item = head; int status = 0; while (__VERIFIER_nondet_int()) { item->next = malloc(sizeof(SLL)); item->next->prev = item; item = item->next; item->next = NULL; if (!status) { item->data = 1; status = 1; } else if (status == 1) { item->data = 2; status = 2; } else if (status >= 2) { item->data = 3; status = 3; } } __VERIFIER_assert(head != NULL); if (status == 1) { } if (status == 2) { } if (status == 3) { } item = head->next; while (item && __VERIFIER_nondet_int()) { item = item->next; } while (head) { item = head; head = head->next; free(item); } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef struct TSLL { struct TSLL *next; struct TSLL *prev; int data; } SLL; int main() { SLL *head = malloc(sizeof(SLL)); head->next = NULL; head->prev = NULL; head->data = 0; SLL *item = head; int status = 0; while (__VERIFIER_nondet_int()) { item->next = malloc(sizeof(SLL)); item->next->prev = item; item = item->next; item->next = NULL; if (!status) { item->data = 1; status = 1; } else if (status == 1) { item->data = 2; status = 2; } else if (status >= 2) { item->data = 3; status = 3; } } assert(head != NULL); if (status == 1) { } if (status == 2) { } if (status == 3) { } item = head->next; while (item && __VERIFIER_nondet_int()) { item = item->next; } while (head) { item = head; head = head->next; free(item); } return 0; }
TRUE
23.765118
easy
122
fermat1-ll_valuebound20_1.c
/* program computing a divisor for factorisation, by Knuth 4.5.4 Alg C ? */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "fermat1-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int A, R; long long u, v, r; A = __VERIFIER_nondet_int(); assume_abort_if_not(A >= 0 && A <= 20); R = __VERIFIER_nondet_int(); assume_abort_if_not(R >= 0 && R <= 20); assume_abort_if_not((((long long)R - 1) * ((long long)R - 1)) < A); // assume_abort_if_not(A <= R * R); assume_abort_if_not(A % 2 == 1); u = ((long long)2 * R) + 1; v = 1; r = ((long long)R * R) - A; while (1) { __VERIFIER_assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r != 0)) { break; } while (1) { if (!(r > 0)) { break; } r = r - v; v = v + 2; } while (1) { if (!(r < 0)) { break; } r = r + u; u = u + 2; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int A, R; long long u, v, r; A = __VERIFIER_nondet_int(); assume(A >= 0 && A <= 20); R = __VERIFIER_nondet_int(); assume(R >= 0 && R <= 20); assume((((long long)R - 1) * ((long long)R - 1)) < A); assume(A % 2 == 1); u = ((long long)2 * R) + 1; v = 1; r = ((long long)R * R) - A; while (1) { assert(4 * (A + r) == u * u - v * v - 2 * u + 2 * v); if (!(r != 0)) { break; } while (1) { if (!(r > 0)) { break; } r = r - v; v = v + 2; } while (1) { if (!(r < 0)) { break; } r = r + u; u = u + 2; } } return 0; }
TRUE
25.644469
easy
123
dijkstra-u_unwindbound2_6.c
/* Compute the floor of the square root, by Dijkstra */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "dijkstra-u.c", 5, "reach_error"); } extern unsigned int __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { unsigned int n, p, q, r, h; n = __VERIFIER_nondet_uint(); assume_abort_if_not(n < 4294967295 / 4); // Avoid non-terminating loop p = 0; q = 1; r = n; h = 0; while (counter++ < 2) { if (!(q <= n)) { break; } q = 4 * q; } // q == 4^n while (counter++ < 2) { __VERIFIER_assert(p * p - n * q + q * r == 0); if (!(q != 1)) { break; } q = q / 4; h = p + q; p = p / 2; if (r >= h) { p = p + q; r = r - h; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { unsigned int n, p, q, r, h; n = __VERIFIER_nondet_uint(); assume(n < 4294967295 / 4); p = 0; q = 1; r = n; h = 0; while (counter++ < 2) { if (!(q <= n)) { break; } q = 4 * q; } while (counter++ < 2) { assert(p * p - n * q + q * r == 0); if (!(q != 1)) { break; } q = q / 4; h = p + q; p = p / 2; if (r >= h) { p = p + q; r = r - h; } } return 0; }
TRUE
24.964066
easy
138
egcd3-ll_unwindbound10_3.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd3-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 10) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 10) { __VERIFIER_assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; while (counter++ < 10) { if (!(b != 0)) { break; } long long c, k; c = a; k = 0; while (counter++ < 10) { if (!(c >= b)) { break; } long long d, v; d = 1; v = b; while (counter++ < 10) { assert(a == k * b + c); if (!(c >= 2 * v)) { break; } d = 2 * d; v = 2 * v; } c = c - v; k = k + d; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } return 0; }
TRUE
29.633637
easy
141
sll-01-2_9.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } #define CREATE_INNER(N) typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { // create the head SLL *list = malloc(sizeof(SLL)); list->next = NULL; CREATE_INNER(list); SLL *end = list; // create an arbitrarily long tail while (__VERIFIER_nondet_int()) { // create a node end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; CREATE_INNER(end); } end = NULL; end = list; // check the invariant while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; if (len == 1) { inner = inner->inner; // Should be a real error. } } end = end->next; } // destroy the list while (NULL != list) { end = list->inner; // while (NULL != end) if (NULL != end) { __VERIFIER_assert(NULL != end); free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { SLL *list = malloc(sizeof(SLL)); list->next = NULL; ; SLL *end = list; while (__VERIFIER_nondet_int()) { end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; ; } end = NULL; end = list; while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; if (len == 1) { inner = inner->inner; } } end = end->next; } while (NULL != list) { end = list->inner; if (NULL != end) { assert(NULL != end); free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
TRUE
13.23531
easy
142
sll-01-1_8.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } #define CREATE_INNER(N) typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { // create the head SLL *list = malloc(sizeof(SLL)); list->next = NULL; CREATE_INNER(list); SLL *end = list; // create an arbitrarily long tail while (__VERIFIER_nondet_int()) { // create a node end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; CREATE_INNER(end); } end = NULL; end = list; // check the invariant while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; } __VERIFIER_assert(len <= 1); end = end->next; } // destroy the list while (NULL != list) { end = list->inner; // while (NULL != end) if (NULL != end) { free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { SLL *list = malloc(sizeof(SLL)); list->next = NULL; ; SLL *end = list; while (__VERIFIER_nondet_int()) { end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; ; } end = NULL; end = list; while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; } assert(len <= 1); end = end->next; } while (NULL != list) { end = list->inner; if (NULL != end) { free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
FALSE
10.104322
easy
143
egcd2-ll_unwindbound5_6.c
/* extended Euclid's algorithm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "egcd2-ll.c", 4, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 1); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume_abort_if_not(xy < 2147483647); assume_abort_if_not(yy < 2147483647); while (counter++ < 5) { if (!(b != 0)) { break; } c = a; k = 0; while (counter++ < 5) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } __VERIFIER_assert(p * x + r * y == a); return a; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int x, y; long long a, b, p, q, r, s, c, k, xy, yy; x = __VERIFIER_nondet_int(); y = __VERIFIER_nondet_int(); assume(x >= 1); assume(y >= 1); a = x; b = y; p = 1; q = 0; r = 0; s = 1; c = 0; k = 0; xy = (long long)x * y; yy = (long long)y * y; assume(xy < 2147483647); assume(yy < 2147483647); while (counter++ < 5) { if (!(b != 0)) { break; } c = a; k = 0; while (counter++ < 5) { if (!(c >= b)) { break; } c = c - b; k = k + 1; } a = b; b = c; long long temp; temp = p; p = q; q = temp - q * k; temp = r; r = s; s = temp - s * k; } assert(p * x + r * y == a); return a; }
TRUE
20.463746
easy
144
ps4-ll_unwindbound2_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 2) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); y = 0; x = 0; c = 0; while (counter++ < 2) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(4 * x - y * y * y * y - 2 * y * y * y - y * y == 0); return 0; }
TRUE
11.078885
easy
146
s42iff_1.c
/* * Benchmarks contributed by Divyesh Unadkat[1,2], Supratik Chakraborty[1], Ashutosh Gupta[1] * [1] Indian Institute of Technology Bombay, Mumbai * [2] TCS Innovation labs, Pune * */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "s42iff.c", 10, "reach_error"); } extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } extern int __VERIFIER_nondet_int(void); void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume_abort_if_not(N <= 2147483647 / sizeof(int)); int i; long long sum[1]; int *a = malloc(sizeof(int) * N); sum[0] = 1; for (i = 0; i < N; i++) { a[i] = 1; } for (i = 0; i < N; i++) { if (a[i] == 1) { a[i] = a[i] + 4; } else { a[i] = a[i] - 1; } } for (i = 0; i < N; i++) { if (a[i] == 5) { sum[0] = sum[0] + a[i]; } else { sum[0] = sum[0] * a[i]; } } __VERIFIER_assert(sum[0] == 5 * N); return 1; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } void *malloc(unsigned int size); int N; int main() { N = __VERIFIER_nondet_int(); if (N <= 0) { return 1; } assume(N <= 2147483647 / sizeof(int)); int i; long long sum[1]; int *a = malloc(sizeof(int) * N); sum[0] = 1; for (i = 0; i < N; i++) { a[i] = 1; } for (i = 0; i < N; i++) { if (a[i] == 1) { a[i] = a[i] + 4; } else { a[i] = a[i] - 1; } } for (i = 0; i < N; i++) { if (a[i] == 5) { sum[0] = sum[0] + a[i]; } else { sum[0] = sum[0] * a[i]; } } assert(sum[0] == 5 * N); return 1; }
FALSE
12.37523
easy
148
sll-01-1_9.c
extern void abort(void); #include <assert.h> void reach_error() { assert(0); } #define CREATE_INNER(N) typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { // create the head SLL *list = malloc(sizeof(SLL)); list->next = NULL; CREATE_INNER(list); SLL *end = list; // create an arbitrarily long tail while (__VERIFIER_nondet_int()) { // create a node end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; CREATE_INNER(end); } end = NULL; end = list; // check the invariant while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; } end = end->next; } // destroy the list while (NULL != list) { end = list->inner; // while (NULL != end) if (NULL != end) { __VERIFIER_assert(NULL != end); free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } typedef struct TSLL { struct TSLL *next; struct TSLL *inner; } SLL; int main() { SLL *list = malloc(sizeof(SLL)); list->next = NULL; ; SLL *end = list; while (__VERIFIER_nondet_int()) { end->next = malloc(sizeof(SLL)); end = end->next; end->next = NULL; ; } end = NULL; end = list; while (NULL != end) { int len = 0; SLL *inner = end->inner; while (NULL != inner) { if (len == 0) { len = 1; } else { len = 2; } inner = inner->inner; } end = end->next; } while (NULL != list) { end = list->inner; if (NULL != end) { assert(NULL != end); free(end); end = NULL; } end = list->next; free(list); list = end; } return 0; }
TRUE
10.688694
easy
149
geo2-ll_valuebound5_1.c
/* Geometric Series computes x = sum(z^k)[k=0..k-1], y = z^(k-1) */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "geo2-ll.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); assume_abort_if_not(z >= 0 && z <= 5); k = __VERIFIER_nondet_int(); assume_abort_if_not(k >= 0 && k <= 5); x = 1; y = 1; c = 1; while (1) { __VERIFIER_assert(1 + x * z - x - z * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); assume(z >= 0 && z <= 5); k = __VERIFIER_nondet_int(); assume(k >= 0 && k <= 5); x = 1; y = 1; c = 1; while (1) { assert(1 + x * z - x - z * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } return 0; }
TRUE
11.864682
easy
150
ps6-ll_3.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps6-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y * y + x; } __VERIFIER_assert(k * y == y * y); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k <= 256); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(k * y == y * y); return 0; }
TRUE
12.422586
easy
152
prod4br-ll_valuebound2_2.c
/* algorithm for computing the product of two natural numbers */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "prod4br-ll.c", 5, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume_abort_if_not(x >= 0 && x <= 2); y = __VERIFIER_nondet_int(); assume_abort_if_not(y >= 0 && y <= 2); assume_abort_if_not(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; /*fix a bug here--- was (a+b-1)*/ } } __VERIFIER_assert(q == (long long)x * y); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int x, y; long long a, b, p, q; x = __VERIFIER_nondet_int(); assume(x >= 0 && x <= 2); y = __VERIFIER_nondet_int(); assume(y >= 0 && y <= 2); assume(y >= 1); a = x; b = y; p = 1; q = 0; while (1) { if (!(a != 0 && b != 0)) { break; } if (a % 2 == 0 && b % 2 == 0) { a = a / 2; b = b / 2; p = 4 * p; } else if (a % 2 == 1 && b % 2 == 0) { a = a - 1; q = q + b * p; } else if (a % 2 == 0 && b % 2 == 1) { b = b - 1; q = q + a * p; } else { a = a - 1; b = b - 1; q = q + (a + b + 1) * p; } } assert(q == (long long)x * y); return 0; }
TRUE
29.040715
easy
154
hard2_unwindbound5_5.c
/* hardware integer division program, by Manna returns q==A//B */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "hard2.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int counter = 0; int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); B = 1; r = A; d = B; p = 1; q = 0; while (counter++ < 5) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (counter++ < 5) { __VERIFIER_assert(d == B * p); if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int counter = 0; int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); B = 1; r = A; d = B; p = 1; q = 0; while (counter++ < 5) { if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (counter++ < 5) { assert(d == B * p); if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
TRUE
20.107373
easy
155
ps4-ll_valuebound10_2.c
extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "ps4-ll.c", 3, "reach_error"); } extern short __VERIFIER_nondet_short(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume_abort_if_not(k >= 0 && k <= 10); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } __VERIFIER_assert(k * y - (y * y) == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short k; long long y, x, c; k = __VERIFIER_nondet_short(); assume(k >= 0 && k <= 10); y = 0; x = 0; c = 0; while (1) { if (!(c < k)) { break; } c = c + 1; y = y + 1; x = y * y * y + x; } assert(k * y - (y * y) == 0); return 0; }
TRUE
11.70973
easy
157
dijkstra-u_valuebound2_8.c
/* Compute the floor of the square root, by Dijkstra */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "dijkstra-u.c", 5, "reach_error"); } extern unsigned int __VERIFIER_nondet_uint(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { unsigned int n, p, q, r, h; n = __VERIFIER_nondet_uint(); assume_abort_if_not(n >= 0 && n <= 2); assume_abort_if_not(n < 4294967295 / 4); // Avoid non-terminating loop p = 0; q = 1; r = n; h = 0; while (1) { if (!(q <= n)) { break; } q = 4 * q; } // q == 4^n while (1) { if (!(q != 1)) { break; } q = q / 4; h = p + q; p = p / 2; if (r >= h) { p = p + q; r = r - h; } } __VERIFIER_assert(p * p - n + r == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { unsigned int n, p, q, r, h; n = __VERIFIER_nondet_uint(); assume(n >= 0 && n <= 2); assume(n < 4294967295 / 4); p = 0; q = 1; r = n; h = 0; while (1) { if (!(q <= n)) { break; } q = 4 * q; } while (1) { if (!(q != 1)) { break; } q = q / 4; h = p + q; p = p / 2; if (r >= h) { p = p + q; r = r - h; } } assert(p * p - n + r == 0); return 0; }
TRUE
25.778309
easy
158
cohencu-ll_valuebound5_9.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(2 * y * y - 3 * x * z - 18 * x - 10 * y + 3 * z - 10 == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 5); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(2 * y * y - 3 * x * z - 18 * x - 10 * y + 3 * z - 10 == 0); return 0; }
TRUE
22.318819
easy
161
cohencu-ll_valuebound2_4.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 2); n = 0; x = 0; y = 1; z = 6; while (1) { __VERIFIER_assert(y * z - 18 * x - 12 * y + 2 * z - 6 == 0); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 2); n = 0; x = 0; y = 1; z = 6; while (1) { assert(y * z - 18 * x - 12 * y + 2 * z - 6 == 0); if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } return 0; }
TRUE
9.691087
easy
163
cohencu-ll_valuebound10_7.c
/* Printing consecutive cubes, by Cohen http://www.cs.upc.edu/~erodri/webpage/polynomial_invariants/cohencu.htm */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "cohencu-ll.c", 8, "reach_error"); } extern unsigned short __VERIFIER_nondet_ushort(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume_abort_if_not(a >= 0 && a <= 10); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } __VERIFIER_assert(6 * a * x - x * z + 12 * x == 0); return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { short a; long long n, x, y, z; a = __VERIFIER_nondet_ushort(); assume(a >= 0 && a <= 10); n = 0; x = 0; y = 1; z = 6; while (1) { if (!(n <= a)) { break; } n = n + 1; x = x + y; y = y + z; z = z + 6; } assert(6 * a * x - x * z + 12 * x == 0); return 0; }
TRUE
9.238219
easy
164
geo2-ll2_1.c
/* Geometric Series computes x = sum(z^k)[k=0..k-1], y = z^(k-1) */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "geo2-ll.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); k = __VERIFIER_nondet_int(); x = 1; y = 1; c = 1; while (1) { __VERIFIER_assert(1 + x * z - x - z * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int z, k; long long x, y, c; z = __VERIFIER_nondet_int(); k = __VERIFIER_nondet_int(); x = 1; y = 1; c = 1; while (1) { assert(1 + x * z - x - z * y == 0); if (!(c < k)) { break; } c = c + 1; x = x * z + 1; y = y * z; } return 0; }
TRUE
9.242116
easy
166
hard2_valuebound10_1.c
/* hardware integer division program, by Manna returns q==A//B */ extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "hard2.c", 8, "reach_error"); } extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if (!cond) { abort(); } } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR : { reach_error(); } } return; } int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); assume_abort_if_not(A >= 0 && A <= 10); B = 1; r = A; d = B; p = 1; q = 0; while (1) { __VERIFIER_assert(q == 0); if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } int main() { int A, B; int r, d, p, q; A = __VERIFIER_nondet_int(); assume(A >= 0 && A <= 10); B = 1; r = A; d = B; p = 1; q = 0; while (1) { assert(q == 0); if (!(r >= d)) { break; } d = 2 * d; p = 2 * p; } while (1) { if (!(p != 1)) { break; } d = d / 2; p = p / 2; if (r >= d) { r = r - d; q = q + p; } } return 0; }
TRUE
8.69488
easy
167
tree_del_rec_3.c
extern void *calloc(unsigned int nmemb, unsigned int size); extern void *malloc(unsigned int size); extern void free(void *); extern int __VERIFIER_nondet_int(void); extern _Bool __VERIFIER_nondet_bool(void); void assume_cycle_if_not(int cond) { if(!cond) while(1); } extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); void reach_error() { __assert_fail("0", "tree_del_rec.c", 14, "reach_error"); } void __VERIFIER_assert(int cond) { if (!cond) { reach_error(); abort(); } } struct node { int data; struct node *left, *right; }; struct node *nondet_tree() { if (__VERIFIER_nondet_bool()) { return 0; } else { struct node *n = (struct node *)malloc(sizeof(struct node)); n->data = __VERIFIER_nondet_int(); n->left = nondet_tree(); n->right = nondet_tree(); return n; } } int min(struct node *n) { if (!n) { return 2147483647; /* INT_MAX */ } else { int a = n->data; int b = min(n->left); int c = min(n->right); if (b <= a && b <= c) { return b; } if (c <= a && c <= b) { return c; } return a; /* this node has the minimum */ } } struct node *tree_del(struct node *t, int *min) { struct node *r; if (!t->left) { *min = t->data; r = t->right; free(t); return r; } else { t->left = tree_del(t->left, min); return t; } } int tree_inorder(struct node *t, int *a, int i) { if (!t) { return i; } else { i = tree_inorder(t->left, a, i); a[i++] = t->data; i = tree_inorder(t->right, a, i); return i; } } int size(struct node *t) { if (!t) { return 0; } else { return size(t->left) + size(t->right) + 1; } } void task(struct node *t) { int a = min(t); int b; int n = size(t); assume_cycle_if_not(n != 0); int *x = calloc(n, sizeof(int)); tree_inorder(t, x, n); struct node *r = tree_del(t, &b); int m = size(t); int *y = calloc(n, sizeof(int)); tree_inorder(t, y, m); __VERIFIER_assert(n == m + 1); int i; for (i = 0; i < m; i++) { } free(x); free(y); } int main() { task(nondet_tree()); }
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } } void assume(int cond) { if (!cond) { abort(); } } void assume_cycle_if_not(int cond) { if (!cond) { while (1) { ; } } } struct node { int data; struct node *left, *right; }; struct node *nondet_tree() { if (__VERIFIER_nondet_bool()) { return 0; } else { struct node *n = (struct node *)malloc(sizeof(struct node)); n->data = __VERIFIER_nondet_int(); n->left = nondet_tree(); n->right = nondet_tree(); return n; } } int min(struct node *n) { if (!n) { return 2147483647; } else { int a = n->data; int b = min(n->left); int c = min(n->right); if (b <= a && b <= c) { return b; } if (c <= a && c <= b) { return c; } return a; } } struct node *tree_del(struct node *t, int *min) { struct node *r; if (!t->left) { *min = t->data; r = t->right; free(t); return r; } else { t->left = tree_del(t->left, min); return t; } } int tree_inorder(struct node *t, int *a, int i) { if (!t) { return i; } else { i = tree_inorder(t->left, a, i); a[i++] = t->data; i = tree_inorder(t->right, a, i); return i; } } int size(struct node *t) { if (!t) { return 0; } else { return size(t->left) + size(t->right) + 1; } } void task(struct node *t) { int a = min(t); int b; int n = size(t); assume_cycle_if_not(n != 0); int *x = calloc(n, sizeof(int)); tree_inorder(t, x, n); struct node *r = tree_del(t, &b); int m = size(t); int *y = calloc(n, sizeof(int)); tree_inorder(t, y, m); assert(n == m + 1); int i; for (i = 0; i < m; i++) { } free(x); free(y); } int main() { task(nondet_tree()); }
FALSE
15.209249
easy
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
26