Ltac solve_legal_tc_init :=
repeat progress
(simpl; auto;
match goal with
| |- context [match ?A with _ => _ end] => destruct A eqn:?H
| |- legal_tc_init _ (tc_bool _ _) => apply legal_tc_init_tc_bool
| |- legal_tc_init _ (tc_andp _ _) => apply legal_tc_init_tc_andp
| |- legal_tc_init _ (tc_nonzero _) => apply legal_tc_init_tc_nonzero
| |- legal_tc_init _ (tc_iszero _) => apply legal_tc_init_tc_iszero
| |- legal_tc_init _ (tc_test_eq _ _) => apply legal_tc_init_tc_test_eq
| |- legal_tc_init _ (tc_test_order _ _) => apply legal_tc_init_tc_test_order
| |- legal_tc_init _ (tc_nodivover _ _) => apply legal_tc_init_tc_nodivover
| |- legal_tc_init _ (tc_ilt _ _) => apply legal_tc_init_tc_ilt
| |- legal_tc_init _ (tc_llt _ _) => apply legal_tc_init_tc_llt
| |- legal_tc_init _ (binarithType _ _ _ _ _) => apply legal_tc_init_binarithType
| |- legal_tc_init _ (tc_nobinover _ _ _) => apply legal_tc_init_tc_nobinover
| |- _ => idtac
end).

(* Specifications: *)
Lemma typecheck_lvalue_legal_tc_init: forall {cs: compspecs} Delta e,
legal_tc_init Delta (typecheck_lvalue Delta e)
with typecheck_expr_legal_tc_init: forall {cs: compspecs} Delta e,
legal_tc_init Delta (typecheck_expr Delta e).
Lemma typecheck_LR_strong_legal_tc_init: forall {cs: compspecs} Delta e lr,
legal_tc_init Delta (typecheck_LR_strong Delta e lr).
Lemma typecheck_LR_legal_tc_init: forall {cs: compspecs} Delta e lr,
legal_tc_init Delta (typecheck_LR Delta e lr).
Lemma typecheck_efield_legal_tc_init: forall {cs: compspecs} Delta efs,
legal_tc_init Delta (typecheck_efield Delta efs).
Lemma typecheck_exprlist_legal_tc_init: forall {cs: compspecs} Delta ts es,
legal_tc_init Delta (typecheck_exprlist Delta ts es).
Lemma msubst_tc_lvalue_sound: forall {cs: compspecs} Delta P T1 T2 GV R e,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_lvalue Delta T1 T2 GV e) |--
tc_lvalue Delta e.
Lemma msubst_tc_expr_sound: forall {cs: compspecs} Delta P T1 T2 GV R e,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_expr Delta T1 T2 GV e) |--
tc_expr Delta e.
Lemma msubst_tc_LR_sound: forall {cs: compspecs} Delta P T1 T2 GV R e lr,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_LR Delta T1 T2 GV e lr) |--
tc_LR Delta e lr.
Lemma msubst_tc_efield_sound: forall {cs: compspecs} Delta P T1 T2 GV R efs,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_efield Delta T1 T2 GV efs) |--
tc_efield Delta efs.
Lemma msubst_tc_exprlist_sound: forall {cs: compspecs} Delta P T1 T2 GV R ts es,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_exprlist Delta T1 T2 GV ts es) |--
tc_exprlist Delta ts es.
Lemma msubst_tc_expropt_sound: forall {cs: compspecs} Delta P T1 T2 GV R t e,
local (tc_environ Delta) && PROPx P (LOCALx (LocalD T1 T2 GV) (SEPx R)) && ` (msubst_tc_expropt Delta T1 T2 GV e t) |--
tc_expropt Delta e t.