Definition field_address t gfs p :=
if (field_compatible_dec t gfs p)
then offset_val (nested_field_offset t gfs) p
else Vundef.
Definition field_address0 t gfs p :=
if (field_compatible0_dec t gfs p)
then offset_val (nested_field_offset t gfs) p
else Vundef.

(* TODO: not useful any longer *)
(* Lemma gfield_type_complete_type: forall t gf, legal_field t gf -> complete_type cenv_cs t = true -> complete_type cenv_cs (gfield_type t gf) = true.  Lemma gfield_array_type_complete_type: forall t lo hi, legal_field0 t (ArraySubsc lo) -> complete_type cenv_cs t = true -> complete_type cenv_cs (gfield_array_type t lo hi) = true.  Lemma nested_field_type_complete_type: forall t gfs, legal_nested_field t gfs -> complete_type cenv_cs t = true -> complete_type cenv_cs (nested_field_type t gfs) = true.  Lemma nested_field_array_type_complete_type: forall t gfs lo hi, legal_nested_field0 t (ArraySubsc lo :: gfs) -> complete_type cenv_cs t = true -> complete_type cenv_cs (nested_field_array_type t gfs lo hi) = true. *)
Lemma gfield_type_nested_pred: forall {atom_pred: type -> bool}, atom_pred Tvoid = true -> forall (t: type) (gf: gfield),
nested_pred atom_pred t = true -> nested_pred atom_pred (gfield_type t gf) = true.