1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Ultima modifica: 05/08/2009 *)
21 (* ********************************************************************** *)
23 include "freescale/translation.ma".
24 include "num/byte8_lemmas.ma".
26 (* ******************************************************* *)
27 (* TRADUZIONE MCU+OPCODE+MODALITA'+ARGOMENTI → ESADECIMALE *)
28 (* ******************************************************* *)
30 nlemma tbyte8_destruct : ∀m,b1,b2.TByte m b1 = TByte m b2 → b1 = b2.
32 nchange with (match TByte m b2 with [ TByte a ⇒ b1 = a ]);
38 nlemma symmetric_eqtbyte8 : ∀m.∀tb1,tb2:t_byte8 m.eq_tbyte8 m tb1 tb2 = eq_tbyte8 m tb2 tb1.
39 #m; #tb1; nelim tb1; #b1; #tb2; nelim tb2; #b2;
40 nchange with ((eq_b8 b1 b2) = (eq_b8 b2 b1));
41 napply (symmetric_eqb8 b1 b2).
44 nlemma eqtbyte8_to_eq : ∀m.∀tb1,tb2:t_byte8 m.eq_tbyte8 m tb1 tb2 = true → tb1 = tb2.
45 #m; #tb1; nelim tb1; #b1; #tb2; nelim tb2; #b2;
46 nchange with ((eq_b8 b1 b2 = true) → ?);
48 nrewrite > (eqb8_to_eq b1 b2 H);
52 nlemma eq_to_eqtbyte8 : ∀m.∀tb1,tb2:t_byte8 m.tb1 = tb2 → eq_tbyte8 m tb1 tb2 = true.
53 #m; #tb1; nelim tb1; #b1; #tb2; nelim tb2; #b2;
54 nchange with (? → (eq_b8 b1 b2 = true));
56 nrewrite > (tbyte8_destruct m … H);
57 nrewrite > (eq_to_eqb8 b2 b2 (refl_eq …));
61 nlemma decidable_tbyte8 : ∀m.∀x,y:t_byte8 m.decidable (x = y).
62 #m; #x; nelim x; #e1; #y; nelim y; #e2;
64 napply (or2_elim (? = ?) (? ≠ ?) ? (decidable_b8 e1 e2) …);
65 ##[ ##2: #H; napply (or2_intro2 (? = ?) (? ≠ ?) … ); nnormalize; #H1; napply (H (tbyte8_destruct m … H1))
66 ##| ##1: #H; nrewrite > H; napply (or2_intro1 (? = ?) (? ≠ ?) (refl_eq …))
70 nlemma neqtbyte8_to_neq : ∀m.∀tb1,tb2:t_byte8 m.(eq_tbyte8 m tb1 tb2 = false) → (tb1 ≠ tb2).
71 #m; #tb1; nelim tb1; #b1; #tb2; nelim tb2; #b2;
72 nchange with (((eq_b8 b1 b2) = false) → ?);
76 napply (neqb8_to_neq … H);
77 napply (tbyte8_destruct m … H1).
80 nlemma neq_to_neqtbyte8 : ∀m.∀tb1,tb2:t_byte8 m.tb1 ≠ tb2 → eq_tbyte8 m tb1 tb2 = false.
81 #m; #tb1; nelim tb1; #b1; #tb2; nelim tb2; #b2;
82 #H; nchange with ((eq_b8 b1 b2) = false);
83 napply (neq_to_neqb8 b1 b2 ?);
86 nrewrite > H1 in H:(%); #H;
87 napply (H (refl_eq …)).