(* field_offset2_in_range union's version *)

(* Specifications: *)
(* if sizeof Tvoid = 0, this lemma can be nicer. *)
Lemma field_offset_no_overlap:
forall i1 i2 m,
i1 <> i2 ->
in_members i1 m ->
in_members i2 m ->
field_offset cenv_cs i1 m + sizeof (field_type i1 m) <= field_offset cenv_cs i2 m \/
field_offset cenv_cs i2 m + sizeof (field_type i2 m) <= field_offset cenv_cs i1 m.
Lemma not_in_members_field_type: forall i m,
~ in_members i m ->
field_type i m = Tvoid.
Lemma not_in_members_field_offset: forall i m,
~ in_members i m ->
field_offset cenv_cs i m = 0.
Lemma field_offset_next_in_range: forall i m sz,
in_members i m ->
sizeof_struct cenv_cs 0 m <= sz ->
field_offset cenv_cs i m + sizeof (field_type i m) <=
field_offset_next cenv_cs i m sz <= sz.
Lemma Pos_eqb_eq: forall p q: positive, iff (eq (Pos.eqb p q) true) (eq p q).
Lemma neq_field_offset_next_rec_cons: forall env i i0 t0 i1 t1 m z sz,
i <> i0 ->
field_offset_next_rec env i ((i0, t0) :: (i1, t1) :: m) z sz =
field_offset_next_rec env i ((i1, t1) :: m) (align (z +  sizeof t0) (alignof t1)) sz.
Lemma sizeof_struct_0: forall env i m,
sizeof_struct env 0 m = 0 ->
in_members i m ->
sizeof (field_type i m) = 0 /\
field_offset_next env i m 0 - (field_offset env i m + sizeof (field_type i m)) = 0.
Lemma sizeof_union_0: forall env i m,
sizeof_union env m = 0 ->
in_members i m ->
sizeof (field_type i m) = 0.