(* fonction de suppression des états non coaccessibles *)

Fixpoint non_coacc_kill (d : preDTA) (m : Map bool) {struct m} : preDTA :=
  match d, m with
  | M0, M0 => M0 state
  | M1 a s, M1 a' b => if Neqb a a' && b then M1 state a s else M0 state
  | M2 x y, M2 z t => M2 state (non_coacc_kill x z) (non_coacc_kill y t)
  | _, _ => M0 state
  end.Definition predta_kill_non_coacc (d : preDTA) (a : ad) : preDTA :=
  non_coacc_kill d (predta_coacc_states d a).Definition dta_kill_non_coacc (d : DTA) : DTA :=
  match d with
  | dta p a => dta (predta_kill_non_coacc p a) a
  end.Definition predta_kill_non_coacc_lazy (d : preDTA) 
  (a : ad) : preDTA := non_coacc_kill d (predta_coacc_states_0 d a).Definition dta_kill_non_coacc_lazy (d : DTA) : DTA :=
  match d with
  | dta p a => dta (predta_kill_non_coacc_lazy p a) a
  end.

(* Specifications: *)
Lemma kill_non_coacc_lazy_eq_kill_non_coacc : forall d : DTA, dta_kill_non_coacc_lazy d = dta_kill_non_coacc d.
Lemma non_coacc_kill_0 : forall (d : preDTA) (a : ad) (s : state) (m : Map bool), ensemble_base state d m -> MapGet state d a = Some s -> MapGet bool m a = Some true -> MapGet state (non_coacc_kill d m) a = Some s.
Lemma non_coacc_kill_1 : forall (d : preDTA) (a : ad) (s : state) (m : Map bool), ensemble_base state d m -> MapGet state (non_coacc_kill d m) a = Some s -> MapGet state d a = Some s /\ MapGet bool m a = Some true.
Lemma predta_kill_non_coacc_0 : forall (d : preDTA) (a a0 : ad) (s : state), preDTA_ref_ok d -> (MapGet state d a0 = Some s /\ coacc d a a0 <-> MapGet state (predta_kill_non_coacc d a) a0 = Some s).