(* calcul des automates modifiés *)

Fixpoint upl_conv_0 (p : prec_list) : prec_list :=
  match p with
  | prec_empty => prec_empty
  | prec_cons a p0 p1 =>
      prec_cons (uad_conv_0 a) (upl_conv_0 p0) (upl_conv_0 p1)
  end.Fixpoint upl_conv_1 (p : prec_list) : prec_list :=
  match p with
  | prec_empty => prec_empty
  | prec_cons a p0 p1 =>
      prec_cons (uad_conv_1 a) (upl_conv_1 p0) (upl_conv_1 p1)
  end.Fixpoint umpl_conv_0 (s : state) : state :=
  match s with
  | M0 => M0 prec_list
  | M1 a p => M1 prec_list a (upl_conv_0 p)
  | M2 p0 p1 => M2 prec_list (umpl_conv_0 p0) (umpl_conv_0 p1)
  end.Fixpoint umpl_conv_1 (s : state) : state :=
  match s with
  | M0 => M0 prec_list
  | M1 a p => M1 prec_list a (upl_conv_1 p)
  | M2 p0 p1 => M2 prec_list (umpl_conv_1 p0) (umpl_conv_1 p1)
  end.Fixpoint udta_conv_0_aux (d : preDTA) : preDTA :=
  match d with
  | M0 => M0 state
  | M1 a s => M1 state a (umpl_conv_0 s)
  | M2 s0 s1 => M2 state (udta_conv_0_aux s0) (udta_conv_0_aux s1)
  end.Fixpoint udta_conv_1_aux (d : preDTA) : preDTA :=
  match d with
  | M0 => M0 state
  | M1 a s => M1 state a (umpl_conv_1 s)
  | M2 s0 s1 => M2 state (udta_conv_1_aux s0) (udta_conv_1_aux s1)
  end.Definition udta_conv_0 (d : preDTA) : preDTA :=
  M2 state (udta_conv_0_aux d) (M0 state).Definition udta_conv_1 (d : preDTA) : preDTA :=
  M2 state (M0 state) (udta_conv_1_aux d).

(* Specifications: *)
Lemma upl_conv_0_inj : forall p0 p1 : prec_list, upl_conv_0 p0 = upl_conv_0 p1 -> p0 = p1.
Lemma upl_conv_1_inj : forall p0 p1 : prec_list, upl_conv_1 p0 = upl_conv_1 p1 -> p0 = p1.
Lemma umpl_conv_0_inj : forall s0 s1 : state, umpl_conv_0 s0 = umpl_conv_0 s1 -> s0 = s1.
Lemma umpl_conv_1_inj : forall s0 s1 : state, umpl_conv_1 s0 = umpl_conv_1 s1 -> s0 = s1.
Lemma upl_conv_0_img : forall (p : prec_list) (a : ad) (la ls : prec_list), upl_conv_0 p = prec_cons a la ls -> exists a0 : ad, (exists la0 : prec_list, (exists ls0 : prec_list, p = prec_cons a0 la0 ls0)).
Lemma upl_conv_0_img_0 : forall (p : prec_list) (a : ad) (la ls : prec_list), upl_conv_0 p = prec_cons a la ls -> exists a0 : ad, (exists la0 : prec_list, (exists ls0 : prec_list, p = prec_cons a0 la0 ls0 /\ a = uad_conv_0 a0 /\ la = upl_conv_0 la0 /\ ls = upl_conv_0 ls0)).
Lemma upl_conv_0_img_1 : forall p : prec_list, upl_conv_0 p = prec_empty -> p = prec_empty.
Lemma upl_conv_1_img : forall (p : prec_list) (a : ad) (la ls : prec_list), upl_conv_1 p = prec_cons a la ls -> exists a0 : ad, (exists la0 : prec_list, (exists ls0 : prec_list, p = prec_cons a0 la0 ls0)).
Lemma upl_conv_1_img_0 : forall (p : prec_list) (a : ad) (la ls : prec_list), upl_conv_1 p = prec_cons a la ls -> exists a0 : ad, (exists la0 : prec_list, (exists ls0 : prec_list, p = prec_cons a0 la0 ls0 /\ a = uad_conv_1 a0 /\ la = upl_conv_1 la0 /\ ls = upl_conv_1 ls0)).
Lemma upl_conv_1_img_1 : forall p : prec_list, upl_conv_1 p = prec_empty -> p = prec_empty.
Lemma u_conv_0_invar_0 : forall (d : preDTA) (a : ad) (ladj : state), MapGet state d a = Some ladj -> MapGet state (udta_conv_0 d) (uad_conv_0 a) = Some (umpl_conv_0 ladj).
Lemma u_conv_0_invar_1 : forall (s : state) (c : ad) (p : prec_list), MapGet prec_list s c = Some p -> MapGet prec_list (umpl_conv_0 s) c = Some (upl_conv_0 p).
Lemma u_conv_0_invar_2 : forall (d : preDTA) (a : ad) (ladj : state), MapGet state (udta_conv_0 d) (uad_conv_0 a) = Some (umpl_conv_0 ladj) -> MapGet state d a = Some ladj.
Lemma u_conv_0_invar_3 : forall (s : state) (c : ad) (p : prec_list), MapGet prec_list (umpl_conv_0 s) c = Some (upl_conv_0 p) -> MapGet prec_list s c = Some p.
Lemma u_conv_0_invar_4 : forall (d : preDTA) (a : ad) (ladj : state), MapGet state (udta_conv_0 d) (uad_conv_0 a) = Some ladj -> exists ladj0 : _, ladj = umpl_conv_0 ladj0.
Lemma u_conv_0_invar_5 : forall (d : preDTA) (a : ad) (ladj : state), MapGet state (udta_conv_0 d) (uad_conv_0 a) = Some ladj -> exists ladj0 : _, ladj = umpl_conv_0 ladj0 /\ MapGet state d a = Some ladj0.
Lemma u_conv_0_invar_6 : forall (s : state) (c : ad) (p : prec_list), MapGet prec_list (umpl_conv_0 s) c = Some p -> exists p0 : prec_list, p = upl_conv_0 p0.
Lemma u_conv_0_invar_7 : forall (s : state) (c : ad) (p : prec_list), MapGet prec_list (umpl_conv_0 s) c = Some p -> exists p0 : prec_list, p = upl_conv_0 p0 /\ MapGet prec_list s c = Some p0.
Lemma u_conv_0_invar_8 : forall (p0 : preDTA) (a0 : ad) (s0 : state), MapGet state (udta_conv_0 p0) a0 = Some s0 -> exists a1 : ad, a0 = uad_conv_0 a1.