You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/solvers/td3.ml
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ module WP =
112
112
HM.remove stable y;
113
113
HM.mem called y || destabilize_vs y || b || was_stable &&List.mem y vs
114
114
) w false
115
-
andsolvexphase=
115
+
andsolve?reuse_eqxphase=
116
116
if tracing then trace "sol2""solve %a, called: %b, stable: %b\n"S.Var.pretty_trace x (HM.mem called x) (HM.mem stable x);
117
117
init x;
118
118
assert (S.system x <>None);
@@ -122,7 +122,12 @@ module WP =
122
122
let wp =HM.mem wpoint x in
123
123
let old =HM.find rho x in
124
124
let l =HM.create 10in
125
-
let tmp = eq x (eval l x) (side ~x) in
125
+
let tmp =
126
+
match reuse_eq with
127
+
|Somed -> d
128
+
|None -> eq x (eval l x) (side ~x)
129
+
in
130
+
let new_eq = tmp in
126
131
(* let tmp = if GobConfig.get_bool "ana.opt.hashcons" then S.Dom.join (S.Dom.bot ()) tmp else tmp in (* Call hashcons via dummy join so that the tag of the rhs value is up to date. Otherwise we might get the same value as old, but still with a different tag (because no lattice operation was called after a change), and since Printable.HConsed.equal just looks at the tag, we would uneccessarily destabilize below. Seems like this does not happen. *)*)
127
132
if tracing then trace "sol""Var: %a\n"S.Var.pretty_trace x ;
128
133
if tracing then trace "sol""Contrib:%a\n"S.Dom.pretty tmp;
@@ -150,7 +155,7 @@ module WP =
150
155
) elseif term && phase =Widen&&HM.mem wpoint x then ( (* TODO: or use wp? *)
151
156
if tracing then trace "sol2""solve switching to narrow %a\n"S.Var.pretty_trace x;
152
157
HM.remove stable x;
153
-
(solve[@tailcall]) x Narrow;
158
+
(solve[@tailcall]) ~reuse_eq:new_eq x Narrow;
154
159
) elseifnot 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. *)
155
160
if tracing then trace "sol2""solve removing wpoint %a\n"S.Var.pretty_trace x;
0 commit comments