Fixpoint default_val_aux (t: type) (wit_t: acc_type t): reptype_aux t wit_t :=
  match wit_t as wit_t_PAT in acc_type t_PAT return reptype_aux t_PAT wit_t_PAT with
  | acc_Tint => Vundef
  | acc_Tstruct id wit_id =>
     (fix default_val_aux_members (m: members) (wit_m: ForallT (fun p => acc_type (snd p)) m):
        (fix reptype_aux_members (m: members) (wit_m: ForallT (fun p => acc_type (snd p)) m): Type :=
        match wit_m with
        | ForallT_nil => unit
        | ForallT_cons (_, t0) m0 wit_t0 wit_m0 => (reptype_aux t0 wit_t0 * reptype_aux_members m0 wit_m0)%type
        end) m wit_m :=
        match wit_m  as wit_m_PAT in (ForallT _ m_PAT) return (fix reptype_aux_members (m: members) (wit_m: ForallT (fun p => acc_type (snd p)) m): Type :=
        match wit_m with
        | ForallT_nil => unit
        | ForallT_cons (_, t0) m0 wit_t0 wit_m0 => (reptype_aux t0 wit_t0 * reptype_aux_members m0 wit_m0)%type
        end) m_PAT wit_m_PAT with
        | ForallT_nil => tt
        | ForallT_cons (_, t0) m0 wit_t0 wit_m0 => (default_val_aux t0 wit_t0, default_val_aux_members m0 wit_m0)%type
        end) (co_members (get_co id)) wit_id
  end.Definition default_val (t: type): reptype t := default_val_aux t (acc_type_gen t).Definition typeR (t1: type) (t2: type): Prop := (rank_type cenv_cs t1 < rank_type cenv_cs t2)%nat.

(* Specifications: *)
Lemma wf_typeR: well_founded typeR.
Lemma typeR_spec_members_aux: forall (m : members), Forall (fun p : ident * type => rank_type cenv_cs (snd p) < S (rank_members cenv_cs m))%nat m.
Lemma typeR_spec_members sid: Forall (fun p => typeR (snd p) (Tstruct sid)) (co_members (get_co sid)).