Require Export VST.veric.environ_lemmas.
Require Export VST.veric.expr_lemmas3.
(** Main soundness result for the typechecker **)
Ltac unfold_cop2_sem_cmp :=
unfold Clight_Cop2.sem_cmp, Clight_Cop2.sem_cmp_pl, Clight_Cop2.sem_cmp_lp, Clight_Cop2.sem_cmp_pp.
(*        (Hcenv: genv_cenv ge = @cenv_cs CS)*)
Definition some_pt_type := Tpointer Tvoid noattr.

Lemma typecheck_binop_sound2:
forall {CS: compspecs} (Delta : tycontext) (rho : environ) m (b : binary_operation)
(e1 e2 : expr) (t : type),
denote_tc_assert (typecheck_expr Delta e2) rho m ->
denote_tc_assert (isBinOpResultType b e1 e2 t) rho m ->
denote_tc_assert (typecheck_expr Delta e1) rho m ->
tc_val (typeof e2) (eval_expr e2 rho) ->
tc_val (typeof e1) (eval_expr e1 rho) ->
tc_val t
(eval_binop b (typeof e1) (typeof e2) (eval_expr e1 rho) (eval_expr e2 rho)).