Require Export VST.veric.Clight_base.
Local Open Scope pred.
Definition tc_expr {CS: compspecs} (Delta: tycontext) (e: expr) : environ -> mpred:=
fun rho => denote_tc_assert (typecheck_expr Delta e) rho.
Definition tc_exprlist {CS: compspecs} (Delta: tycontext) (t : list type) (e: list expr) : environ -> mpred :=
fun rho => denote_tc_assert (typecheck_exprlist Delta t e) rho.
Definition tc_lvalue {CS: compspecs} (Delta: tycontext) (e: expr) : environ -> mpred :=
fun rho => denote_tc_assert (typecheck_lvalue Delta e) rho.
Definition tc_temp_id {CS: compspecs} (id : positive) (ty : type)
(Delta : tycontext) (e : expr) : environ -> mpred  :=
fun rho => denote_tc_assert (typecheck_temp_id id ty Delta e) rho.
Definition tc_expropt {CS: compspecs} Delta (e: option expr) (t: type) : environ -> mpred :=
match e with None => `!!(t=Tvoid)
| Some e' => tc_expr Delta (Ecast e' t)
end.
Definition tc_temp_id_load id tfrom Delta v : environ -> mpred  :=
fun rho => !! (exists tto, (temp_types Delta) ! id = Some tto
/\ tc_val tto (eval_cast tfrom tto (v rho))).

(* Specifications: *)
Lemma extend_prop: forall P, boxy extendM (prop P).
Hint Resolve extend_prop.
Lemma extend_tc_temp_id_load :  forall id tfrom Delta v rho, boxy extendM (tc_temp_id_load id tfrom Delta v rho).
Lemma extend_tc_andp:
forall {CS: compspecs} A B rho,
boxy extendM (denote_tc_assert A rho) ->
boxy extendM (denote_tc_assert B rho) ->
boxy extendM (denote_tc_assert (tc_andp A B) rho).
Lemma extend_tc_bool:
forall {CS: compspecs} A B rho,
boxy extendM (denote_tc_assert (tc_bool A B) rho).
Lemma extend_tc_int_or_ptr_type:
forall {CS: compspecs} A rho,
boxy extendM (denote_tc_assert (tc_int_or_ptr_type A) rho).
Lemma extend_tc_Zge:
forall {CS: compspecs} v i rho,
boxy extendM (denote_tc_assert (tc_Zge v i) rho).
Lemma extend_tc_Zle:
forall {CS: compspecs} v i rho,
boxy extendM (denote_tc_assert (tc_Zle v i) rho).
Lemma extend_tc_iszero:
forall {CS: compspecs} v rho,
boxy extendM (denote_tc_assert (tc_iszero v) rho).
Lemma extend_valid_pointer':
forall a b, boxy extendM (valid_pointer' a b).
Lemma extend_andp: forall P Q,
boxy extendM P -> boxy extendM Q -> boxy extendM (andp P Q).
Lemma extend_orp: forall P Q,
boxy extendM P -> boxy extendM Q -> boxy extendM (orp P Q).
Lemma extend_tc_test_eq:
forall {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_test_eq e1 e2) rho).
Lemma extend_tc_test_order:
forall {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_test_order e1 e2) rho).
Lemma extend_isCastResultType:
forall {CS: compspecs} t t' v rho,
boxy extendM (denote_tc_assert (isCastResultType t t' v) rho).
Lemma extend_tc_temp_id: forall {CS: compspecs} id ty Delta e rho, boxy extendM (tc_temp_id id ty Delta e rho).
Lemma extend_tc_samebase:
forall {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_samebase e1 e2) rho).
Lemma extend_tc_nonzero:
forall {CS: compspecs} v rho,
boxy extendM (denote_tc_assert (tc_nonzero v) rho).
Lemma extend_tc_nodivover:
forall {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_nodivover e1 e2) rho).
Lemma extend_tc_nosignedover:
forall op {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_nosignedover op e1 e2) rho).
Lemma extend_tc_nobinover:
forall op {CS: compspecs} e1 e2 rho,
boxy extendM (denote_tc_assert (tc_nobinover op e1 e2) rho).
Lemma boxy_orp {A} `{H : ageable A}:
forall (M: modality) , reflexive _ (app_mode M) ->
forall P Q, boxy M P -> boxy M Q -> boxy M (P || Q).
Lemma extend_tc_orp:
forall {CS: compspecs} A B rho,
boxy extendM (denote_tc_assert A rho) ->
boxy extendM (denote_tc_assert B rho) ->
boxy extendM (denote_tc_assert (tc_orp A B) rho).
Lemma extend_tc_ilt:
forall {CS: compspecs} e i rho,
boxy extendM (denote_tc_assert (tc_ilt e i) rho).
Lemma extend_tc_llt:
forall {CS: compspecs} e i rho,
boxy extendM (denote_tc_assert (tc_llt e i) rho).
Lemma extend_tc_andp':
forall {CS: compspecs} A B rho,
boxy extendM (denote_tc_assert A rho) ->
boxy extendM (denote_tc_assert B rho) ->
boxy extendM (denote_tc_assert (tc_andp' A B) rho).