(* Lemma field_compatible_complete_type: forall t path p, field_compatible t path p -> complete_type cenv_cs t = true.  Lemma field_compatible_legal_nested_field0: forall (t : type) (path : list gfield) (p : val), field_compatible t path p -> legal_nested_field0 t path.  Lemma field_compatible0_legal_nested_field0: forall (t : type) (path : list gfield) (p : val), field_compatible0 t path p -> legal_nested_field0 t path.  Lemma field_compatible_field_address: forall t gfs p, field_compatible t gfs p -> field_address t gfs p = offset_val (nested_field_offset t gfs) p.  Lemma field_compatible0_field_address0: forall t gfs p, field_compatible0 t gfs p -> field_address0 t gfs p = offset_val (nested_field_offset t gfs) p.  Lemma field_compatible_shrink: forall t_root gfsB gfsA a, field_compatible t_root (gfsB ++ gfsA) a -> field_compatible t_root gfsA a.  Lemma field_compatible0_shrink: forall t_root gfsB gfsA a, field_compatible0 t_root (gfsB ++ gfsA) a -> field_compatible0 t_root gfsA a.  Lemma field_compatible0_shrink1: forall t_root gfsB gfsA a, gfsB <> nil -> field_compatible0 t_root (gfsB ++ gfsA) a -> field_compatible t_root gfsA a.  Lemma field_compatible_app: forall gfsB t_root gfsA a, field_compatible t_root (gfsB ++ gfsA) a -> field_compatible (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a).  Lemma field_compatible0_app1: forall gfsB t_root gfsA a (NEQ: gfsB <> nil), field_compatible0 t_root (gfsB ++ gfsA) a -> field_compatible0 (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a).  Lemma field_compatible_app_inv': forall gfsB t_root gfsA a, field_compatible t_root gfsA a -> legal_nested_field (nested_field_type t_root gfsA) gfsB -> field_compatible t_root (gfsB ++ gfsA) a.  Lemma field_compatible0_app_inv': forall gfsB t_root gfsA a, field_compatible t_root gfsA a -> legal_nested_field0 (nested_field_type t_root gfsA) gfsB -> field_compatible0 t_root (gfsB ++ gfsA) a.  Lemma field_compatible_app_inv: forall gfsB t_root gfsA a, field_compatible t_root gfsA a -> field_compatible (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a) -> field_compatible t_root (gfsB ++ gfsA) a.  Lemma field_compatible0_app_inv: forall gfsB t_root gfsA a, field_compatible t_root gfsA a -> field_compatible0 (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a) -> field_compatible0 t_root (gfsB ++ gfsA) a.  Lemma field_address_app: forall t_root gfsA gfsB a, field_address t_root (gfsB ++ gfsA) a = field_address (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a).  Lemma field_address0_app: forall t_root gfsA gfsB a (NEQ: gfsB <> nil), field_address0 t_root (gfsB ++ gfsA) a = field_address0 (nested_field_type t_root gfsA) gfsB (field_address t_root gfsA a).  End COMPOSITE_ENV. (* Arguments nested_field_offset2 {cs} t gfs /. Arguments nested_field_type2 {cs} t gfs /. *)
(* Hint Resolve field_address_isptr. *)
Hint Resolve is_pointer_or_null_field_compatible.
(* Hint Extern 1 (complete_type _ _ = true) => (eapply field_compatible_complete_type; eassumption). *)
Hint Extern 1 (isptr _) => (eapply field_compatible_isptr; eassumption).
Hint Extern 1 (isptr _) => (eapply field_compatible0_isptr; eassumption).
Hint Extern 1 (legal_nested_field _ _) => (eapply field_compatible_legal_nested_field; eassumption).
Hint Extern 1 (legal_nested_field0 _ _) => (eapply field_compatible_legal_nested_field0; eassumption).
Hint Extern 1 (legal_nested_field0 _ _) => (eapply field_compatible0_legal_nested_field0; eassumption).

(* Specifications: *)
Lemma nested_field_type_preserves_change_composite: forall {cs_from cs_to} {CCE: change_composite_env cs_from cs_to} (t: type),
cs_preserve_type cs_from cs_to (coeq _ _) t = true ->
forall gfs, cs_preserve_type cs_from cs_to (coeq cs_from cs_to) (@nested_field_type cs_to t gfs) = true.
Lemma nested_field_type_change_composite: forall {cs_from cs_to} {CCE: change_composite_env cs_from cs_to} (t: type),
cs_preserve_type cs_from cs_to (coeq _ _) t = true ->
forall gfs, @nested_field_type cs_from t gfs = @nested_field_type cs_to t gfs.
Lemma legal_nested_field_change_composite: forall {cs_from cs_to} {CCE: change_composite_env cs_from cs_to} (t: type),
cs_preserve_type cs_from cs_to (coeq _ _) t = true ->
forall gfs, @legal_nested_field cs_from t gfs <-> @legal_nested_field cs_to t gfs.
Lemma field_compatible_change_composite: forall {cs_from cs_to} {CCE: change_composite_env cs_from cs_to} (t: type),
cs_preserve_type cs_from cs_to (coeq _ _) t = true ->
forall gfs p, @field_compatible cs_from t gfs p <-> @field_compatible cs_to t gfs p.
Lemma nested_field_offset_change_composite: forall {cs_from cs_to} {CCE: change_composite_env cs_from cs_to} (t: type),
cs_preserve_type cs_from cs_to (coeq _ _) t = true ->
forall gfs,
@legal_nested_field cs_from t gfs ->
@legal_nested_field cs_to t gfs ->
@nested_field_offset cs_from t gfs = @nested_field_offset cs_to t gfs.
Lemma lvar_size_compatible:
forall  {cs: compspecs} id t v rho,
locald_denote (lvar id t v) rho ->
sizeof t < Ptrofs.modulus ->
size_compatible t v.
Lemma lvar_field_compatible:
forall {cs: compspecs} id t v rho,
locald_denote (lvar id t v) rho ->
complete_legal_cosu_type t = true ->
is_aligned cenv_cs ha_env_cs la_env_cs t 0 = true ->
sizeof t < Ptrofs.modulus ->
field_compatible t nil v.
Lemma compute_in_members_e:
forall i al, compute_in_members i al = true -> in_members i al.