File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 () ;
You can’t perform that action at this time.
0 commit comments