Skip to content

Commit 61390c4

Browse files
authored
Merge pull request #1709 from goblint/apron-unassume-no-strengthening
Use naïve unassume for Apron analysis when strengthening disabled
2 parents f99a9f6 + 7cd3743 commit 61390c4

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

src/analyses/apron/relationAnalysis.apron.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,12 @@ struct
740740
in
741741
({ f } : Queries.ask) in
742742
let rel = RD.assert_inv dummyask rel e false (no_overflow ask e_orig) in (* assume *)
743-
let rel = RD.keep_vars rel (List.map RV.local vars) in (* restrict *)
743+
let rel =
744+
if GobConfig.get_bool "ana.apron.strengthening" then
745+
RD.keep_vars rel (List.map RV.local vars) (* restrict *)
746+
else
747+
rel (* naive unassume: will be homogeneous join below *)
748+
in
744749

745750
(* TODO: parallel write_global? *)
746751
let st =
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SKIP PARAM: --set ana.activated[+] apron --set ana.apron.domain interval --set ana.activated[+] unassume --set witness.yaml.unassume 48-apron-unassume-no-strengthening.yml --disable ana.apron.strengthening
2+
#include <goblint.h>
3+
4+
int main() {
5+
int i = 0;
6+
int j;
7+
if (j < 100) {
8+
__goblint_check(i == 0); // UNKNOWN (intentional by unassume)
9+
__goblint_check(i >= 0);
10+
__goblint_check(i < 100);
11+
__goblint_check(j < 100);
12+
}
13+
return 0;
14+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
- entry_type: invariant_set
2+
metadata:
3+
format_version: "2.0"
4+
uuid: 9b19e72a-376d-4c34-80d4-f46020de0c92
5+
creation_time: 2025-03-12T12:53:06Z
6+
producer:
7+
name: Simmo Saan
8+
version: n/a
9+
task:
10+
input_files:
11+
- 48-apron-unassume-no-strengthening.c
12+
input_file_hashes:
13+
48-apron-unassume-no-strengthening.c: 57377f1e739e562d852b16206d5b1092e2188d3a4fe89bfca405a81bde0e1546
14+
data_model: LP64
15+
language: C
16+
content:
17+
- invariant:
18+
type: location_invariant
19+
location:
20+
file_name: 48-apron-unassume-no-strengthening.c
21+
line: 8
22+
column: 5
23+
function: main
24+
value: i >= 0
25+
format: c_expression
26+
- invariant:
27+
type: location_invariant
28+
location:
29+
file_name: 48-apron-unassume-no-strengthening.c
30+
line: 8
31+
column: 5
32+
function: main
33+
value: i < 100
34+
format: c_expression

tests/regression/56-witness/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
(run %{update_suite} bh-ex1-poly -q)
2323
(run %{update_suite} apron-unassume-precheck -q)
2424
(run %{update_suite} apron-tracked-global-annot -q)
25+
(run %{update_suite} apron-unassume-no-strengthening -q)
2526
(run %{update_suite} apron-unassume-set-tokens -q)))))
2627

2728
(cram

0 commit comments

Comments
 (0)