Ltac headptr_field_compatible :=
  match goal with H: headptr ?P |- field_compatible _ _ ?P =>
  apply headptr_field_compatible;
        [ apply H | reflexivity | | simpl; computable | apply la_env_cs_sound; reflexivity];
    apply compute_legal_nested_field_spec';
    simpl_compute_legal_nested_field;
    repeat apply Forall_cons; try apply Forall_nil
  end.

(* Specifications: *)
Lemma mapsto_data_at'' {cs: compspecs}: forall sh t v v' p, ((type_is_by_value t) && (complete_legal_cosu_type t) && (negb (type_is_volatile t)) && is_aligned cenv_cs ha_env_cs la_env_cs t 0 = true)%bool -> headptr p -> JMeq v v' -> mapsto sh t p v = data_at sh t v' p.
Lemma data_at_type_changable {cs}: forall (sh: Share.t) (t1 t2: type) v1 v2, t1 = t2 -> JMeq v1 v2 -> @data_at cs sh t1 v1 = data_at sh t2 v2.
Lemma field_at_change_composite {cs_from cs_to} {CCE: change_composite_env cs_from cs_to}: forall (sh: Share.t) (t: type) gfs v1 v2, JMeq v1 v2 -> cs_preserve_type cs_from cs_to (coeq _ _) t = true -> @field_at cs_from sh t gfs v1 = @field_at cs_to sh t gfs v2.
Lemma field_at__change_composite {cs_from cs_to} {CCE: change_composite_env cs_from cs_to}: forall (sh: Share.t) (t: type) gfs, cs_preserve_type cs_from cs_to (coeq _ _) t = true -> @field_at_ cs_from sh t gfs = @field_at_ cs_to sh t gfs.
Lemma data_at_change_composite {cs_from cs_to} {CCE: change_composite_env cs_from cs_to}: forall (sh: Share.t) (t: type) v1 v2, JMeq v1 v2 -> cs_preserve_type cs_from cs_to (coeq _ _) t = true -> @data_at cs_from sh t v1 = @data_at cs_to sh t v2.
Lemma data_at__change_composite {cs_from cs_to} {CCE: change_composite_env cs_from cs_to}: forall (sh: Share.t) (t: type), cs_preserve_type cs_from cs_to (coeq _ _) t = true -> @data_at_ cs_from sh t = @data_at_ cs_to sh t.
Lemma array_at_data_at1 {cs} : forall sh t gfs lo hi v p, lo <= hi -> field_compatible0 t (gfs SUB lo) p -> field_compatible0 t (gfs SUB hi) p -> @array_at cs sh t gfs lo hi v p = at_offset (@data_at cs sh (nested_field_array_type t gfs lo hi) v) (nested_field_offset t (ArraySubsc lo :: gfs)) p.
Lemma data_at_ext_eq {cs} sh t v v' p q: v=v' -> p=q -> @data_at cs sh t v p = @data_at cs sh t v' q.