Skip to content

Commit e31c82d

Browse files
committed
Convert 36-apron/52-queuesize.t to invariant_set
1 parent 6032ec7 commit e31c82d

File tree

2 files changed

+223
-172
lines changed

2 files changed

+223
-172
lines changed

tests/regression/36-apron/52-queuesize.t

Lines changed: 153 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Without diff-box:
44

5-
$ goblint --enable witness.yaml.enabled --set witness.yaml.entry-types '["location_invariant"]' --disable witness.invariant.other --disable ana.base.invariant.enabled --set ana.relation.privatization mutex-meet --set ana.activated[+] apron --enable ana.sv-comp.functions --set ana.apron.domain polyhedra --enable ana.relation.invariant.one-var --disable ana.apron.invariant.diff-box 52-queuesize.c
5+
$ goblint --enable witness.yaml.enabled --set witness.yaml.invariant-types '["location_invariant"]' --disable witness.invariant.other --disable ana.base.invariant.enabled --set ana.relation.privatization mutex-meet --set ana.activated[+] apron --enable ana.sv-comp.functions --set ana.apron.domain polyhedra --enable ana.relation.invariant.one-var --disable ana.apron.invariant.diff-box 52-queuesize.c
66
[Success][Assert] Assertion "free >= 0" will succeed (52-queuesize.c:67:5-67:31)
77
[Success][Assert] Assertion "free <= capacity" will succeed (52-queuesize.c:68:5-68:38)
88
[Success][Assert] Assertion "used >= 0" will succeed (52-queuesize.c:69:5-69:31)
@@ -40,98 +40,92 @@ Without diff-box:
4040
location invariants: 8
4141
loop invariants: 0
4242
flow-insensitive invariants: 0
43-
total generation entries: 8
43+
total generation entries: 1
4444
[Info][Race] Memory locations race summary:
4545
safe: 3
4646
vulnerable: 0
4747
unsafe: 0
4848
total memory locations: 3
4949

5050
$ yamlWitnessStrip < witness.yml | tee witness-disable-diff-box.yml
51-
- entry_type: location_invariant
52-
location:
53-
file_name: 52-queuesize.c
54-
line: 36
55-
column: 3
56-
function: push
57-
location_invariant:
58-
string: 2147483647LL >= (long long )capacity
59-
type: assertion
60-
format: C
61-
- entry_type: location_invariant
62-
location:
63-
file_name: 52-queuesize.c
64-
line: 36
65-
column: 3
66-
function: push
67-
location_invariant:
68-
string: (long long )used + (long long )free == (long long )capacity
69-
type: assertion
70-
format: C
71-
- entry_type: location_invariant
72-
location:
73-
file_name: 52-queuesize.c
74-
line: 36
75-
column: 3
76-
function: push
77-
location_invariant:
78-
string: (long long )free >= 0LL
79-
type: assertion
80-
format: C
81-
- entry_type: location_invariant
82-
location:
83-
file_name: 52-queuesize.c
84-
line: 36
85-
column: 3
86-
function: push
87-
location_invariant:
88-
string: (long long )capacity >= (long long )free
89-
type: assertion
90-
format: C
91-
- entry_type: location_invariant
92-
location:
93-
file_name: 52-queuesize.c
94-
line: 15
95-
column: 3
96-
function: pop
97-
location_invariant:
98-
string: 2147483647LL >= (long long )capacity
99-
type: assertion
100-
format: C
101-
- entry_type: location_invariant
102-
location:
103-
file_name: 52-queuesize.c
104-
line: 15
105-
column: 3
106-
function: pop
107-
location_invariant:
108-
string: (long long )used + (long long )free == (long long )capacity
109-
type: assertion
110-
format: C
111-
- entry_type: location_invariant
112-
location:
113-
file_name: 52-queuesize.c
114-
line: 15
115-
column: 3
116-
function: pop
117-
location_invariant:
118-
string: (long long )free >= 0LL
119-
type: assertion
120-
format: C
121-
- entry_type: location_invariant
122-
location:
123-
file_name: 52-queuesize.c
124-
line: 15
125-
column: 3
126-
function: pop
127-
location_invariant:
128-
string: (long long )capacity >= (long long )free
129-
type: assertion
130-
format: C
51+
- entry_type: invariant_set
52+
content:
53+
- invariant:
54+
type: location_invariant
55+
location:
56+
file_name: 52-queuesize.c
57+
line: 15
58+
column: 3
59+
function: pop
60+
value: (long long )capacity >= (long long )free
61+
format: c_expression
62+
- invariant:
63+
type: location_invariant
64+
location:
65+
file_name: 52-queuesize.c
66+
line: 15
67+
column: 3
68+
function: pop
69+
value: (long long )free >= 0LL
70+
format: c_expression
71+
- invariant:
72+
type: location_invariant
73+
location:
74+
file_name: 52-queuesize.c
75+
line: 15
76+
column: 3
77+
function: pop
78+
value: (long long )used + (long long )free == (long long )capacity
79+
format: c_expression
80+
- invariant:
81+
type: location_invariant
82+
location:
83+
file_name: 52-queuesize.c
84+
line: 15
85+
column: 3
86+
function: pop
87+
value: 2147483647LL >= (long long )capacity
88+
format: c_expression
89+
- invariant:
90+
type: location_invariant
91+
location:
92+
file_name: 52-queuesize.c
93+
line: 36
94+
column: 3
95+
function: push
96+
value: (long long )capacity >= (long long )free
97+
format: c_expression
98+
- invariant:
99+
type: location_invariant
100+
location:
101+
file_name: 52-queuesize.c
102+
line: 36
103+
column: 3
104+
function: push
105+
value: (long long )free >= 0LL
106+
format: c_expression
107+
- invariant:
108+
type: location_invariant
109+
location:
110+
file_name: 52-queuesize.c
111+
line: 36
112+
column: 3
113+
function: push
114+
value: (long long )used + (long long )free == (long long )capacity
115+
format: c_expression
116+
- invariant:
117+
type: location_invariant
118+
location:
119+
file_name: 52-queuesize.c
120+
line: 36
121+
column: 3
122+
function: push
123+
value: 2147483647LL >= (long long )capacity
124+
format: c_expression
131125

