Wonda
Collection
Models and datasets for loop invariant generation task • 23 items • Updated
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 3.77 601 | 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() { __asse... | 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(... | TRUE | [
86.4,
49.95,
50.86
] | 50.86 | 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;
... | 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 *... | 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;
... | TRUE | [
4.48,
4.38,
4.5
] | 4.48 | 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))
{
bre... | 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(v... | 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 = __... | TRUE | [
297.3,
294.78,
297.85
] | 297.3 | 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 >=... | 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__((__nothr... | 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... | FALSE | [
4.1,
4.02,
4.28
] | 4.1 | 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_... | 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__));
v... | 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;
w... | TRUE | [
31.02,
31.1,
31.48
] | 31.1 | 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 + ... | 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__));
v... | 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;
whi... | TRUE | [
4.62,
4.9,
4.44
] | 4.62 | 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... | 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"); ... | 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))
{
... | TIMEOUT | [
601.11,
601.11,
601.11
] | 601.11 | 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) ... | 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 cha... | 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... | FALSE | [
32.66,
29.93,
30.73
] | 30.73 | 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))
{
... | hard |
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... | 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) * ((... | TRUE | [
7.23,
7.15,
7.03
] | 7.15 | 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... | 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 in... | 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 = ... | TRUE | [
5.54,
5.28,
5.63
] | 5.54 | 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;
w... | 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__));
v... | 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;
wh... | TRUE | [
4.62,
4.2,
4.45
] | 4.45 | 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... | 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);
v... | 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))
... | TRUE | [
4.79,
5.23,
4.89
] | 4.89 | 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));... | 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(v... | 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_nonde... | TRUE | [
4.62,
5.12,
5.13
] | 5.12 | 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_... | 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", "har... | 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)
{
... | TRUE | [
25.7,
30.75,
25.96
] | 25.96 | 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_MARKE... | 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... | 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 | [
5.8,
5.43,
5.44
] | 5.44 | 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);
... | 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 (... | TRUE | [
4.71,
4.64,
4.73
] | 4.71 | 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) - (... | 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__));
v... | 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;
wh... | TRUE | [
4.2,
4.8,
4.3
] | 4.3 | 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... | 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() { __asse... | 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;
wh... | TRUE | [
7.19,
7.7,
7.24
] | 7.24 | 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... | 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 in... | 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 = _... | TRUE | [
16.86,
16.89,
17.11
] | 16.89 | 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;
whi... | 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 in... | 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 =... | TRUE | [
9.88,
9.94,
10.14
] | 9.94 | 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;
... | 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... | 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();
ass... | TRUE | [
4.85,
4.46,
4.33
] | 4.46 | 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) * ... | 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", "har... | 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_n... | TRUE | [
6.09,
5.98,
6.06
] | 6.06 | 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_MARKE... | 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
loopcond... | 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;
}
whil... | TRUE | [
4.22,
4.42,
4.95
] | 4.42 | 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) {
... | 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(in... | TIMEOUT | [
601.11,
601.11,
601.11
] | 601.11 | 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... | 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__));
v... | 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;
whi... | TRUE | [
4.52,
4.72,
4.67
] | 4.67 | 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;
}
... | 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() { __asse... | 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++)... | FALSE | [
6.02,
6.36,
6.38
] | 6.36 | 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;... | 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",... | 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 >=... | FALSE | [
4,
3.98,
4.52
] | 4 | 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)
{
... | 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);
v... | 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;
... | TRUE | [
4.83,
4.68,
4.63
] | 4.68 | 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 abo... | 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;
... | TRUE | [
18.98,
18.69,
18.55
] | 18.69 | 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 + ((... | 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... | 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))
{
retu... | TRUE | [
119.31,
112.03,
147.67
] | 119.31 | 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_MAR... | 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__));
v... | 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++)... | TRUE | [
4.52,
4.39,
4.71
] | 4.52 | 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 ... | 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)) {
... | 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)
... | TRUE | [
4.32,
4.44,
3.72
] | 4.32 | 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... | 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 in... | 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_nonde... | TRUE | [
5.23,
4.78,
5.35
] | 5.23 | 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_... | 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", ... | 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) && ... | TRUE | [
4.64,
5.08,
4.62
] | 4.64 | 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... | 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__));
v... | 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 ... | TRUE | [
4.19,
3.87,
4.18
] | 4.18 | 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 in... | 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_nonde... | TRUE | [
5.14,
5.24,
4.88
] | 5.14 | 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_... | 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_abor... | 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(... | TIMEOUT | [
601.11,
601.11,
601.11
] | 601.11 | 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 - ... | 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"); ... | 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)
{... | TRUE | [
40.91,
40.22,
41.06
] | 40.91 | 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_MARK... | 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 in... | 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_nonde... | FALSE | [
12.75,
12.92,
13.14
] | 12.92 | 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_... | 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 __VERI... | 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 ... | TRUE | [
5.13,
5.4,
5.22
] | 5.22 | 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_MARK... | 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 i... | 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 = _... | TRUE | [
29.03,
28.38,
28.81
] | 28.81 | 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;
whi... | 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__));
v... | 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;
wh... | TRUE | [
4.55,
4.2,
4.09
] | 4.2 | 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... | 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(vo... | 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_nonde... | FALSE | [
8.75,
8.67,
8.88
] | 8.75 | 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... | 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__));
v... | 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;
w... | TRUE | [
7.44,
7.58,
7.6
] | 7.58 | 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 + ... | 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 = NUL... | 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 =... | FALSE | [
3.99,
4.34,
4.34
] | 4.34 | 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();
e... | 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);
... | 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)
{
;
asse... | TRUE | [
4.65,
4.63,
4.76
] | 4.65 | 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;
}... | 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 ... | 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))
{... | TRUE | [
4.63,
4.71,
4.23
] | 4.63 | 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 i... | 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_nonde... | FALSE | [
38.08,
38.7,
37.88
] | 38.08 | 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_... | 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__((__nothr... | 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];
i... | FALSE | [
4.51,
4.46,
4.12
] | 4.46 | 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... | 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__));
v... | 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++)... | FALSE | [
4.83,
5.49,
5.39
] | 5.39 | 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;
... | 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");... | 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 = ... | TRUE | [
137.52,
84.43,
112.25
] | 112.25 | 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)
{
INV... | 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... | 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));
bu... | TRUE | [
4.2,
4.6,
4.38
] | 4.38 | 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... | 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_u... | 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++;
}
... | TRUE | [
15.1,
15.48,
15.54
] | 15.48 | 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"); }
exte... | 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... | TRUE | [
4.35,
4.42,
4.65
] | 4.42 | 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)));
... | 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 cha... | 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 -... | FALSE | [
21.57,
22.43,
22.06
] | 22.06 | 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) ((((((... | 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__((__noretur... | 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... | TRUE | [
4.36,
4.29,
3.95
] | 4.29 | 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 ... | 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);
... | 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 ... | TRUE | [
5.17,
4.74,
4.88
] | 4.88 | 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... | 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 i... | 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 = _... | TRUE | [
7.95,
7.89,
7.88
] | 7.89 | 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;
whi... | 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 i... | 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_nonde... | TRUE | [
12.05,
12.58,
12.97
] | 12.58 | 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_... | 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 ... | 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(... | TRUE | [
4.33,
4.31,
4.37
] | 4.33 | 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;... | 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... | 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... | FALSE | [
32.13,
31.93,
31.95
] | 31.95 | 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;
}
... | 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) {
... | 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 | [
4.66,
4.46,
4.47
] | 4.47 | 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__));
v... | 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;
wh... | TRUE | [
39.57,
39.49,
40.06
] | 39.57 | 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... | 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__));
v... | 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;
}
... | TRUE | [
4.73,
4.24,
4.25
] | 4.25 | 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);... | 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__));
v... | 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++)... | TRUE | [
18.65,
18.76,
18.66
] | 18.66 | 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;
... | 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 i... | 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_nonde... | TRUE | [
4.6,
4.78,
4.59
] | 4.6 | 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... | 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);
... | 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)
{
;
asse... | TRUE | [
4.8,
4.86,
5.14
] | 4.86 | 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;
}... | 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++; els... | 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 (... | TRUE | [
3.77,
3.75,
4.18
] | 3.77 | 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++;
}
}
as... | 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 i... | 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 ... | TRUE | [
6.75,
6.83,
6.51
] | 6.75 | 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;... | 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 in... | 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 = _... | TRUE | [
16.14,
15.53,
16.17
] | 16.14 | 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;
whi... | 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__((__noretur... | 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... | TRUE | [
8.62,
6.96,
6.95
] | 6.96 | 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 =... | easy |
72 | sqrt1-ll_valuebound50_4.c | /* Compute the floor of the square root of a natural number */
extern void abort(void);
extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
void reach_error() { __assert_fail("0", "sqrt1-ll.c", 5, "reach_error"); }
exte... | 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... | TRUE | [
4.7,
4.53,
3.79
] | 4.53 | 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(t == ((2 * a) + 1));
retur... | easy |