Skip to content

Commit 9782831

Browse files
Also replace try/Not_found with find_default in sLR.ml
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/e9e6f40d-2d85-4c11-a73a-8870b1bc3fea Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
1 parent 78f39e1 commit 9782831

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/solver/sLR.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ module SLR3 =
5151
let rho' = HPM.create 10 in
5252
let q = ref H.empty in
5353

54-
let add_infl y x = HM.replace infl y (VS.add x (try HM.find infl y with Not_found -> VS.empty)) in
55-
let add_set x y d = HM.replace set y (VS.add x (try HM.find set y with Not_found -> VS.empty)); HPM.add rho' (x,y) d in
54+
let add_infl y x = HM.replace infl y (VS.add x (HM.find_default infl y VS.empty)) in
55+
let add_set x y d = HM.replace set y (VS.add x (HM.find_default set y VS.empty)); HPM.add rho' (x,y) d in
5656
let make_wpoint x = HM.replace wpoint x () in
5757
let rec solve x =
5858
if not (HM.mem stable x) then begin
@@ -74,7 +74,7 @@ module SLR3 =
7474
update_var_event x old tmp;
7575
if tracing then trace "sol" "New Value:%a" S.Dom.pretty tmp;
7676
HM.replace rho x tmp;
77-
let w = try HM.find infl x with Not_found -> VS.empty in
77+
let w = HM.find_default infl x VS.empty in
7878
let w = if wpx then VS.add x w else w in
7979
q := VS.fold H.add w !q;
8080
HM.replace infl x VS.empty;
@@ -106,7 +106,7 @@ module SLR3 =
106106
add_infl y x;
107107
HM.find rho y
108108
and sides x =
109-
let w = try HM.find set x with Not_found -> VS.empty in
109+
let w = HM.find_default set x VS.empty in
110110
VS.fold (fun z d -> try S.Dom.join d (HPM.find rho' (z,x)) with Not_found -> d) w (S.Dom.bot ())
111111
and side x y d =
112112
HM.add globals y ();

0 commit comments

Comments
 (0)