Skip to content

Commit fa92835

Browse files
committed
Remove curry in IntervalSetDomain
1 parent 332023d commit fa92835

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/cdomain/value/cdomains/int/intervalSetDomain.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct
114114
let binop (x: t) (y: t) op : t = match x, y with
115115
| [], _ -> []
116116
| _, [] -> []
117-
| _, _ -> canonize @@ GobList.cartesian_concat_map (Batteries.curry op) x y
117+
| _, _ -> canonize @@ GobList.cartesian_concat_map op x y
118118

119119

120120
include Std (struct type nonrec t = t let name = name let top_of = top_of let bot_of = bot_of let show = show let equal = equal end)
@@ -196,7 +196,7 @@ struct
196196
| [], _ -> ([],{overflow=false; underflow=false})
197197
| _, [] -> ([],{overflow=false; underflow=false})
198198
| _, _ ->
199-
let res = GobList.cartesian_map (Batteries.curry op) x y in
199+
let res = GobList.cartesian_map op x y in
200200
let intvs = List.concat_map fst res in
201201
let underflow = List.exists (fun (_,{underflow; _}) -> underflow) res in
202202
let overflow = List.exists (fun (_,{overflow; _}) -> underflow) res in
@@ -307,7 +307,7 @@ struct
307307
let interval_to_int i = Interval.to_int (Some i)
308308
let interval_to_bool i = Interval.to_bool (Some i)
309309

310-
let log f ik (i1, i2) =
310+
let log f ik i1 i2 =
311311
match (interval_to_bool i1, interval_to_bool i2) with
312312
| Some x, Some y -> of_bool ik (f x y)
313313
| _ -> top_of ik
@@ -319,7 +319,7 @@ struct
319319
| _ -> top_of ik
320320

321321

322-
let bitcomp f ik (i1, i2) =
322+
let bitcomp f ik i1 i2 =
323323
match (interval_to_int i1, interval_to_int i2) with
324324
| Some x, Some y -> (try of_int ik (f x y) with Division_by_zero | Invalid_argument _ -> (top_of ik,{overflow=false; underflow=false}))
325325
| _, _ -> (top_of ik,{overflow=false; underflow=false})
@@ -340,7 +340,7 @@ struct
340340
Ints_t.sub (Ints_t.shift_left Ints_t.one (Z.numbits @@ Z.abs @@ Ints_t.to_bigint x)) Ints_t.one
341341

342342
(* TODO: deduplicate with IntervalDomain? *)
343-
let interval_logand ik (i1, i2) =
343+
let interval_logand ik i1 i2 =
344344
match bit Ints_t.logand ik (i1, i2) with
345345
| result when not (is_top_of ik result) -> result
346346
| _ ->
@@ -361,7 +361,7 @@ struct
361361
let logand ik x y = binop x y (interval_logand ik)
362362

363363
(* TODO: deduplicate with IntervalDomain? *)
364-
let interval_logor ik (i1, i2) =
364+
let interval_logor ik i1 i2 =
365365
match bit Ints_t.logor ik (i1, i2) with
366366
| result when not (is_top_of ik result) -> result
367367
| _ ->
@@ -381,7 +381,7 @@ struct
381381
let logor ik x y = binop x y (interval_logor ik)
382382

383383
(* TODO: deduplicate with IntervalDomain? *)
384-
let interval_logxor ik (i1, i2) =
384+
let interval_logxor ik i1 i2 =
385385
match bit Ints_t.logxor ik (i1, i2) with
386386
| result when not (is_top_of ik result) && not (is_bot result) -> result (* TODO: why bot check here, but not elsewhere? *)
387387
| _ ->
@@ -426,7 +426,7 @@ struct
426426
binary_op_with_ovc x y interval_shiftleft
427427

428428
(* TODO: deduplicate with IntervalDomain? *)
429-
let interval_shiftright ik (i1, i2) =
429+
let interval_shiftright ik i1 i2 =
430430
match interval_to_int i1, interval_to_int i2 with
431431
| Some x, Some y -> (try of_int ik (Ints_t.shift_right x (Ints_t.to_int y)) with Division_by_zero | Invalid_argument _ -> (top_of ik, {overflow=false; underflow=false}))
432432
| _, _ ->
@@ -472,7 +472,7 @@ struct
472472
binary_op_concat_with_norm interval_div ik x y
473473

474474
let rem ik x y =
475-
let interval_rem (x, y) =
475+
let interval_rem x y =
476476
if Interval.is_top_of ik (Some x) && Interval.is_top_of ik (Some y) then
477477
top_of ik
478478
else

0 commit comments

Comments
 (0)