Skip to content
Snippets Groups Projects
Commit 3e88b516 authored by Pierre Courtieu's avatar Pierre Courtieu
Browse files

Removing the type class for number of robots.

This is to be discussed. Let us leave it as before for now.
parent 41dc107c
No related branches found
No related tags found
No related merge requests found
...@@ -125,12 +125,10 @@ Qed. ...@@ -125,12 +125,10 @@ Qed.
Section Robots. Section Robots.
Context (n m : nat) {ln lm : nat} {ltc_l_n : ln <c n} {ltc_l_m : lm <c m}.
(** Given a number of correct and Byzantine robots, we can build canonical names. (** Given a number of correct and Byzantine robots, we can build canonical names.
It is not declared as a global instance to avoid creating spurious settings. *) It is not declared as a global instance to avoid creating spurious settings. *)
Definition Robots : Names. Definition Robots (n m : nat) : Names.
Proof using n m. Proof using .
refine {| refine {|
nG := n; nG := n;
nB := m; nB := m;
...@@ -149,37 +147,45 @@ Proof using n m. ...@@ -149,37 +147,45 @@ Proof using n m.
+ intros ? ?. apply enum_eq. + intros ? ?. apply enum_eq.
+ intros ? ?. apply enum_eq. + intros ? ?. apply enum_eq.
Defined. Defined.
Global Opaque G B. Global Opaque G B.
(* TODO: discuss this
Section NM.
Notation G := (@G Robots). Variables n m: nat.
Notation B := (@B Robots).
Lemma G_Robots : G = fin n. Notation GRob := (@G (Robots n m)).
Notation BRob := (@B (Robots n m)).
Lemma GRob_Robots : GRob = fin n.
Proof using . reflexivity. Qed. Proof using . reflexivity. Qed.
Lemma B_Robots : B = fin m. Lemma BRob_Robots : BRob = fin m.
Proof using . reflexivity. Qed. Proof using . reflexivity. Qed.
Lemma G_Robots_eq_iff : g1 g2 : G, g1 = g2 :> G <-> g1 = g2 :> fin n. Lemma GRob_Robots_eq_iff : forall g1 g2 : GRob, g1 = g2 :> GRob <-> g1 = g2 :> fin n.
Proof using . reflexivity. Qed. Proof using . reflexivity. Qed.
Lemma B_Robots_eq_iff : b1 b2 : B, b1 = b2 :> B <-> b1 = b2 :> fin m. Lemma BRob_Robots_eq_iff : forall b1 b2 : BRob, b1 = b2 :> BRob <-> b1 = b2 :> fin m.
Proof using . reflexivity. Qed. Proof using . reflexivity. Qed.
Definition good0 : G := fin0. Definition good0 : GRob := fin0.
Definition byz0 : BRob := fin0.
Definition byz0 : B := fin0. Lemma all_good0 : forall g : GRob, n = 1 -> g = good0.
Proof using . intros * H. rewrite GRob_Robots_eq_iff. apply all_fin0, H. Qed.
Lemma all_good0 : g : G, n = 1 -> g = good0. Lemma all_good_eq : forall g1 g2 : GRob, n = 1 -> g1 = g2.
Proof using . intros * H. rewrite G_Robots_eq_iff. apply all_fin0, H. Qed. Proof using ltc_l_n. intros * H. rewrite GRob_Robots_eq_iff. apply all_eq, H. Qed.
Lemma all_good_eq : g1 g2 : G, n = 1 -> g1 = g2. Lemma all_byz0 : forall b : BRob, m = 1 -> b = byz0.
Proof using ltc_l_n. intros * H. rewrite G_Robots_eq_iff. apply all_eq, H. Qed. Proof using . intros * H. rewrite BRob_Robots_eq_iff. apply all_fin0, H. Qed.
Lemma all_byz0 : b : B, m = 1 -> b = byz0. Lemma all_byz_eq : forall b1 b2 : BRob, m = 1 -> b1 = b2.
Proof using . intros * H. rewrite B_Robots_eq_iff. apply all_fin0, H. Qed. Proof using ltc_l_m. intros * H. rewrite BRob_Robots_eq_iff. apply all_eq, H. Qed.
End NM.
Lemma all_byz_eq : b1 b2 : B, m = 1 -> b1 = b2. *)
Proof using ltc_l_m. intros * H. rewrite B_Robots_eq_iff. apply all_eq, H. Qed.
End Robots. End Robots.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment