let get_uminus_assertion ~simplify_constants:simplify_constants ~warning:warning expr =
let t = Cil.typeOf expr in
let size = bitsSizeOf t
in if (size > 64) then (
rte_warn fmt_warn_bitsize_over_64 d_exp expr ;
[]
)
else
let minType = min_signed_number size in
let assertion () =
let term = translate_C_expr_to_term expr
in Logic_const.prel (Rneq, term, Cil.lconstant minType)
in
if simplify_constants then (
match get_expr_val expr with
| Some a64 ->
if My_bigint.equal a64 minType then begin
let assertion = assertion () in
if warning then
rte_warn fmt_unary_minus_assert
d_predicate_named assertion;
[ assertion, Some Property_status.False_if_reachable ]
end else
[]
| None -> [ (assertion (), None) ]
) else [ (assertion (), None) ]