(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(* une relation de compatibilité entre automates *)
Definition pl_compat (pl0 pl1 : prec_list) : Prop :=
pl0 = prec_empty /\ pl1 = prec_empty \/
pl0 <> prec_empty /\ pl1 <> prec_empty.
Definition mpl_compat (s0 s1 : state) : Prop :=
forall (c : ad) (p0 p1 : prec_list),
MapGet prec_list s0 c = Some p0 ->
MapGet prec_list s1 c = Some p1 -> pl_compat p0 p1.
Definition dta_correct (d : preDTA) : Prop :=
forall (s0 s1 : state) (a0 a1 : ad),
MapGet state d a0 = Some s0 ->
MapGet state d a1 = Some s1 -> mpl_compat s0 s1.
Definition dta_compat (d0 d1 : preDTA) : Prop :=
forall (s0 s1 : state) (a0 a1 : ad),
MapGet state d0 a0 = Some s0 ->
MapGet state d1 a1 = Some s1 -> mpl_compat s0 s1.
Definition DTA_compat (d0 d1 : DTA) : Prop :=
match d0, d1 with
| dta p0 a0, dta p1 a1 => dta_compat p0 p1
end.
(* débuts des lemmes mpl_compat, suite dans le fichier union.v *)

(* Specifications: *)
Lemma pl_compat_sym :
forall pl0 pl1 : prec_list, pl_compat pl0 pl1 -> pl_compat pl1 pl0.
Lemma mpl_compat_0 :
forall (c : ad) (pl0 pl1 : prec_list),
mpl_compat (M1 prec_list c pl0) (M1 prec_list c pl1) -> pl_compat pl0 pl1.
Lemma mpl_compat_1 :
forall s0 s1 s2 s3 : state,
mpl_compat (M2 prec_list s0 s1) (M2 prec_list s2 s3) -> mpl_compat s0 s2.
Lemma mpl_compat_2 :
forall s0 s1 s2 s3 : state,
mpl_compat (M2 prec_list s0 s1) (M2 prec_list s2 s3) -> mpl_compat s1 s3.
Lemma mpl_compat_3 :
forall (s0 s1 : state) (pl : prec_list),
mpl_compat (M2 prec_list s0 s1) (M1 prec_list N0 pl) ->
mpl_compat s0 (M1 prec_list N0 pl).
Lemma mpl_compat_4 :
forall (s0 s1 : state) (pl : prec_list),
mpl_compat (M2 prec_list s0 s1) (M1 prec_list (Npos 1) pl) ->
mpl_compat s1 (M1 prec_list N0 pl).
Lemma mpl_compat_5 :
forall (s0 s1 : state) (pl : prec_list) (p : positive),
mpl_compat (M2 prec_list s0 s1) (M1 prec_list (Npos (xO p)) pl) ->
mpl_compat s0 (M1 prec_list (Npos p) pl).
Lemma mpl_compat_6 :
forall (s0 s1 : state) (pl : prec_list) (p : positive),
mpl_compat (M2 prec_list s0 s1) (M1 prec_list (Npos (xI p)) pl) ->
mpl_compat s1 (M1 prec_list (Npos p) pl).