let expr_unop mem op tyr e te =
let ct1 = object_of te in
let ctr = object_of tyr in
match op with
| Neg ->
begin
match ctr,ct1 with
| C_int ir , C_int i1 ->
M.V_int(ir,A.i_neg ir (expr_int mem i1 ir e))
| C_float fr , C_float f1 ->
M.V_float(fr,R.f_neg fr (expr_float mem f1 fr e))
| _ -> assert false
end
| BNot ->
begin
match ctr,ct1 with
| C_int ir , C_int i1 ->
M.V_int(ir,expr_int mem i1 ir e)
| _ -> assert false
end
| LNot ->
let term = !expr_rec mem e in
begin
match ct1 with
| C_int i1 ->
value_of_boolean (A.i_cmp i1 Formula.Ceq
(int_of_value term) (F.e_int 0))
| C_float f1 ->
value_of_boolean (R.f_cmp f1 Formula.Ceq
(float_of_value term) (F.e_float 0.0))
| C_pointer _ ->
value_of_boolean
(D.is_null (M.pointer_of_loc (loc_of_value term)))
| _ -> assert false
end