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
letof_boolik= create { fi =fun (typea) (module I:SOverflow with type t = a) -> I.of_bool ik }
121
121
letof_excl_listik= create2 { fi2 =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_excl_list ik}
122
122
letof_intik= create2_ovc ik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_int ik }
123
-
letstarting?(suppress_ovwarn=false)ik= create2_ovc ik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.starting~suppress_ovwarn ik }
124
-
letending?(suppress_ovwarn=false)ik= create2_ovc ik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.ending~suppress_ovwarn ik }
125
-
letof_interval?(suppress_ovwarn=false)ik= create2_ovc ik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_interval~suppress_ovwarn ik }
123
+
letstarting?(suppress_ovwarn=false)ik= create2_ovc ~suppress_ovwarnik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.starting ik }
124
+
letending?(suppress_ovwarn=false)ik= create2_ovc ~suppress_ovwarnik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.ending ik }
125
+
letof_interval?(suppress_ovwarn=false)ik= create2_ovc ~suppress_ovwarnik { fi2_ovc =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_interval ik }
126
126
letof_congruenceik= create2 { fi2 =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_congruence ik }
127
127
letof_bitfieldik= create2 { fi2 =fun (typea) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_bitfield ik }
let ov_info = { underflow= underflow &¬ suppress_ovwarn; overflow= overflow &¬ suppress_ovwarn } in
42
+
let ov_info = { underflow; overflow } in
43
43
let v =
44
44
if underflow || overflow then
45
45
if should_wrap ik then(* could add [|| cast], but that's GCC implementation-defined behavior: https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html#Integers-implementation *)
@@ -88,7 +88,7 @@ struct
88
88
89
89
(* TODO: change to_int signature so it returns a big_int *)
90
90
letto_intx=Option.bind x (IArith.to_int)
91
-
letof_interval?(suppress_ovwarn=false)ik (x,y) = norm~suppress_ovwarn ik @@Some (x,y)
91
+
letof_intervalik (x,y) = norm ik @@Some (x,y)
92
92
93
93
letof_bitfieldikx=
94
94
letminik (z,o) =
@@ -129,17 +129,17 @@ struct
129
129
|Some (l, u) whenInts_t.compare l Ints_t.zero =0&&Ints_t.compare u Ints_t.zero =0 -> Somefalse
(* TODO: change signature of maximal, minimal to return big_int*)
139
139
letmaximal=functionNone ->None|Some (x,y) ->Some y
140
140
letminimal=functionNone ->None|Some (x,y) ->Some x
141
141
142
-
letcast_to?(suppress_ovwarn=false)?torg?no_ovt= norm ~cast:true t (* norm does all overflow handling *)
142
+
letcast_to?torg?no_ovt= norm ~cast:true t (* norm does all overflow handling *)
143
143
144
144
letwidenikxy=
145
145
match x, y with
@@ -524,7 +524,7 @@ struct
524
524
let l' =ifInts_t.equal l min_ik then l else shrink Ints_t.add l in
525
525
let u' =ifInts_t.equal u max_ik then u else shrink Ints_t.sub u in
526
526
let intv' = norm ik @@Some (l', u') |> fst in
527
-
let range = norm ~suppress_ovwarn:trueik (Some (Ints_t.of_bigint (Size.min_from_bit_range rl), Ints_t.of_bigint (Size.max_from_bit_range rh))) |> fst in
527
+
let range = norm ik (Some (Ints_t.of_bigint (Size.min_from_bit_range rl), Ints_t.of_bigint (Size.max_from_bit_range rh))) |> fst in
528
528
meet ik intv' range
529
529
530
530
letrefine_with_incl_listik (intv: t) (incl: (int_t list) option) : t =
0 commit comments