]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma
freescale translation (work in progress)
[helm.git] / helm / software / matita / contribs / ng_assembly / freescale / opcode_base_lemmas1.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* ********************************************************************** *)
16 (*                           Progetto FreeScale                           *)
17 (*                                                                        *)
18 (* Sviluppato da:                                                         *)
19 (*   Cosimo Oliboni, oliboni@cs.unibo.it                                  *)
20 (*                                                                        *)
21 (* Questo materiale fa parte della tesi:                                  *)
22 (*   "Formalizzazione Interattiva dei Microcontroller a 8bit FreeScale"   *)
23 (*                                                                        *)
24 (*                    data ultima modifica 15/11/2007                     *)
25 (* ********************************************************************** *)
26
27 include "freescale/bool_lemmas.ma".
28 include "freescale/opcode_base.ma".
29
30 (* ********************************************** *)
31 (* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
32 (* ********************************************** *)
33
34 ndefinition mcu_type_destruct :
35  Πm1,m2:mcu_type.ΠP:Prop.m1 = m2 →
36  match m1 with
37   [ HC05 ⇒ match m2 with [ HC05 ⇒ P → P | _ ⇒ P ]
38   | HC08 ⇒ match m2 with [ HC08 ⇒ P → P | _ ⇒ P ]
39   | HCS08 ⇒ match m2 with [ HCS08 ⇒ P → P | _ ⇒ P ]
40   | RS08 ⇒ match m2 with [ RS08 ⇒ P → P | _ ⇒ P ]
41   ].
42  #m1; #m2; #P;
43  nelim m1;
44  ##[ ##1: nelim m2; nnormalize; #H;
45           ##[ ##1: napply (λx:P.x)
46           ##| ##*: napply (False_ind ??);
47                    nchange with (match HC05 with [ HC05 ⇒ False | _ ⇒ True ]);
48                    nrewrite > H; nnormalize; napply I
49           ##]
50  ##| ##2: nelim m2; nnormalize; #H;
51           ##[ ##2: napply (λx:P.x)
52           ##| ##*: napply (False_ind ??);
53                    nchange with (match HC08 with [ HC08 ⇒ False | _ ⇒ True ]);
54                    nrewrite > H; nnormalize; napply I
55           ##]
56  ##| ##3: nelim m2; nnormalize; #H;
57           ##[ ##3: napply (λx:P.x)
58           ##| ##*: napply (False_ind ??);
59                    nchange with (match HCS08 with [ HCS08 ⇒ False | _ ⇒ True ]);
60                    nrewrite > H; nnormalize; napply I
61           ##]
62  ##| ##4: nelim m2; nnormalize; #H;
63           ##[ ##4: napply (λx:P.x)
64           ##| ##*: napply (False_ind ??);
65                    nchange with (match RS08 with [ RS08 ⇒ False | _ ⇒ True ]);
66                    nrewrite > H; nnormalize; napply I
67           ##]
68  ##]
69 nqed.
70
71 nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype.
72  #m1; #m2;
73  nelim m1;
74  nelim m2;
75  nnormalize;
76  napply (refl_eq ??).
77 nqed.
78
79 nlemma eqmcutype_to_eq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = true) → (m1 = m2).
80  #m1; #m2;
81  ncases m1;
82  ncases m2;
83  nnormalize;
84  ##[ ##1,6,11,16: #H; napply (refl_eq ??)
85  ##| ##*: #H; napply (bool_destruct ??? H)
86  ##]
87 nqed.
88
89 nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true.
90  #m1; #m2;
91  ncases m1;
92  ncases m2;
93  nnormalize;
94  ##[ ##1,6,11,16: #H; napply (refl_eq ??)
95  ##| ##*: #H; napply (mcu_type_destruct ??? H)
96  ##]
97 nqed.