|
|
@ -853,27 +853,29 @@ module Make (Manager : Manager_S) = struct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let itv_of sym itv =
|
|
|
|
let itv_of sym itv =
|
|
|
|
if Itv.is_empty itv then empty
|
|
|
|
match itv with
|
|
|
|
else
|
|
|
|
| Bottom ->
|
|
|
|
let lb, ub = (Itv.lb itv, Itv.ub itv) in
|
|
|
|
empty
|
|
|
|
Option.value_map (SymExp.of_sym sym) ~default:empty ~f:(fun sym_exp ->
|
|
|
|
| NonBottom itv_pure ->
|
|
|
|
let tcons_lb =
|
|
|
|
let lb, ub = (Itv.ItvPure.lb itv_pure, Itv.ItvPure.ub itv_pure) in
|
|
|
|
Option.map (Itv.Bound.is_const lb) ~f:(fun lb ->
|
|
|
|
Option.value_map (SymExp.of_sym sym) ~default:empty ~f:(fun sym_exp ->
|
|
|
|
let sym_minus_lb = SymExp.minus sym_exp (SymExp.of_big_int lb) in
|
|
|
|
let tcons_lb =
|
|
|
|
Tcons1.make sym_minus_lb Tcons1.SUPEQ )
|
|
|
|
Option.map (Itv.Bound.is_const lb) ~f:(fun lb ->
|
|
|
|
in
|
|
|
|
let sym_minus_lb = SymExp.minus sym_exp (SymExp.of_big_int lb) in
|
|
|
|
let tcons_ub =
|
|
|
|
Tcons1.make sym_minus_lb Tcons1.SUPEQ )
|
|
|
|
Option.map (Itv.Bound.is_const ub) ~f:(fun ub ->
|
|
|
|
in
|
|
|
|
let ub_minus_sym = SymExp.minus (SymExp.of_big_int ub) sym_exp in
|
|
|
|
let tcons_ub =
|
|
|
|
Tcons1.make ub_minus_sym Tcons1.SUPEQ )
|
|
|
|
Option.map (Itv.Bound.is_const ub) ~f:(fun ub ->
|
|
|
|
in
|
|
|
|
let ub_minus_sym = SymExp.minus (SymExp.of_big_int ub) sym_exp in
|
|
|
|
match (tcons_lb, tcons_ub) with
|
|
|
|
Tcons1.make ub_minus_sym Tcons1.SUPEQ )
|
|
|
|
| Some tcons_lb, Some tcons_ub ->
|
|
|
|
in
|
|
|
|
doubleton tcons_lb tcons_ub
|
|
|
|
match (tcons_lb, tcons_ub) with
|
|
|
|
| Some tcons, None | None, Some tcons ->
|
|
|
|
| Some tcons_lb, Some tcons_ub ->
|
|
|
|
singleton tcons
|
|
|
|
doubleton tcons_lb tcons_ub
|
|
|
|
| None, None ->
|
|
|
|
| Some tcons, None | None, Some tcons ->
|
|
|
|
empty )
|
|
|
|
singleton tcons
|
|
|
|
|
|
|
|
| None, None ->
|
|
|
|
|
|
|
|
empty )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let of_raw_symexp re typ = singleton (Tcons1.make (SymExp.of_raw re) typ)
|
|
|
|
let of_raw_symexp re typ = singleton (Tcons1.make (SymExp.of_raw re) typ)
|
|
|
|