Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit 25d4263

Browse files
authored
Merge pull request #1156 from MartinSpiessl/zilu
Add benchmarks from zilu paper
2 parents 11a5602 + 3506183 commit 25d4263

File tree

163 files changed

+3755
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+3755
-0
lines changed

c/ReachSafety-Loops.set

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ loop-industry-pattern/*.yml
99
loops-crafted-1/*.yml
1010
loop-invariants/*.yml
1111
loop-simple/*.yml
12+
loop-zilu/*.yml
1213
verifythis/duplets.yml
1314
verifythis/elimination_max.yml
1415
verifythis/lcp.yml

c/loop-zilu/LICENSE.GPLv2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE.GPLv2.txt

c/loop-zilu/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LEVEL := ../
2+
3+
include $(LEVEL)/Makefile.config

c/loop-zilu/README.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
These tasks were generated by Martin Spiessl
2+
from information in the tool repository of zilu,
3+
a tool for invariant generation throug selective sampling,
4+
which is described in the following publication:
5+
6+
Li, J., Sun, J., Li, L., Le, Q. L., & Lin, S. W. (2017, October).
7+
Automatic loop-invariant generation anc refinement through selective sampling.
8+
In 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE) (pp. 782-792). IEEE.
9+
10+
These tasks represent the 53 benchmarks
11+
that are listed in table 1 in this publication.
12+
13+
The original repository for zilu was at (according to the paper):
14+
https://github.com/lijiaying/zilu
15+
16+
It seems this repository was deleted or set to private.
17+
The original repository was published unter GPL-2.0,
18+
a copy I made can be found at:
19+
https://github.com/MartinSpiessl/zilu
20+
21+
So I supply these tasks unter GPL-2.0 as well.
22+
23+
The paper mentions that the tasks were collected
24+
from various papers/sources, one of them being SV-COMP.
25+
It is not easy to identify which tasks were taken from which source,
26+
and the authors state many of the SV-COMP tasks had to be excluded anyway
27+
because they were too complicated/ out of scope.
28+
Also the tasks are written down in a simplified format
29+
in the zilu repository in special files with the extension "cfg".
30+
31+
I did the translation into SV-COMP compliant tasks
32+
myself with a small python script.
33+
Due to these 2 transformations,
34+
I do not believe that the tasks contain
35+
any copyrightable material anymore
36+
from the publications they were originally taken from.
37+
Also the tasks are very simple,
38+
so they will probably fall below the
39+
threshold of originality anyway.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include <assert.h>
2+
void reach_error(void) {assert(0);}
3+
4+
void __VERIFIER_assert(int cond) {
5+
if (!cond) {
6+
reach_error();
7+
}
8+
}
9+
10+
/* 01.cfg:
11+
names=x y
12+
beforeloop=
13+
beforeloopinit=
14+
precondition=x==1 && y==1
15+
loopcondition=
16+
loop=x=x+y; y=x;
17+
postcondition=y>=1
18+
afterloop=
19+
learners= conj
20+
*/
21+
int main() {
22+
int x = __VERIFIER_nondet_int();
23+
int y = __VERIFIER_nondet_int();
24+
25+
if (!(x==1 && y==1)) return 0;
26+
while (__VERIFIER_nondet_bool()) {
27+
x=x+y;
28+
y=x;
29+
}
30+
__VERIFIER_assert(y>=1);
31+
return 0;
32+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
extern void __assert_fail (const char *__assertion, const char *__file,
3+
unsigned int __line, const char *__function)
4+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
5+
extern void __assert_perror_fail (int __errnum, const char *__file,
6+
unsigned int __line, const char *__function)
7+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
8+
extern void __assert (const char *__assertion, const char *__file, int __line)
9+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
10+
11+
void reach_error(void) {((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "benchmark01_conjunctive.c", 2, __extension__ __PRETTY_FUNCTION__); }));}
12+
void __VERIFIER_assert(int cond) {
13+
if (!cond) {
14+
reach_error();
15+
}
16+
}
17+
int main() {
18+
int x = __VERIFIER_nondet_int();
19+
int y = __VERIFIER_nondet_int();
20+
if (!(x==1 && y==1)) return 0;
21+
while (__VERIFIER_nondet_bool()) {
22+
x=x+y;
23+
y=x;
24+
}
25+
__VERIFIER_assert(y>=1);
26+
return 0;
27+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
format_version: '2.0'
2+
3+
input_files: 'benchmark01_conjunctive.i'
4+
5+
properties:
6+
- property_file: ../properties/unreach-call.prp
7+
expected_verdict: true
8+
9+
options:
10+
language: C
11+
data_model: ILP32

c/loop-zilu/benchmark02_linear.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include <assert.h>
2+
void reach_error(void) {assert(0);}
3+
4+
void __VERIFIER_assert(int cond) {
5+
if (!cond) {
6+
reach_error();
7+
}
8+
}
9+
10+
/* 02.cfg:
11+
names=l
12+
beforeloop= int n; int i;
13+
beforeloopinit= i = l;
14+
precondition= l>0
15+
loopcondition= i < n
16+
loop=i++;
17+
postcondition=l>=1
18+
afterloop=
19+
learners= linear
20+
*/
21+
int main() {
22+
int n = __VERIFIER_nondet_int();
23+
int i = __VERIFIER_nondet_int();
24+
int l = __VERIFIER_nondet_int();
25+
i = l;
26+
if (!(l>0)) return 0;
27+
while (i < n) {
28+
i++;
29+
}
30+
__VERIFIER_assert(l>=1);
31+
return 0;
32+
}

c/loop-zilu/benchmark02_linear.i

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
extern void __assert_fail (const char *__assertion, const char *__file,
3+
unsigned int __line, const char *__function)
4+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
5+
extern void __assert_perror_fail (int __errnum, const char *__file,
6+
unsigned int __line, const char *__function)
7+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
8+
extern void __assert (const char *__assertion, const char *__file, int __line)
9+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
10+
11+
void reach_error(void) {((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "benchmark02_linear.c", 2, __extension__ __PRETTY_FUNCTION__); }));}
12+
void __VERIFIER_assert(int cond) {
13+
if (!cond) {
14+
reach_error();
15+
}
16+
}
17+
int main() {
18+
int n = __VERIFIER_nondet_int();
19+
int i = __VERIFIER_nondet_int();
20+
int l = __VERIFIER_nondet_int();
21+
i = l;
22+
if (!(l>0)) return 0;
23+
while (i < n) {
24+
i++;
25+
}
26+
__VERIFIER_assert(l>=1);
27+
return 0;
28+
}

c/loop-zilu/benchmark02_linear.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
format_version: '2.0'
2+
3+
input_files: 'benchmark02_linear.i'
4+
5+
properties:
6+
- property_file: ../properties/unreach-call.prp
7+
expected_verdict: true
8+
9+
options:
10+
language: C
11+
data_model: ILP32

0 commit comments

Comments
 (0)