let prop mem e =
match (Cil.stripInfo e).enode with
| Info _ -> WpLog.fatal "non translation for info type expression"
| Const (cnst) -> prop_const mem cnst
| CastE (ty,e) ->
if Cil.isPointerType ty && Cil.isZero e then
F.p_false
else
prop_cast (Cil.typeOf e) ty (expr mem e)
| BinOp (op, e1, e2, ty) ->
prop_binop mem op ty
e1 (Cil.typeOf e1)
e2 (Cil.typeOf e2)
| UnOp (op, e1, ty) ->
prop_unop mem op ty e1 (Cil.typeOf e1)
| Lval lval ->
let t = Cil.typeOf e in
let l = addr mem lval in
prop_of_value (M.load mem (Ctypes.object_of t) l)
| StartOf lval ->
let ty_elt =
Ctypes.object_of_pointed (Ctypes.object_of (Cil.typeOf e))
in
prop_of_loc (startof mem ty_elt lval)
| AddrOf lval ->
prop_of_loc (addr mem lval)
| AlignOfE _ | AlignOf _
| SizeOfE _ | SizeOf _ | SizeOfStr _ ->
let e' = Cil.constFold true e in
match e'.enode with
| Const c -> prop_const mem c
| _ -> WpLog.not_yet_implemented "sizeof(%a)"
!Ast_printer.d_exp e