Definition default_val_fix_aux (y: type): (forall x, TypeTree.typeR x y -> reptype x) -> reptype y.Definition default_val: forall (t: type), reptype t := Fix TypeTree.wf_typeR reptype default_val_fix_aux.Inductive ForallT {A : Type} (P : A -> Type) : list A -> Type :=
    ForallT_nil : ForallT P nil
  | ForallT_cons : forall (x : A) (l : list A),
                  P x -> ForallT P l -> ForallT P (x :: l).Inductive ForallT {A : Type} (P : A -> Type) : list A -> Type :=
    ForallT_nil : ForallT P nil
  | ForallT_cons : forall (x : A) (l : list A),
                  P x -> ForallT P l -> ForallT P (x :: l).Inductive ForallT {A : Type} (P : A -> Type) : list A -> Type :=
    ForallT_nil : ForallT P nil
  | ForallT_cons : forall (x : A) (l : list A),
                  P x -> ForallT P l -> ForallT P (x :: l).Inductive acc_type: type -> Type :=
  | acc_Tint: acc_type Tint
  | acc_Tstruct: forall id, ForallT (fun p => acc_type (snd p)) (co_members (get_co id)) -> acc_type (Tstruct id).Inductive acc_type: type -> Type :=
  | acc_Tint: acc_type Tint
  | acc_Tstruct: forall id, ForallT (fun p => acc_type (snd p)) (co_members (get_co id)) -> acc_type (Tstruct id).Inductive acc_type: type -> Type :=
  | acc_Tint: acc_type Tint
  | acc_Tstruct: forall id, ForallT (fun p => acc_type (snd p)) (co_members (get_co id)) -> acc_type (Tstruct id).Fixpoint P_members (m: members) (wit_m: ForallT (fun p => acc_type (snd p)) m): Prop :=
  match wit_m with
  | ForallT_nil => True
  | ForallT_cons (i, t) m0 wit_t wit_m0 => P t wit_t /\ P_members m0 wit_m0
  end.Fixpoint acc_type__ind (t: type) (wit_t: acc_type t): P t wit_t :=
  match wit_t as wit_t_PAT in acc_type t_PAT
    return P t_PAT wit_t_PAT
  with
  | acc_Tint => P_Tint
  | acc_Tstruct sid wit =>
      P_Tstruct sid wit
      ((fix acc_type_ind_members (m: members) (wit_m: ForallT (fun p => acc_type (snd p)) m): P_members m wit_m :=
        match wit_m as wit_m_PAT in ForallT _ m_PAT
          return P_members m_PAT wit_m_PAT
        with
        | ForallT_nil => I
        | ForallT_cons (i0, t0) m0 wit_t0 wit_m0 => conj (acc_type__ind t0 wit_t0) (acc_type_ind_members m0 wit_m0)
        end) (co_members (get_co sid)) wit)
  end.Definition acc_type_gen (t: type): acc_type t.Fixpoint reptype_aux (t: type) (wit_t: acc_type t): Type :=
  match wit_t in acc_type t_PAT with
  | acc_Tint => val
  | acc_Tstruct id wit_id =>
     (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) (co_members (get_co id)) wit_id
  end.Definition reptype (t: type) := reptype_aux t (acc_type_gen t).

(* Specifications: *)
Lemma reptype_eq: forall t: type, reptype t = match t with | Tint => val | Tstruct id => (fix reptype_members (m: members): Type := match m with | nil => unit | cons (_, t0) m0 => (reptype t0 * reptype_members m0)%type end) (co_members (get_co id)) end.