132126
With diff-box:
133127

134-
$ goblint --enable witness.yaml.enabled --set witness.yaml.entry-types '["location_invariant"]' --disable witness.invariant.other --disable ana.base.invariant.enabled --set ana.relation.privatization mutex-meet --set ana.activated[+] apron --enable ana.sv-comp.functions --set ana.apron.domain polyhedra --enable ana.relation.invariant.one-var --enable ana.apron.invariant.diff-box 52-queuesize.c
128+
$ goblint --enable witness.yaml.enabled --set witness.yaml.invariant-types '["location_invariant"]' --disable witness.invariant.other --disable ana.base.invariant.enabled --set ana.relation.privatization mutex-meet --set ana.activated[+] apron --enable ana.sv-comp.functions --set ana.apron.domain polyhedra --enable ana.relation.invariant.one-var --enable ana.apron.invariant.diff-box 52-queuesize.c
135129
[Success][Assert] Assertion "free >= 0" will succeed (52-queuesize.c:67:5-67:31)
136130
[Success][Assert] Assertion "free <= capacity" will succeed (52-queuesize.c:68:5-68:38)
137131
[Success][Assert] Assertion "used >= 0" will succeed (52-queuesize.c:69:5-69:31)
@@ -169,99 +163,91 @@ With diff-box:
169163
location invariants: 6
170164
loop invariants: 0
171165
flow-insensitive invariants: 0
172-
total generation entries: 6
166+
total generation entries: 1
173167
[Info][Race] Memory locations race summary:
174168
safe: 3
175169
vulnerable: 0
176170
unsafe: 0
177171
total memory locations: 3
178172

