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: Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* ********************************************************************** *)
23 include "freescale/bool_lemmas.ma".
24 include "freescale/opcode_base.ma".
26 (* ********************************************** *)
27 (* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
28 (* ********************************************** *)
30 ndefinition mcu_type_destruct_aux ≝
31 Πm1,m2:mcu_type.ΠP:Prop.m1 = m2 →
33 [ HC05 ⇒ match m2 with [ HC05 ⇒ P → P | _ ⇒ P ]
34 | HC08 ⇒ match m2 with [ HC08 ⇒ P → P | _ ⇒ P ]
35 | HCS08 ⇒ match m2 with [ HCS08 ⇒ P → P | _ ⇒ P ]
36 | RS08 ⇒ match m2 with [ RS08 ⇒ P → P | _ ⇒ P ]
39 ndefinition mcu_type_destruct : mcu_type_destruct_aux.
42 ##[ ##1: nelim m2; nnormalize; #H;
43 ##[ ##1: napply (λx:P.x)
44 ##| ##*: napply (False_ind ??);
45 nchange with (match HC05 with [ HC05 ⇒ False | _ ⇒ True ]);
46 nrewrite > H; nnormalize; napply I
48 ##| ##2: nelim m2; nnormalize; #H;
49 ##[ ##2: napply (λx:P.x)
50 ##| ##*: napply (False_ind ??);
51 nchange with (match HC08 with [ HC08 ⇒ False | _ ⇒ True ]);
52 nrewrite > H; nnormalize; napply I
54 ##| ##3: nelim m2; nnormalize; #H;
55 ##[ ##3: napply (λx:P.x)
56 ##| ##*: napply (False_ind ??);
57 nchange with (match HCS08 with [ HCS08 ⇒ False | _ ⇒ True ]);
58 nrewrite > H; nnormalize; napply I
60 ##| ##4: nelim m2; nnormalize; #H;
61 ##[ ##4: napply (λx:P.x)
62 ##| ##*: napply (False_ind ??);
63 nchange with (match RS08 with [ RS08 ⇒ False | _ ⇒ True ]);
64 nrewrite > H; nnormalize; napply I
69 nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype.
77 nlemma eqmcutype_to_eq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = true) → (m1 = m2).
82 ##[ ##1,6,11,16: #H; napply (refl_eq ??)
83 ##| ##*: #H; napply (bool_destruct ??? H)
87 nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true.
92 ##[ ##1,6,11,16: #H; napply (refl_eq ??)
93 ##| ##*: #H; napply (mcu_type_destruct ??? H)
97 nlemma instr_mode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2.
99 nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]);
105 nlemma instr_mode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2.
107 nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]);
113 nlemma instr_mode_destruct_MODE_TNY : ∀e1,e2.MODE_TNY e1 = MODE_TNY e2 → e1 = e2.
115 nchange with (match MODE_TNY e2 with [ MODE_TNY a ⇒ e1 = a | _ ⇒ False ]);
121 nlemma instr_mode_destruct_MODE_SRT : ∀t1,t2.MODE_SRT t1 = MODE_SRT t2 → t1 = t2.
123 nchange with (match MODE_SRT t2 with [ MODE_SRT a ⇒ t1 = a | _ ⇒ False ]);