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
(* Be careful: inv_exp performs a meet on both arguments of the BOr / BXor. *)
400
+
ifPrecisionUtil.get_bitfield ()then
401
+
(* refinement based on the following idea: bit set to one in c and set to zero in b must be one in a and bit set to zero in c must be zero in a too (analogously for b) *)
402
+
let ((az, ao), (bz, bo)) =BitfieldDomain.Bitfield.refine_bor (ID.to_bitfield ikind a) (ID.to_bitfield ikind b) (ID.to_bitfield ikind c) in
403
+
ID.meet a (ID.of_bitfield ikind (az, ao)), ID.meet b (ID.of_bitfield ikind (bz, bo))
(* Be careful: inv_exp performs a meet on both arguments of the BOr / BXor. *)
407
+
(a, b)
408
+
)
409
+
|BXor ->
400
410
(* Be careful: inv_exp performs a meet on both arguments of the BOr / BXor. *)
401
-
a, b
411
+
meet_com ID.logxor
402
412
|LAnd ->
403
413
ifID.to_bool c =Sometruethen
404
414
meet_bin c c
405
415
else
406
416
a, b
407
-
|BAndasop->
417
+
|BAnd ->
408
418
(* we only attempt to refine a here *)
419
+
let b_int =ID.to_int b in
409
420
let a =
410
-
matchID.to_int bwith
421
+
matchb_intwith
411
422
|SomexwhenZ.equal x Z.one ->
412
423
(matchID.to_bool c with
413
424
|Sometrue -> ID.meet a (ID.of_congruence ikind (Z.one, Z.of_int 2))
414
425
|Somefalse -> ID.meet a (ID.of_congruence ikind (Z.zero, Z.of_int 2))
415
-
|None -> ifM.tracing thenM.tracel "inv""Unhandled case for operator x %a 1 = %a" d_binop op ID.pretty c; a)
416
-
|_ -> ifM.tracing thenM.tracel "inv""Unhandled case for operator x %a %a = %a" d_binop op ID.pretty b ID.pretty c; a
426
+
|None -> a)
427
+
|_ -> a
417
428
in
418
-
a, b
429
+
ifPrecisionUtil.get_bitfield ()then
430
+
(* refinement based on the following idea: bit set to zero in c and set to one in b must be zero in a and bit set to one in c must be one in a too (analogously for b) *)
431
+
let ((az, ao), (bz, bo)) =BitfieldDomain.Bitfield.refine_band (ID.to_bitfield ikind a) (ID.to_bitfield ikind b) (ID.to_bitfield ikind c) in
432
+
ID.meet a (ID.of_bitfield ikind (az, ao)), ID.meet b (ID.of_bitfield ikind (bz, bo))
0 commit comments