(* conservation de l'invariant ref_ok pour l'union *)

(* Specifications: *)
Lemma upl_conv_0_ref_ok_invar :
forall (p : prec_list) (a : ad),
prec_occur (upl_conv_0 p) a ->
exists b : ad, a = uad_conv_0 b /\ prec_occur p b.
Lemma upl_conv_1_ref_ok_invar :
forall (p : prec_list) (a : ad),
prec_occur (upl_conv_1 p) a ->
exists b : ad, a = uad_conv_1 b /\ prec_occur p b.
Lemma udta_conv_0_ref_ok_invar_0 :
forall (d : preDTA) (a : ad) (s : state) (c : ad) (p : prec_list) (b : ad),
MapGet state (udta_conv_0 d) (uad_conv_0 a) = Some s ->
MapGet prec_list s c = Some p ->
prec_occur p b ->
exists s' : state,
(exists p' : prec_list,
(exists b' : ad,
MapGet state d a = Some s' /\
MapGet prec_list s' c = Some p' /\
p = upl_conv_0 p' /\
s = umpl_conv_0 s' /\ b = uad_conv_0 b' /\ prec_occur p' b')).
Lemma udta_conv_1_ref_ok_invar_0 :
forall (d : preDTA) (a : ad) (s : state) (c : ad) (p : prec_list) (b : ad),
MapGet state (udta_conv_1 d) (uad_conv_1 a) = Some s ->
MapGet prec_list s c = Some p ->
prec_occur p b ->
exists s' : state,
(exists p' : prec_list,
(exists b' : ad,
MapGet state d a = Some s' /\
MapGet prec_list s' c = Some p' /\
p = upl_conv_1 p' /\
s = umpl_conv_1 s' /\ b = uad_conv_1 b' /\ prec_occur p' b')).
Lemma udta_conv_0_ref_ok_invar :
forall d : preDTA, preDTA_ref_ok d -> preDTA_ref_ok (udta_conv_0 d).
Lemma udta_conv_1_ref_ok_invar :
forall d : preDTA, preDTA_ref_ok d -> preDTA_ref_ok (udta_conv_1 d).
Lemma MapMerge_ref_ok_invar :
forall d0 d1 : preDTA,
preDTA_ref_ok d0 -> preDTA_ref_ok d1 -> preDTA_ref_ok (MapMerge state d0 d1).
Lemma u_merge_ref_ok_invar :
forall d0 d1 : preDTA,
preDTA_ref_ok d0 -> preDTA_ref_ok d1 -> preDTA_ref_ok (u_merge d0 d1).
Lemma union_pl_ref_ok_invar :
forall (p p' : prec_list) (d : preDTA),
prec_list_ref_ok p d ->
prec_list_ref_ok p' d -> prec_list_ref_ok (union_pl p p') d.
Lemma union_mpl_0_ref_ok_invar :
forall (s : state) (a : ad) (p : prec_list) (d : preDTA),
state_ref_ok (M1 prec_list a p) d ->
state_ref_ok s d -> state_ref_ok (union_mpl_0 a p s) d.
Lemma union_mpl_correct_ref_ok_invar :
forall (s0 s1 : state) (d : preDTA),
state_ref_ok s0 d -> state_ref_ok s1 d -> state_ref_ok (union_mpl s0 s1) d.
Lemma union_ref_ok :
forall d0 d1 : DTA,
DTA_ref_ok d0 -> DTA_ref_ok d1 -> DTA_ref_ok (union d0 d1).