assert (t = t0) by auto with expr_beq.
assert (i = i0) by auto with expr_beq.
assert (X := types.listspec_ext). subst.
specialize (X t0 i0 l l0).
subst; auto.
Qed. *)
Hint Resolve sep_beq_sound : expr_beq.
Definition type_bool_eq (a b : Ctypes.type * bool) :=
match a, b with
| (t1, b1), (t2, b2) => andb (expr.eqb_type t1 t2)
match b1, b2 with
| true, true | false, false => true
| _, _ => false
end
end.
Definition type_bool_eq_sound : forall a b,
type_bool_eq a b = true-> a = b.
intros. destruct a, b.
solve_expr_beq_sound.
destruct b, b0; simpl in H0; congruence.
Qed.
Definition smx_beq a b :=
match a, b with
| fsemax, fsemax
| fnormal_ret_assert, fnormal_ret_assert
| fassertD, fassertD => true
| flocalD , flocalD => true
| fstatement s1, fstatement s2 => statement_beq s1 s2
| ftycontext t1 l1 r1 gt1, ftycontext t2 l2 r2 gt2  =>
andb (ptree_cmp t1 t2 type_bool_eq)
(andb (ptree_cmp l1 l2 expr.eqb_type)
(andb (expr.eqb_type r1 r2)
(ptree_cmp gt1 gt2 expr.eqb_type)))
| flater, flater => true
| flater_lift, flater_lift => true
| fnested_field_type2, fnested_field_type2 => true
| fis_neutral_cast, fis_neutral_cast => true
| fmsubst_efield_denote efs1, fmsubst_efield_denote efs2 => list_eqb RelDec_efield_beq efs1 efs2
| flegal_nested_efield tts1, flegal_nested_efield tts2 => list_eqb RelDec_ctype_beq tts1 tts2
| fmsubst_eval_LR, fmsubst_eval_LR => true
| ftc_LR_b_norho, ftc_LR_b_norho => true
| ftc_environ, ftc_environ => true
| ftc_efield_b_norho efs1, ftc_efield_b_norho efs2 => list_eqb RelDec_efield_beq efs1 efs2
| fnested_efield, fnested_efield => true
| ftypeof_temp, ftypeof_temp => true
| ftc_val, ftc_val => true
| flegal_nested_field, flegal_nested_field => true
| fstruct_field, fstruct_field => true
| funion_field, funion_field => true
| farray_subsc, farray_subsc => true
| fwritable_share, fwritable_share => true
| fTsh, fTsh => true
| fEws, fEws => true
| ftype_is_by_value, ftype_is_by_value => true
| _, _ => false
end.
Hint Resolve statement_beq_sound : expr_beq.

Lemma smx_beq_sound : forall a b, smx_beq a b = true -> a = b.
Hint Resolve smx_beq_sound : expr_beq.