Definition cast_pointer_to_bool t1 t2 :=
match t1 with (Tpointer _ _ | Tarray _ _ _ | Tfunction _ _ _) =>
match t2 with Tint IBool _ _ => true | _ => false end
| _ => false
end.

(* Specifications: *)
Lemma sem_cast_e1:
forall t t1 v1 v m,
sem_cast t t1 v = Some v1 ->
cast_pointer_to_bool t t1 = false ->
tc_val t v ->
Cop.sem_cast v t t1 m = Some v1.
Lemma cop2_sem_cast' :
forall {CS: compspecs} t2 e rho m,
(denote_tc_assert (isCastResultType (typeof e) t2 e) rho) (m_phi m) ->
tc_val (typeof e) (eval_expr e rho) ->
Cop.sem_cast (eval_expr e rho) (typeof e) t2 (m_dry m) =
sem_cast (typeof e) t2 (eval_expr e rho).
Lemma isBinOpResultType_binop_stable: forall {CS: compspecs} b e1 e2 t rho phi,
denote_tc_assert (isBinOpResultType b e1 e2 t) rho phi ->
binop_stable cenv_cs b e1 e2 = true.
Lemma eval_unop_relate:
forall {CS: compspecs} Delta (ge: genv) te ve rho u e t m
(Hcenv : genv_cenv ge = @cenv_cs CS)
(H : rho = construct_rho (filter_genv ge) ve te)
(H0 : typecheck_environ Delta rho)
(H1 : (denote_tc_assert (typecheck_expr Delta e) rho) (m_phi m) ->
Clight.eval_expr ge ve te (m_dry m) e (eval_expr e rho))
(H2 : (denote_tc_assert (typecheck_lvalue Delta e) rho) (m_phi m) ->
exists (b : block) (ofs : ptrofs),
Clight.eval_lvalue ge ve te (m_dry m) e b ofs /\
eval_lvalue e rho = Vptr b ofs)
(H3 : (denote_tc_assert (typecheck_expr Delta (Eunop u e t)) rho)
(m_phi m)),
Clight.eval_expr ge ve te (m_dry m) (Eunop u e t)
(eval_expr (Eunop u e t) rho).
Lemma eqb_type_sym: forall a b, eqb_type a b = eqb_type b a.
Lemma Ptrofs_to_int_repr:
Archi.ptr64=false ->
forall i, Ptrofs.to_int (Ptrofs.repr i) = Int.repr i.
Lemma eval_both_relate:
forall {CS: compspecs} Delta ge te ve rho e m,
genv_cenv ge = cenv_cs ->
rho = construct_rho (filter_genv ge) ve te ->
typecheck_environ Delta rho ->
(denote_tc_assert (typecheck_expr Delta e) rho (m_phi m) ->
Clight.eval_expr ge ve te (m_dry m) e  (eval_expr e rho))
/\
(denote_tc_assert (typecheck_lvalue Delta e) rho (m_phi m) ->
exists b, exists ofs,
Clight.eval_lvalue ge ve te (m_dry m) e b ofs /\
eval_lvalue e rho = Vptr b ofs).
Lemma eval_expr_relate:
forall {CS: compspecs} Delta ge te ve rho e m,
genv_cenv ge = cenv_cs ->
rho = construct_rho (filter_genv ge) ve te ->
typecheck_environ Delta rho ->
(denote_tc_assert (typecheck_expr Delta e) rho (m_phi m) ->
Clight.eval_expr ge ve te (m_dry m) e  (eval_expr e rho)).
Lemma eval_lvalue_relate:
forall {CS: compspecs} Delta ge te ve rho e m,
genv_cenv ge = cenv_cs ->
rho = construct_rho (filter_genv ge) ve te->
typecheck_environ Delta rho ->
(denote_tc_assert (typecheck_lvalue Delta e) rho (m_phi m) ->
exists b, exists ofs,
Clight.eval_lvalue ge ve te (m_dry m) e b ofs /\
eval_lvalue e rho = Vptr b ofs).