Skip to content

Commit f0a15f6

Browse files
committed
Fix basic functionality of topdown_term
1 parent e57072f commit f0a15f6

File tree

2 files changed

+9
-44
lines changed

2 files changed

+9
-44
lines changed

src/solver/topDown_term.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ module WP =
2424
let stable = HM.create 10 in
2525
let infl = HM.create 10 in (* y -> xs *)
2626
let called = HM.create 10 in
27-
let rho = HM.create 10 in
28-
let rho' = HM.create 10 in
27+
let rho = HM.create 10 in (* rho for right-hand side values *)
28+
let rho' = HM.create 10 in (* rho for start and side effect values *)
2929
let wpoint = HM.create 10 in
3030

3131
let add_infl y x =
@@ -101,7 +101,7 @@ module WP =
101101
let set_start (x,d) =
102102
if tracing then trace "sol2" "set_start %a ## %a" S.Var.pretty_trace x S.Dom.pretty d;
103103
init x;
104-
HM.replace rho x d;
104+
HM.replace rho' x d;
105105
solve x Widen
106106
in
107107

tests/regression/00-sanity/01-assert.t

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -65,51 +65,16 @@ Test topdown solvers:
6565
total lines: 9
6666

6767
$ goblint --enable warn.deterministic --set solver topdown_term 01-assert.c
68-
[Error] Fixpoint not reached at L:entry state of main (299) on 01-assert.c:4:1-15:1
69-
Solver computed:
70-
bot
71-
Right-Hand-Side:
72-
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):PathSensitive (ProjectiveSet (MCP.D * map)):{(MCP.D:[expRelation:(),
73-
mallocWrapper:(wrapper call:Unknown node, unique calls:{}),
74-
base:({
75-
}, {}, {}, {}),
76-
threadid:(wrapper call:unknown node, Thread:[main], created:(current function:bot, callees:bot)),
77-
threadflag:Singlethreaded,
78-
threadreturn:true,
79-
escape:{},
80-
mutexEvents:(),
81-
access:(),
82-
mutex:(lockset:{}, multiplicity:{}),
83-
race:(),
84-
mhp:(),
85-
assert:(),
86-
pthreadMutexType:()], map:{})}
87-
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):PathSensitive (ProjectiveSet (MCP.D * map)):{(MCP.D:[expRelation:(),
88-
mallocWrapper:(wrapper call:Unknown node, unique calls:{}),
89-
base:({
90-
}, {}, {}, {}),
91-
threadid:(wrapper call:unknown node, Thread:[main], created:(current function:bot, callees:bot)),
92-
threadflag:Singlethreaded,
93-
threadreturn:true,
94-
escape:{},
95-
mutexEvents:(),
96-
access:(),
97-
mutex:(lockset:{}, multiplicity:{}),
98-
race:(),
99-
mhp:(),
100-
assert:(),
101-
pthreadMutexType:()], map:{})} instead of bot
102-
68+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
69+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
70+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
10371
[Warning][Deadcode] Function 'main' does not return
10472
[Warning][Deadcode] Function 'main' has dead code:
105-
on lines 4..7 (01-assert.c:4-7)
106-
on lines 10..14 (01-assert.c:10-14)
73+
on lines 13..14 (01-assert.c:13-14)
10774
[Warning][Deadcode] Logical lines of code (LLoC) summary:
108-
live: 0
109-
dead: 9
75+
live: 7
76+
dead: 2
11077
total lines: 9
111-
[Error][Unsound] Fixpoint not reached
112-
[3]
11378

11479
$ goblint --enable warn.deterministic --set solver topdown_space_cache_term 01-assert.c
11580
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)

0 commit comments

Comments
 (0)