179173
$ yamlWitnessStrip < witness.yml | tee witness-enable-diff-box.yml
180-
- entry_type: location_invariant
181-
location:
182-
file_name: 52-queuesize.c
183-
line: 36
184-
column: 3
185-
function: push
186-
location_invariant:
187-
string: (long long )used + (long long )free == (long long )capacity
188-
type: assertion
189-
format: C
190-
- entry_type: location_invariant
191-
location:
192-
file_name: 52-queuesize.c
193-
line: 36
194-
column: 3
195-
function: push
196-
location_invariant:
197-
string: (long long )free >= 0LL
198-
type: assertion
199-
format: C
200-
- entry_type: location_invariant
201-
location:
202-
file_name: 52-queuesize.c
203-
line: 36
204-
column: 3
205-
function: push
206-
location_invariant:
207-
string: (long long )capacity >= (long long )free
208-
type: assertion
209-
format: C
210-
- entry_type: location_invariant
211-
location:
212-
file_name: 52-queuesize.c
213-
line: 15
214-
column: 3
215-
function: pop
216-
location_invariant:
217-
string: (long long )used + (long long )free == (long long )capacity
218-
type: assertion
219-
format: C
220-
- entry_type: location_invariant
221-
location:
222-
file_name: 52-queuesize.c
223-
line: 15
224-
column: 3
225-
function: pop
226-
location_invariant:
227-
string: (long long )free >= 0LL
228-
type: assertion
229-
format: C
230-
- entry_type: location_invariant
231-
location:
232-
file_name: 52-queuesize.c
233-
line: 15
234-
column: 3
235-
function: pop
236-
location_invariant:
237-
string: (long long )capacity >= (long long )free
238-
type: assertion
239-
format: C
174+
- entry_type: invariant_set
175+
content:
176+
- invariant:
177+
type: location_invariant
178+
location:
179+
file_name: 52-queuesize.c
180+
line: 15
181+
column: 3
182+
function: pop
183+
value: (long long )capacity >= (long long )free
184+
format: c_expression
185+
- invariant:
186+
type: location_invariant
187+
location:
188+
file_name: 52-queuesize.c
189+
line: 15
190+
column: 3
191+
function: pop
192+
value: (long long )free >= 0LL
193+
format: c_expression
194+
- invariant:
195+
type: location_invariant
196+
location:
197+
file_name: 52-queuesize.c
198+
line: 15
199+
column: 3
200+
function: pop
201+
value: (long long )used + (long long )free == (long long )capacity
202+
format: c_expression
203+
- invariant:
204+
type: location_invariant
205+
location:
206+
file_name: 52-queuesize.c
207+
line: 36
208+
column: 3
209+
function: push
210+
value: (long long )capacity >= (long long )free
211+
format: c_expression
212+
- invariant:
213+
type: location_invariant
214+
location:
215+
file_name: 52-queuesize.c
216+
line: 36
217+
column: 3
218+
function: push
219+
value: (long long )free >= 0LL
220+
format: c_expression
221+
- invariant:
222+
type: location_invariant
223+
location:
224+
file_name: 52-queuesize.c
225+
line: 36
226+
column: 3
227+
function: push
228+
value: (long long )used + (long long )free == (long long )capacity
229+
format: c_expression
240230

241231
Compare witnesses:
242232

243233
$ yamlWitnessStripDiff witness-disable-diff-box.yml witness-enable-diff-box.yml
244-
# Left-only entries:
245-
- entry_type: location_invariant
246-
location:
247-
file_name: 52-queuesize.c
248-
line: 36
249-
column: 3
250-
function: push
251-
location_invariant:
252-
string: 2147483647LL >= (long long )capacity
253-
type: assertion
254-
format: C
255-
- entry_type: location_invariant
256-
location:
257-
file_name: 52-queuesize.c
258-
line: 15
259-
column: 3
260-
function: pop
261-
location_invariant:
262-
string: 2147483647LL >= (long long )capacity
263-
type: assertion
264-
format: C
234+
# Left-only invariants:
235+
- invariant:
236+
type: location_invariant
237+
location:
238+
file_name: 52-queuesize.c
239+
line: 36
240+
column: 3
241+
function: push
242+
value: 2147483647LL >= (long long )capacity
243+
format: c_expression
244+
- invariant:
245+
type: location_invariant
246+
location:
247+
file_name: 52-queuesize.c
248+
line: 15
249+
column: 3
250+
function: pop
251+
value: 2147483647LL >= (long long )capacity
252+
format: c_expression
265253
---
266-
# Right-only entries:
267-
[]

0 commit comments

Comments
 (0)