id
int64 1
219
| file
stringlengths 8
30
| original_program
stringlengths 387
8.63k
| program_for_baseline
stringlengths 260
6.89k
| baseline_decision
stringclasses 3
values | timings
listlengths 3
3
| median_timing
float64 2.79
600
| program_for_llm
stringlengths 151
6.79k
| split
stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
1
|
geo1-ll_unwindbound1_2.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 counter = 0;
int main() {
int z, k;
unsigned long long x, y, c;
z = __VERIFIER_nondet_int();
k = __VERIFIER_nondet_int();
assume_abort_if_not(z >= 1);
assume_abort_if_not(k >= 1);
x = 1;
y = z;
c = 1;
while (counter++ < 1) {
if (!(c < k)) {
break;
}
c = c + 1;
x = x * z + 1;
y = y * z;
} // geo1
x = x * (z - 1);
__VERIFIER_assert(1 + 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 z;
int k;
unsigned long long x;
unsigned long long y;
unsigned long long c;
z = __VERIFIER_nondet_int();
k = __VERIFIER_nondet_int();
assume(z >= 1);
assume(k >= 1);
x = 1;
y = z;
c = 1;
while ((counter++) < 1)
{
;
if (!(c < k))
{
break;
}
c = c + 1;
x = (x * z) + 1;
y = y * z;
}
x = x * (z - 1);
assert(((1 + x) - y) == 0);
return 0;
}
|
TRUE
|
[
48.17556805704953,
50.44778047199361,
48.47588776197517
] | 48.475888
|
int counter = 0;
int main()
{
int z;
int k;
unsigned long long x;
unsigned long long y;
unsigned long long c;
z = (int) rand();
k = (int) rand();
assume(z >= 1);
assume(k >= 1);
x = 1;
y = z;
c = 1;
while ((counter++) < 1)
{
INVARIANT_MARKER_1();
if (!(c < k))
{
break;
}
c = c + 1;
x = (x * z) + 1;
y = y * z;
}
x = x * (z - 1);
assert(((1 + x) - y) == 0);
return 0;
}
|
hard
|
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;
int b;
long long x;
long long y;
long long 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
|
[
3.2313995250151493,
3.259587259963155,
3.1788803759845905
] | 3.2314
|
int counter = 0;
int main()
{
int a;
int b;
long long x;
long long y;
long long z;
a = (int) rand();
b = (int) rand();
assume(b >= 1);
x = a;
y = b;
z = 0;
while ((counter++) < 1)
{
INVARIANT_MARKER_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;
}
|
easy
|
3
|
egcd2-ll_valuebound50_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 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 <= 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;
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 == 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 main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
long long c;
long long k;
long long xy;
long long yy;
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;
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 == ((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
|
[
205.71780442399904,
213.31883465097053,
212.52220862498507
] | 212.522209
|
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
long long c;
long long k;
long long xy;
long long yy;
x = (int) rand();
assume((x >= 0) && (x <= 50));
y = (int) rand();
assume((y >= 0) && (y <= 50));
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)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
c = a;
k = 0;
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
hard
|
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
|
[
3.40543018799508,
2.785573425993789,
2.762494330003392
] | 2.785573
|
void *malloc(unsigned int size);
int N;
int main()
{
N = (int) rand();
if (N <= 0)
{
return 1;
}
assume(N <= (2147483647 / (sizeof(int))));
int i;
int *a = malloc((sizeof(int)) * N);
for (i = 0; i < N; i++)
{
INVARIANT_MARKER_1();
a[i] = 0;
}
for (i = 0; i < N; i++)
{
INVARIANT_MARKER_2();
if ((N % 2) == 1)
{
a[i] = a[i] + 2;
}
else
{
a[i] = a[i] + 1;
}
}
for (i = 0; i < N; i++)
{
INVARIANT_MARKER_3();
assert((a[i] % 2) == (N % 2));
}
return 1;
}
|
easy
|
5
|
cohencu-ll_valuebound100_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 <= 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(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;
long long x;
long long y;
long long 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((((((((2 * y) * y) - ((3 * x) * z)) - (18 * x)) - (10 * y)) + (3 * z)) - 10) == 0);
return 0;
}
|
TRUE
|
[
38.77385059703374,
38.25098747899756,
38.38460099202348
] | 38.384601
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 100));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
hard
|
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;
long long x;
long long y;
long long 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
|
[
3.180253451981116,
3.1502078589983284,
3.201172458997462
] | 3.180253
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 1));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
easy
|
7
|
hard2_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", "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();
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()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = __VERIFIER_nondet_int();
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;
}
|
TIMEOUT
|
[
600,
600,
600
] | 600
|
int main()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = (int) rand();
B = 1;
r = A;
d = B;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= d))
{
break;
}
d = 2 * d;
p = 2 * p;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
hard
|
8
|
freire2_unwindbound10_3.c
|
/* Algorithm for finding the closet integer to cubic root
* more details, see : http://www.pedrofreire.com/sqrt/sqrt1.en.html
Note: for some reason using cpa was able to disprove these
cpa.sh -kInduction -setprop solver.solver=z3 freire2.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", "freire2.c", 10, "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 counter = 0;
int main() {
int r;
double a, x, s;
a = __VERIFIER_nondet_double();
x = a;
s = 3.25;
r = 1;
while (counter++ < 10) {
__VERIFIER_assert((int)(8 * r * s - 24 * a + 16 * r - 12 * s + 24 * x - 3 == 0));
if (!(x - s > 0.0)) {
break;
}
x = x - s;
s = s + 6 * r + 3;
r = r + 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 r;
double a;
double x;
double s;
a = __VERIFIER_nondet_double();
x = a;
s = 3.25;
r = 1;
while ((counter++) < 10)
{
;
assert((int) ((((((((8 * r) * s) - (24 * a)) + (16 * r)) - (12 * s)) + (24 * x)) - 3) == 0));
if (!((x - s) > 0.0))
{
break;
}
x = x - s;
s = (s + (6 * r)) + 3;
r = r + 1;
}
return 0;
}
|
FALSE
|
[
24.767932577000465,
24.582481388002634,
24.637397395970766
] | 24.637397
|
int counter = 0;
int main()
{
int r;
double a;
double x;
double s;
a = (double) rand();
x = a;
s = 3.25;
r = 1;
while ((counter++) < 10)
{
INVARIANT_MARKER_1();
assert((int) ((((((((8 * r) * s) - (24 * a)) + (16 * r)) - (12 * s)) + (24 * x)) - 3) == 0));
if (!((x - s) > 0.0))
{
break;
}
x = x - s;
s = (s + (6 * r)) + 3;
r = r + 1;
}
return 0;
}
|
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;
int R;
long long u;
long long v;
long long 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
|
[
5.692226686980575,
5.151226330024656,
5.11883603601018
] | 5.151226
|
int counter = 0;
int main()
{
int A;
int R;
long long u;
long long v;
long long r;
A = (int) rand();
R = (int) rand();
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)
{
INVARIANT_MARKER_1();
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;
}
|
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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int 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
|
[
3.8691455320222303,
3.930147686973214,
4.362941546016373
] | 3.930148
|
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
assume((x >= 0) && (x <= 20));
y = (int) rand();
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)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long y;
long long 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
|
[
3.1433154880069196,
3.1813823750126176,
3.1256105730426498
] | 3.143315
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 20));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long 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
|
[
3.7503540469915606,
4.055634371004999,
3.6828178760479204
] | 3.750354
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
assume(k <= 256);
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(c < k))
{
break;
}
c = c + 1;
y = y + 1;
x = (((y * y) * y) * y) + x;
}
assert((k * y) == (y * y));
return 0;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long 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;
long long k;
c = a;
k = 0;
while ((counter++) < 50)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long 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
|
[
4.02346919500269,
3.6014633600134403,
3.622331708029378
] | 3.622332
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 50)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while ((counter++) < 50)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while ((counter++) < 50)
{
INVARIANT_MARKER_3();
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;
}
|
easy
|
14
|
hard2_valuebound1_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", "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 <= 1);
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()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = __VERIFIER_nondet_int();
assume((A >= 0) && (A <= 1));
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.004339008999523,
23.888219040003605,
27.787746975955088
] | 27.004339
|
int main()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = (int) rand();
assume((A >= 0) && (A <= 1));
B = 1;
r = A;
d = B;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= d))
{
break;
}
d = 2 * d;
p = 2 * p;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
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
|
[
4.343507797049824,
4.090723657980561,
4.113108145014849
] | 4.113108
|
int main()
{
unsigned int x = 0;
while (x < 100000000)
{
INVARIANT_MARKER_1();
if (x < 10000000)
{
x++;
}
else
{
x += 2;
}
}
assert((x % 2) == 0);
return 0;
}
|
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;
long long x;
long long 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
|
[
3.66233108000597,
3.6324352740193717,
3.2370067900046706
] | 3.632435
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
assume((k >= 0) && (k <= 5));
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long y;
long long 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
|
[
3.100354837020859,
3.1686688979971223,
3.6174876170116477
] | 3.168669
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 20));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long y;
long long 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
|
[
5.388494809973054,
5.263128796999808,
5.369712587969843
] | 5.369713
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 50));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
easy
|
19
|
egcd-ll_valuebound5_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 <= 5);
y = __VERIFIER_nondet_int();
assume_abort_if_not(y >= 0 && y <= 5);
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(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 main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = __VERIFIER_nondet_int();
assume((x >= 0) && (x <= 5));
y = __VERIFIER_nondet_int();
assume((y >= 0) && (y <= 5));
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((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
TRUE
|
[
12.870408152986784,
13.199893784010783,
13.444726904970594
] | 13.199894
|
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
assume((x >= 0) && (x <= 5));
y = (int) rand();
assume((y >= 0) && (y <= 5));
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while (1)
{
INVARIANT_MARKER_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((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
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;
}
|
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } }
void assume(int cond) { if (!cond) { abort(); } }
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = __VERIFIER_nondet_int();
assume((x >= 0) && (x <= 100));
y = __VERIFIER_nondet_int();
assume((y >= 0) && (y <= 100));
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while (1)
{
;
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;
}
}
assert((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
TRUE
|
[
8.977821929962374,
8.593483573000412,
16.94829440698959
] | 8.977822
|
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
assume((x >= 0) && (x <= 100));
y = (int) rand();
assume((y >= 0) && (y <= 100));
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while (1)
{
INVARIANT_MARKER_1();
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;
}
}
assert((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long 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
|
[
3.453790681960527,
3.32533072901424,
3.2845041360124014
] | 3.325331
|
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
x = (int) rand();
assume((x >= 0) && (x <= 10));
y = (int) rand();
assume((y >= 0) && (y <= 10));
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
unsigned int B;
long long r;
long long d;
long long p;
long long 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
|
[
4.475212654040661,
4.947320236009546,
4.46484591497574
] | 4.475213
|
int main()
{
unsigned int A;
unsigned int B;
long long r;
long long d;
long long p;
long long q;
A = (unsigned int) rand();
assume((A >= 0) && (A <= 1));
B = (unsigned int) rand();
assume((B >= 0) && (B <= 1));
assume(B >= 1);
r = A;
d = B;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= d))
{
break;
}
d = 2 * d;
p = 2 * p;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
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
|
[
3.2040367769659497,
3.5920763299800456,
3.367471067002043
] | 3.367471
|
int main()
{
int i = (int) rand();
int k = (int) rand();
int n = (int) rand();
if (!(((i == 0) && (k == n)) && (n >= 0)))
{
return 0;
}
while (i < n)
{
INVARIANT_MARKER_1();
k--;
i += 2;
}
assert((2 * k) >= (n - 1));
return 0;
}
|
easy
|
24
|
rewnifrev2_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", "rewnifrev2.c", 3, "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 SIZE;
const int MAX = 100000;
int main() {
SIZE = __VERIFIER_nondet_int();
int i;
if (SIZE > 1 && SIZE < MAX) {
int *a = malloc(sizeof(int) * SIZE);
for (i = SIZE - 2; i >= 0; i--) {
a[i] = i;
a[i + 1] = i + 1;
}
for (i = 0; i < SIZE; i++) {
__VERIFIER_assert(a[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 SIZE;
const int MAX = 100000;
int main()
{
SIZE = __VERIFIER_nondet_int();
int i;
if ((SIZE > 1) && (SIZE < MAX))
{
int *a = malloc((sizeof(int)) * SIZE);
for (i = SIZE - 2; i >= 0; i--)
{
;
a[i] = i;
a[i + 1] = i + 1;
}
for (i = 0; i < SIZE; i++)
{
;
assert(a[i] >= i);
}
}
return 1;
}
|
TIMEOUT
|
[
600,
600,
600
] | 600
|
void *malloc(unsigned int size);
int SIZE;
const int MAX = 100000;
int main()
{
SIZE = (int) rand();
int i;
if ((SIZE > 1) && (SIZE < MAX))
{
int *a = malloc((sizeof(int)) * SIZE);
for (i = SIZE - 2; i >= 0; i--)
{
INVARIANT_MARKER_1();
a[i] = i;
a[i + 1] = i + 1;
}
for (i = 0; i < SIZE; i++)
{
INVARIANT_MARKER_2();
assert(a[i] >= i);
}
}
return 1;
}
|
hard
|
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;
long long x;
long long y;
long long 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
|
[
4.180961174017284,
3.634843739971984,
3.5852220809902065
] | 3.634844
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 2));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long y;
long long 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
|
[
5.065433937008493,
5.382770735013764,
5.42932222399395
] | 5.382771
|
int counter = 0;
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while ((counter++) < 20)
{
INVARIANT_MARKER_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;
}
|
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;
unsigned b;
unsigned x;
unsigned y;
unsigned u;
unsigned 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
|
[
3.6806939609814435,
3.6056270109838806,
3.1305154570145532
] | 3.605627
|
int counter = 0;
int main()
{
unsigned a;
unsigned b;
unsigned x;
unsigned y;
unsigned u;
unsigned v;
a = (unsigned int) rand();
b = (unsigned int) rand();
assume(a >= 1);
assume(b >= 1);
assume(a <= 65535);
assume(b <= 65535);
x = a;
y = b;
u = b;
v = 0;
while ((counter++) < 2)
{
INVARIANT_MARKER_1();
if (!(x != y))
{
break;
}
while ((counter++) < 2)
{
INVARIANT_MARKER_2();
if (!(x > y))
{
break;
}
x = x - y;
v = v + u;
}
while ((counter++) < 2)
{
INVARIANT_MARKER_3();
if (!(x < y))
{
break;
}
y = y - x;
u = u + v;
}
}
assert(x == y);
return 0;
}
|
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;
long long x;
long long 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
|
[
4.269199436996132,
3.8527221160475165,
4.282192612008657
] | 4.269199
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(c < k))
{
break;
}
c = c + 1;
y = y + 1;
x = ((y * y) * y) + x;
}
assert(((k * y) - (y * y)) == 0);
return 0;
}
|
easy
|
29
|
num_conversion_1_1.c
|
// This file is part of the SV-Benchmarks collection of verification tasks:
// https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks
//
// SPDX-FileCopyrightText: 2012-2021 The SV-Benchmarks Community
// SPDX-FileCopyrightText: 2012 FBK-ES <https://es.fbk.eu/>
//
// SPDX-License-Identifier: Apache-2.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", "num_conversion_1.c", 3, "reach_error");
}
extern int __VERIFIER_nondet_int(void);
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR : {
reach_error();
abort();
}
}
return;
}
// #include <assert.h>
int main() {
unsigned char x;
unsigned char y;
unsigned char c;
x = 37;
y = 0;
c = 0;
while (c < (unsigned char)8) {
unsigned char i = ((unsigned char)1) << c;
unsigned char bit = x & i;
if (bit != (unsigned char)0) {
y = y + i;
}
c = c + ((unsigned char)1);
}
__VERIFIER_assert(x == y);
return 0;
}
|
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } }
void assume(int cond) { if (!cond) { abort(); } }
int main()
{
unsigned char x;
unsigned char y;
unsigned char c;
x = 37;
y = 0;
c = 0;
while (c < ((unsigned char) 8))
{
;
unsigned char i = ((unsigned char) 1) << c;
unsigned char bit = x & i;
if (bit != ((unsigned char) 0))
{
y = y + i;
}
c = c + ((unsigned char) 1);
}
assert(x == y);
return 0;
}
|
TRUE
|
[
15.69061186799081,
17.10984572599409,
15.594676886044908
] | 15.690612
|
int main()
{
unsigned char x;
unsigned char y;
unsigned char c;
x = 37;
y = 0;
c = 0;
while (c < ((unsigned char) 8))
{
INVARIANT_MARKER_1();
unsigned char i = ((unsigned char) 1) << c;
unsigned char bit = x & i;
if (bit != ((unsigned char) 0))
{
y = y + i;
}
c = c + ((unsigned char) 1);
}
assert(x == y);
return 0;
}
|
easy
|
30
|
sum_by_3_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", "sum_by_3.c", 3, "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();
}
}
return;
}
int SIZE = 20000001;
unsigned int __VERIFIER_nondet_uint();
int main() {
unsigned int n, i, k;
n = __VERIFIER_nondet_uint();
if (!(n <= SIZE)) {
return 0;
}
i = 0;
while (i < n) {
i = i + 1;
}
int j = i;
while (j < n) {
j = j + 1;
}
k = j;
while (k < n) {
k = k + 1;
}
__VERIFIER_assert((i + j + k) / 3 <= SIZE);
return 0;
}
|
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } }
void assume(int cond) { if (!cond) { abort(); } }
int SIZE = 20000001;
unsigned int __VERIFIER_nondet_uint();
int main()
{
unsigned int n;
unsigned int i;
unsigned int k;
n = __VERIFIER_nondet_uint();
if (!(n <= SIZE))
{
return 0;
}
i = 0;
while (i < n)
{
;
i = i + 1;
}
int j = i;
while (j < n)
{
;
j = j + 1;
}
k = j;
while (k < n)
{
;
k = k + 1;
}
assert((((i + j) + k) / 3) <= SIZE);
return 0;
}
|
TRUE
|
[
98.85375956998905,
105.97380227502435,
104.68053347698878
] | 104.680533
|
int SIZE = 20000001;
unsigned int (unsigned int) rand();
int main()
{
unsigned int n;
unsigned int i;
unsigned int k;
n = (unsigned int) rand();
if (!(n <= SIZE))
{
return 0;
}
i = 0;
while (i < n)
{
INVARIANT_MARKER_1();
i = i + 1;
}
int j = i;
while (j < n)
{
INVARIANT_MARKER_2();
j = j + 1;
}
k = j;
while (k < n)
{
INVARIANT_MARKER_3();
k = k + 1;
}
assert((((i + j) + k) / 3) <= SIZE);
return 0;
}
|
hard
|
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;
long long x;
long long y;
long long 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
|
[
3.6655099889612757,
3.8042458170093596,
3.6501546429935843
] | 3.66551
|
int counter = 0;
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while ((counter++) < 5)
{
INVARIANT_MARKER_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;
}
|
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
|
[
3.0365190490265377,
3.4901496420498006,
3.45362672599731
] | 3.453627
|
int main()
{
int m = 0;
int n = 0;
while (1)
{
INVARIANT_MARKER_1();
assert(n <= 60);
if ((bool) rand())
{
if ((bool) rand())
{
if (m < 60)
{
m++;
}
else
{
m = 0;
}
}
}
if ((bool) rand())
{
if ((bool) rand())
{
if (n < 60)
{
n++;
}
else
{
n = 0;
}
}
}
}
return 0;
}
|
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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int 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
|
[
3.9043275520089082,
3.9921503649675287,
3.978751240996644
] | 3.978751
|
int counter = 0;
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 10)
{
INVARIANT_MARKER_1();
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;
}
|
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;
int k;
long long x;
long long y;
long long 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
|
[
4.394543864997104,
4.309014783997554,
3.847944103006739
] | 4.309015
|
int main()
{
int z;
int k;
long long x;
long long y;
long long c;
z = (int) rand();
assume((z >= 0) && (z <= 2));
k = (int) rand();
assume((k >= 0) && (k <= 2));
assume(z >= 1);
assume(k >= 1);
x = 1;
y = z;
c = 1;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
int n;
int x;
int y;
int 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
|
[
3.3589168359758332,
2.902650393953081,
3.3233061360078864
] | 3.323306
|
int main()
{
int a;
int n;
int x;
int y;
int z;
a = (int) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_1();
assert(z == ((6 * n) + 6));
if (!(n <= a))
{
break;
}
n = n + 1;
x = x + y;
y = y + z;
z = z + 6;
}
return 0;
}
|
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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int 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
|
[
3.8525240960298106,
3.8935068720020354,
4.106843271991238
] | 3.893507
|
int counter = 0;
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 50)
{
INVARIANT_MARKER_1();
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;
}
|
easy
|
37
|
rewnifrev_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", "rewnifrev.c", 3, "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 SIZE;
const int MAX = 100000;
int main() {
SIZE = __VERIFIER_nondet_int();
if (SIZE > 1 && SIZE < MAX) {
int i;
int *a = malloc(sizeof(int) * SIZE);
for (i = SIZE - 1; i >= 0; i--) {
if ((i - 1) >= 0) {
a[i - 1] = i - 2;
}
a[i] = i;
}
for (i = 0; i < SIZE; i++) {
__VERIFIER_assert(a[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 SIZE;
const int MAX = 100000;
int main()
{
SIZE = __VERIFIER_nondet_int();
if ((SIZE > 1) && (SIZE < MAX))
{
int i;
int *a = malloc((sizeof(int)) * SIZE);
for (i = SIZE - 1; i >= 0; i--)
{
;
if ((i - 1) >= 0)
{
a[i - 1] = i - 2;
}
a[i] = i;
}
for (i = 0; i < SIZE; i++)
{
;
assert(a[i] >= i);
}
}
return 1;
}
|
TIMEOUT
|
[
600,
600,
600
] | 600
|
void *malloc(unsigned int size);
int SIZE;
const int MAX = 100000;
int main()
{
SIZE = (int) rand();
if ((SIZE > 1) && (SIZE < MAX))
{
int i;
int *a = malloc((sizeof(int)) * SIZE);
for (i = SIZE - 1; i >= 0; i--)
{
INVARIANT_MARKER_1();
if ((i - 1) >= 0)
{
a[i - 1] = i - 2;
}
a[i] = i;
}
for (i = 0; i < SIZE; i++)
{
INVARIANT_MARKER_2();
assert(a[i] >= i);
}
}
return 1;
}
|
hard
|
38
|
hard2_valuebound10_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 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) {
if (!(r >= d)) {
break;
}
d = 2 * d;
p = 2 * p;
}
while (1) {
__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 main()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = __VERIFIER_nondet_int();
assume((A >= 0) && (A <= 10));
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(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
|
[
45.1108198009897,
44.509495894017164,
43.57572907599388
] | 44.509496
|
int main()
{
int A;
int B;
int r;
int d;
int p;
int q;
A = (int) rand();
assume((A >= 0) && (A <= 10));
B = 1;
r = A;
d = B;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= d))
{
break;
}
d = 2 * d;
p = 2 * p;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
hard
|
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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int 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
|
[
14.082223333010916,
14.574602227017749,
14.908257484028582
] | 14.574602
|
int counter = 0;
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 10)
{
INVARIANT_MARKER_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((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
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;
unsigned B;
unsigned q;
unsigned r;
unsigned 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
|
[
6.358308510039933,
6.316791600023862,
6.054061484988779
] | 6.316792
|
int main()
{
unsigned A;
unsigned B;
unsigned q;
unsigned r;
unsigned b;
A = (unsigned int) rand();
assume((A >= 0) && (A <= 1));
B = 1;
q = 0;
r = A;
b = B;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= b))
{
break;
}
b = 2 * b;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
easy
|
41
|
egcd3-ll_valuebound2_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 <= 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;
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
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;
while (1)
{
;
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while (1)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long 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
|
[
29.790918100974523,
28.95391258399468,
29.677485001971945
] | 29.677485
|
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
assume((x >= 0) && (x <= 2));
y = (int) rand();
assume((y >= 0) && (y <= 2));
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while (1)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while (1)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while (1)
{
INVARIANT_MARKER_3();
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;
}
|
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;
long long x;
long long y;
long long 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
|
[
5.217184454028029,
5.1592390519799665,
5.537847539992072
] | 5.217184
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 10));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int 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
|
[
10.525907565024681,
10.634770117001608,
10.445417592010926
] | 10.525908
|
int counter = 0;
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 5)
{
INVARIANT_MARKER_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((((p * x) + (r * y)) - b) == 0);
return 0;
}
|
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;
long long x;
long long y;
long long 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
|
[
8.873458713002037,
8.32761333102826,
8.599731385009363
] | 8.599731
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 100));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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
|
[
5.335370855988003,
4.607098093023524,
4.645075494016055
] | 4.645075
|
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 ((int) rand())
{
INVARIANT_MARKER_1();
end->next = malloc(sizeof(SLL));
end->next->prev = end;
end = end->next;
end->next = NULL;
if ((int) rand())
{
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)
{
INVARIANT_MARKER_2();
if (RED == end->colour)
{
end = end->next;
end = end->next;
}
assert(end->next);
end = end->next;
}
while (NULL != list)
{
INVARIANT_MARKER_3();
if (RED == list->colour)
{
end = list->next;
free(list);
list = end->next;
free(end);
}
else
{
end = list->next;
free(list);
list = end;
}
}
return 0;
}
|
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;
long long x;
long long 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
|
[
5.332450041023549,
5.322034009965137,
5.481144185992889
] | 5.33245
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
assume((k >= 0) && (k <= 5));
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
int a;
int s;
int 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
|
[
5.192616373999044,
4.9505335439462215,
5.30947021197062
] | 5.192616
|
int main()
{
int n;
int a;
int s;
int t;
n = (int) rand();
a = 0;
s = 1;
t = 1;
while (1)
{
INVARIANT_MARKER_1();
assert(s == ((a + 1) * (a + 1)));
if (!(s <= n))
{
break;
}
a = a + 1;
t = t + 2;
s = s + t;
}
return 0;
}
|
easy
|
48
|
egcd3-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", "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) {
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 counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long 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;
long long k;
c = a;
k = 0;
while ((counter++) < 10)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while ((counter++) < 10)
{
;
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;
}
|
FALSE
|
[
38.36512292904081,
38.25699684099527,
38.478115651989356
] | 38.365123
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 10)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while ((counter++) < 10)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while ((counter++) < 10)
{
INVARIANT_MARKER_3();
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;
}
|
hard
|
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
|
[
4.927954914979637,
4.675865898025222,
4.994441560993437
] | 4.927955
|
void *malloc(unsigned int size);
int N;
int main()
{
N = (int) rand();
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++)
{
INVARIANT_MARKER_1();
sum[0] = sum[0] + 1;
}
for (i = 0; i < N; i++)
{
INVARIANT_MARKER_2();
a[i] = sum[0] % N;
}
for (i = 0; i < N; i++)
{
INVARIANT_MARKER_3();
assert(a[i] == 1);
}
return 1;
}
|
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;
long long x;
long long y;
long long 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
|
[
5.6473826200235635,
6.1227695340057835,
5.456660235009622
] | 5.647383
|
int counter = 0;
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while ((counter++) < 2)
{
INVARIANT_MARKER_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;
}
|
easy
|
51
|
hard-u_valuebound1_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-u.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;
unsigned int 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) {
__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;
unsigned int B;
unsigned int r;
unsigned int d;
unsigned int p;
unsigned int 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)
{
;
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
|
[
143.96894136897754,
46.93078572599916,
163.2082892319886
] | 143.968941
|
int main()
{
unsigned int A;
unsigned int B;
unsigned int r;
unsigned int d;
unsigned int p;
unsigned int q;
A = (unsigned int) rand();
assume((A >= 0) && (A <= 1));
B = (unsigned int) rand();
assume((B >= 0) && (B <= 1));
assume(B >= 1);
r = A;
d = B;
p = 1;
q = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(r >= d))
{
break;
}
d = 2 * d;
p = 2 * p;
}
while (1)
{
INVARIANT_MARKER_2();
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;
}
|
hard
|
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
|
[
4.944600378978066,
4.648448046005797,
5.108914162032306
] | 4.9446
|
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 ((int) rand())
{
INVARIANT_MARKER_1();
item = malloc(sizeof(SLL));
item->next = NULL;
if ((int) rand())
{
item->data = 0;
}
else
if ((int) rand())
{
item->data = 1;
}
else
{
item->data = 2;
}
bcki = bucket;
assert(item != NULL);
while (bcki->data != item->data)
{
INVARIANT_MARKER_2();
bcki = bcki->next;
}
if (bcki->list == NULL)
{
bcki->list = item;
}
else
{
itr = bcki->list;
while (itr->next != NULL)
{
INVARIANT_MARKER_3();
itr = itr->next;
}
itr->next = item;
}
}
bcki = bucket;
while (bcki != NULL)
{
INVARIANT_MARKER_4();
item = bcki->list;
bcki->list = NULL;
while (item != NULL)
{
INVARIANT_MARKER_5();
itr = item;
item = item->next;
free(itr);
}
bucket = bcki;
bcki = bcki->next;
free(bucket);
bucket = NULL;
}
return 0;
}
|
easy
|
53
|
diamond_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", "diamond_1-1.c", 3, "reach_error"); }
extern unsigned int __VERIFIER_nondet_uint(void);
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR : {
reach_error();
abort();
}
}
return;
}
int main(void) {
unsigned int x = 0;
unsigned int y = __VERIFIER_nondet_uint();
while (x < 99) {
if (y % 2 == 0) {
x += 2;
} else {
x++;
}
}
__VERIFIER_assert((x % 2) == (y % 2));
}
|
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } }
void assume(int cond) { if (!cond) { abort(); } }
int main(void)
{
unsigned int x = 0;
unsigned int y = __VERIFIER_nondet_uint();
while (x < 99)
{
;
if ((y % 2) == 0)
{
x += 2;
}
else
{
x++;
}
}
assert((x % 2) == (y % 2));
}
|
TRUE
|
[
15.095539961999748,
15.216394267976284,
15.502282989036757
] | 15.216394
|
int main(void)
{
unsigned int x = 0;
unsigned int y = (unsigned int) rand();
while (x < 99)
{
INVARIANT_MARKER_1();
if ((y % 2) == 0)
{
x += 2;
}
else
{
x++;
}
}
assert((x % 2) == (y % 2));
}
|
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;
long long s;
long long 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
|
[
4.936381197010633,
5.234459706989583,
4.746365169994533
] | 4.936381
|
int main()
{
int n;
long long a;
long long s;
long long t;
n = (int) rand();
assume((n >= 0) && (n <= 50));
a = 0;
s = 1;
t = 1;
while (1)
{
INVARIANT_MARKER_1();
if (!(s <= n))
{
break;
}
a = a + 1;
t = t + 2;
s = s + t;
}
assert(s == ((a + 1) * (a + 1)));
return 0;
}
|
easy
|
55
|
freire2_valuebound10_6.c
|
/* Algorithm for finding the closet integer to cubic root
* more details, see : http://www.pedrofreire.com/sqrt/sqrt1.en.html
Note: for some reason using cpa was able to disprove these
cpa.sh -kInduction -setprop solver.solver=z3 freire2.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", "freire2.c", 10, "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 r;
double a, x, s;
a = __VERIFIER_nondet_double();
assume_abort_if_not(a >= 0 && a <= 10);
x = a;
s = 3.25;
r = 1;
while (1) {
if (!(x - s > 0.0)) {
break;
}
x = x - s;
s = s + 6 * r + 3;
r = r + 1;
}
__VERIFIER_assert((int)(8 * r * s - 24 * a + 16 * r - 12 * s + 24 * x - 3 == 0));
return 0;
}
|
void assert(int cond) { if (!(cond)) { ERROR : { reach_error(); abort(); } } }
void assume(int cond) { if (!cond) { abort(); } }
int main()
{
int r;
double a;
double x;
double s;
a = __VERIFIER_nondet_double();
assume((a >= 0) && (a <= 10));
x = a;
s = 3.25;
r = 1;
while (1)
{
;
if (!((x - s) > 0.0))
{
break;
}
x = x - s;
s = (s + (6 * r)) + 3;
r = r + 1;
}
assert((int) ((((((((8 * r) * s) - (24 * a)) + (16 * r)) - (12 * s)) + (24 * x)) - 3) == 0));
return 0;
}
|
FALSE
|
[
21.45497120602522,
22.766893885971513,
21.677408478979487
] | 21.677408
|
int main()
{
int r;
double a;
double x;
double s;
a = (double) rand();
assume((a >= 0) && (a <= 10));
x = a;
s = 3.25;
r = 1;
while (1)
{
INVARIANT_MARKER_1();
if (!((x - s) > 0.0))
{
break;
}
x = x - s;
s = (s + (6 * r)) + 3;
r = r + 1;
}
assert((int) ((((((((8 * r) * s) - (24 * a)) + (16 * r)) - (12 * s)) + (24 * x)) - 3) == 0));
return 0;
}
|
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;
int y;
long long q;
long long r;
long long a;
long long 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
|
[
4.875113187008537,
4.623701954027638,
4.936187904968392
] | 4.875113
|
int counter = 0;
int main()
{
int x;
int y;
long long q;
long long r;
long long a;
long long b;
x = (int) rand();
y = (int) rand();
assume(y >= 1);
q = 0;
r = x;
a = 0;
b = 0;
while ((counter++) < 10)
{
INVARIANT_MARKER_1();
if (!(r >= y))
{
break;
}
a = 1;
b = y;
while ((counter++) < 10)
{
INVARIANT_MARKER_2();
assert(r >= 0);
if (!(r >= (2 * b)))
{
break;
}
a = 2 * a;
b = 2 * b;
}
r = r - b;
q = q + a;
}
return 0;
}
|
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;
long long x;
long long 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
|
[
5.652972889016382,
5.894824556016829,
5.343581151973922
] | 5.652973
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
assume((k >= 0) && (k <= 20));
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_1();
if (!(c < k))
{
break;
}
c = c + 1;
y = y + 1;
x = ((y * y) * y) + x;
}
assert(((k * y) - (y * y)) == 0);
return 0;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long 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;
long long k;
c = a;
k = 0;
while (1)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long 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
|
[
10.097280160000082,
9.855425876041409,
10.002822408976499
] | 10.002822
|
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
assume((x >= 0) && (x <= 1));
y = (int) rand();
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)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while (1)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while (1)
{
INVARIANT_MARKER_3();
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;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long 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;
long long k;
c = a;
k = 0;
while ((counter++) < 10)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long 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
|
[
13.651534979988355,
13.849182462960016,
13.90505934302928
] | 13.849182
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 10)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while ((counter++) < 10)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while ((counter++) < 10)
{
INVARIANT_MARKER_3();
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;
}
|
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;
long long x;
long long 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
|
[
4.855527724022977,
4.5386014800169505,
5.347145535983145
] | 4.855528
|
int main()
{
int k;
long long y;
long long x;
long long c;
k = (int) rand();
assume((k >= 0) && (k <= 10));
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_1();
assert((((y * y) - (2 * x)) + y) == 0);
if (!(c < k))
{
break;
}
c = c + 1;
y = y + 1;
x = y + x;
}
return 0;
}
|
easy
|
61
|
prod4br-ll_unwindbound5_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 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++ < 5) {
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 counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
x = __VERIFIER_nondet_int();
y = __VERIFIER_nondet_int();
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
while ((counter++) < 5)
{
;
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;
}
|
FALSE
|
[
31.40467155002989,
31.45342440297827,
31.651573865965474
] | 31.453424
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
x = (int) rand();
y = (int) rand();
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
while ((counter++) < 5)
{
INVARIANT_MARKER_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;
}
|
hard
|
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
|
[
5.013385355006903,
4.816026846005116,
5.131091438990552
] | 5.013385
|
unsigned int f(unsigned int z)
{
return z + 2;
}
int main(void)
{
unsigned int x = 0;
while (x < 0x0fffffff)
{
INVARIANT_MARKER_1();
x = f(x);
}
assert(!(x % 2));
}
|
easy
|
63
|
cohencu-ll_valuebound10_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 <= 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(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;
long long x;
long long y;
long long 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((((((((2 * y) * y) - ((3 * x) * z)) - (18 * x)) - (10 * y)) + (3 * z)) - 10) == 0);
return 0;
}
|
TRUE
|
[
41.15077130001737,
40.72754660400096,
41.155421997013036
] | 41.150771
|
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
assume((a >= 0) && (a <= 10));
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
hard
|
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;
int n;
int x;
int y;
int 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
|
[
5.36300981498789,
5.066456013999414,
5.29667468596017
] | 5.296675
|
int main()
{
int a;
int n;
int x;
int y;
int z;
a = (int) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while (1)
{
INVARIANT_MARKER_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;
}
|
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;
long long x;
long long y;
long long 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
|
[
23.648402696999256,
23.314091765030753,
23.08981750899693
] | 23.314092
|
int counter = 0;
int main()
{
short a;
long long n;
long long x;
long long y;
long long z;
a = (ushort) rand();
n = 0;
x = 0;
y = 1;
z = 6;
while ((counter++) < 5)
{
INVARIANT_MARKER_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;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long 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;
long long k;
c = a;
k = 0;
while ((counter++) < 5)
{
;
if (!(c >= b))
{
break;
}
long long d;
long long 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
|
[
5.358430303982459,
5.454187760013156,
5.761681288015097
] | 5.454188
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
x = (int) rand();
y = (int) rand();
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while ((counter++) < 5)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
long long c;
long long k;
c = a;
k = 0;
while ((counter++) < 5)
{
INVARIANT_MARKER_2();
if (!(c >= b))
{
break;
}
long long d;
long long v;
d = 1;
v = b;
while ((counter++) < 5)
{
INVARIANT_MARKER_3();
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;
}
|
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;
long long x;
long long 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
|
[
5.135284492047504,
5.251483453961555,
4.936219361028634
] | 5.135284
|
int main()
{
short k;
long long y;
long long x;
long long c;
k = (short) rand();
assume((k >= 0) && (k <= 1));
y = 0;
x = 0;
c = 0;
while (1)
{
INVARIANT_MARKER_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;
}
|
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
|
[
4.641721007996239,
5.060836253978778,
4.509698898007628
] | 4.641721
|
int main()
{
int x = (int) rand();
int y = (int) rand();
int z = (int) rand();
if (!(((y > 0) || (x > 0)) || (z > 0)))
{
return 0;
}
while ((bool) rand())
{
INVARIANT_MARKER_1();
if (x > 0)
{
x++;
}
if (y > 0)
{
y++;
}
else
{
z++;
}
}
assert(((x > 0) || (y > 0)) || (z > 0));
return 0;
}
|
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;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
long long c;
long long k;
long long xy;
long long 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
|
[
7.904868733021431,
8.159748744976241,
8.231844606983941
] | 8.159749
|
int counter = 0;
int main()
{
int x;
int y;
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
long long c;
long long k;
long long xy;
long long yy;
x = (int) rand();
y = (int) rand();
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)
{
INVARIANT_MARKER_1();
if (!(b != 0))
{
break;
}
c = a;
k = 0;
while ((counter++) < 5)
{
INVARIANT_MARKER_2();
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;
}
|
easy
|
70
|
egcd-ll_valuebound5_7.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 <= 5);
y = __VERIFIER_nondet_int();
assume_abort_if_not(y >= 0 && y <= 5);
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 * x + s * y - b == 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;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = __VERIFIER_nondet_int();
assume((x >= 0) && (x <= 5));
y = __VERIFIER_nondet_int();
assume((y >= 0) && (y <= 5));
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 * x) + (s * y)) - b) == 0);
return 0;
}
|
TRUE
|
[
16.865965772012714,
17.11991604999639,
17.11201445403276
] | 17.112014
|
int main()
{
long long a;
long long b;
long long p;
long long q;
long long r;
long long s;
int x;
int y;
x = (int) rand();
assume((x >= 0) && (x <= 5));
y = (int) rand();
assume((y >= 0) && (y <= 5));
assume(x >= 1);
assume(y >= 1);
a = x;
b = y;
p = 1;
q = 0;
r = 0;
s = 1;
while (1)
{
INVARIANT_MARKER_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 * x) + (s * y)) - b) == 0);
return 0;
}
|
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;
int y;
long long q;
long long r;
long long a;
long long 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
|
[
7.93403100798605,
7.852409225015435,
8.094408389995806
] | 7.934031
|
int counter = 0;
int main()
{
int x;
int y;
long long q;
long long r;
long long a;
long long b;
x = (int) rand();
y = (int) rand();
assume(y >= 1);
q = 0;
r = x;
a = 0;
b = 0;
while ((counter++) < 5)
{
INVARIANT_MARKER_1();
if (!(r >= y))
{
break;
}
a = 1;
b = y;
while ((counter++) < 5)
{
INVARIANT_MARKER_2();
assert(x == ((q * y) + r));
if (!(r >= (2 * b)))
{
break;
}
a = 2 * a;
b = 2 * b;
}
r = r - b;
q = q + a;
}
return 0;
}
|
easy
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 67