let treat_val loc pred (base, range) =
let add term =
if Cil.isLogicZero base then term
else Logic_const.term
(TBinOp (PlusA, Logic_const.tat (base,Logic_const.pre_label), term))
Linteger
in
let add_cst i = add (Logic_const.tinteger ~ikind:IInt i) in
let res =
match range with
| Fixed i -> Logic_const.prel (Req,loc, add_cst i)
| Interval(min,max) ->
let min = Logic_const.prel (Rle, add_cst min, loc) in
let max = Logic_const.prel (Rle, loc, add_cst max) in
Logic_const.pand (min,max)
| Bounded (min,max) ->
let min = Logic_const.prel (Rle, add_cst min, loc) in
let max = Logic_const.prel (Rle, loc, add max) in
Logic_const.pand (min,max)
| Unbounded min -> Logic_const.prel (Rle, add_cst min, loc)
in
Aorai_option.debug ~dkey:"action" "Action predicate: %a"
!Ast_printer.d_predicate_named res;
Logic_const.por(pred,res)