Skip to content

Commit 02f71b2

Browse files
authored
Merge pull request #373 from goblint/td3-narrow-wpoint
Fix TD3 narrowing non-wpoint
2 parents fd954a0 + bc8a9bd commit 02f71b2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/solvers/td3.ml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,26 @@ module WP =
130130
else
131131
box x old tmp
132132
in
133+
if tracing then trace "sol" "Old value:%a\n" S.Dom.pretty old;
134+
if tracing then trace "sol" "New Value:%a\n" S.Dom.pretty tmp;
133135
if tracing then trace "cache" "cache size %d for %a\n" (HM.length l) S.Var.pretty_trace x;
134136
cache_sizes := HM.length l :: !cache_sizes;
135137
if not (Stats.time "S.Dom.equal" (fun () -> S.Dom.equal old tmp) ()) then (
136138
update_var_event x old tmp;
137-
if tracing then trace "sol" "New Value:%a\n\n" S.Dom.pretty tmp;
138139
HM.replace rho x tmp;
139140
destabilize x;
140141
(solve[@tailcall]) x phase;
141142
) else if not (HM.mem stable x) then (
143+
if tracing then trace "sol2" "solve still unstable %a\n" S.Var.pretty_trace x;
142144
(solve[@tailcall]) x Widen;
143-
) else if term && phase = Widen then (
145+
) else if term && phase = Widen && HM.mem wpoint x then ( (* TODO: or use wp? *)
146+
if tracing then trace "sol2" "solve switching to narrow %a\n" S.Var.pretty_trace x;
144147
HM.remove stable x;
145148
(solve[@tailcall]) x Narrow;
146-
) else if not space && (not term || phase = Narrow) then (* this makes e.g. nested loops precise, ex. tests/regression/34-localization/01-nested.c - if we do not remove wpoint, the inner loop head will stay a wpoint and widen the outer loop variable. *)
149+
) else if not space && (not term || phase = Narrow) then ( (* this makes e.g. nested loops precise, ex. tests/regression/34-localization/01-nested.c - if we do not remove wpoint, the inner loop head will stay a wpoint and widen the outer loop variable. *)
150+
if tracing then trace "sol2" "solve removing wpoint %a\n" S.Var.pretty_trace x;
147151
HM.remove wpoint x;
152+
)
148153
)
149154
and eq x get set =
150155
if tracing then trace "sol2" "eq %a\n" S.Var.pretty_trace x;

0 commit comments

Comments
 (0)