Ltac dec_enc :=
match goal with
[ |- decode_val ?CH _ = ?V] => assert (DE := decode_encode_val_general V CH CH);
apply decode_encode_val_similar in DE; auto
end.

(* Specifications: *)
Lemma load_cast:
forall (t: type) (e2 : expr) (ch : memory_chunk) rho phi m,
tc_val (typeof e2) (eval_expr e2 rho) ->
denote_tc_assert (isCastResultType (typeof e2) t e2)
rho phi ->
access_mode t = By_value ch ->
Val.load_result ch
(force_val (Cop.sem_cast (eval_expr e2 rho) (typeof e2) t m)) =
force_val (Cop.sem_cast (eval_expr e2 rho) (typeof e2) t m).
Lemma semax_store:
forall Delta e1 e2 sh P,
writable0_share sh ->
semax Espec Delta
(fun rho =>
|> (tc_lvalue Delta e1 rho && tc_expr Delta (Ecast e2 (typeof e1)) rho  &&
(mapsto_ sh (typeof e1) (eval_lvalue e1 rho) * P rho)))
(Sassign e1 e2)
(normal_ret_assert (fun rho => mapsto sh (typeof e1) (eval_lvalue e1 rho)
(force_val (sem_cast  (typeof e2) (typeof e1) (eval_expr e2 rho))) * P rho)).
Lemma semax_set_forward_nl:
forall (Delta: tycontext) (P: assert) id e v t,
typeof_temp Delta id = Some t ->
(forall rho, P rho |-- rel_expr e v rho) ->
tc_val t v ->
semax Espec Delta
(fun rho => |> (P rho))
(Sset id e)
(normal_ret_assert
(fun rho => (EX old:val, !! (v = eval_id id rho) && subst id old P rho))).
Lemma semax_loadstore:
forall v0 v1 v2 (Delta: tycontext) e1 e2 sh P P',
writable0_share sh ->
(forall rho, P rho |-- !! (tc_val (typeof e1) v2)
&& rel_lvalue e1 v1 rho
&& rel_expr (Ecast e2 (typeof e1)) v2 rho
&& (mapsto sh (typeof e1) v1 v0 * P' rho)) ->
semax Espec Delta (fun rho => |> P rho) (Sassign e1 e2)
(normal_ret_assert (fun rho => mapsto sh (typeof e1) v1 v2 * P' rho)).