]> matita.cs.unibo.it Git - helm.git/blobdiff - 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
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma
new file mode 100755 (executable)
index 0000000..39a9baf
--- /dev/null
@@ -0,0 +1,97 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* ********************************************************************** *)
+(*                           Progetto FreeScale                           *)
+(*                                                                        *)
+(* Sviluppato da:                                                         *)
+(*   Cosimo Oliboni, oliboni@cs.unibo.it                                  *)
+(*                                                                        *)
+(* Questo materiale fa parte della tesi:                                  *)
+(*   "Formalizzazione Interattiva dei Microcontroller a 8bit FreeScale"   *)
+(*                                                                        *)
+(*                    data ultima modifica 15/11/2007                     *)
+(* ********************************************************************** *)
+
+include "freescale/bool_lemmas.ma".
+include "freescale/opcode_base.ma".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+ndefinition mcu_type_destruct :
+ Πm1,m2:mcu_type.ΠP:Prop.m1 = m2 →
+ match m1 with
+  [ HC05 ⇒ match m2 with [ HC05 ⇒ P → P | _ ⇒ P ]
+  | HC08 ⇒ match m2 with [ HC08 ⇒ P → P | _ ⇒ P ]
+  | HCS08 ⇒ match m2 with [ HCS08 ⇒ P → P | _ ⇒ P ]
+  | RS08 ⇒ match m2 with [ RS08 ⇒ P → P | _ ⇒ P ]
+  ].
+ #m1; #m2; #P;
+ nelim m1;
+ ##[ ##1: nelim m2; nnormalize; #H;
+          ##[ ##1: napply (λx:P.x)
+          ##| ##*: napply (False_ind ??);
+                   nchange with (match HC05 with [ HC05 ⇒ False | _ ⇒ True ]);
+                   nrewrite > H; nnormalize; napply I
+          ##]
+ ##| ##2: nelim m2; nnormalize; #H;
+          ##[ ##2: napply (λx:P.x)
+          ##| ##*: napply (False_ind ??);
+                   nchange with (match HC08 with [ HC08 ⇒ False | _ ⇒ True ]);
+                   nrewrite > H; nnormalize; napply I
+          ##]
+ ##| ##3: nelim m2; nnormalize; #H;
+          ##[ ##3: napply (λx:P.x)
+          ##| ##*: napply (False_ind ??);
+                   nchange with (match HCS08 with [ HCS08 ⇒ False | _ ⇒ True ]);
+                   nrewrite > H; nnormalize; napply I
+          ##]
+ ##| ##4: nelim m2; nnormalize; #H;
+          ##[ ##4: napply (λx:P.x)
+          ##| ##*: napply (False_ind ??);
+                   nchange with (match RS08 with [ RS08 ⇒ False | _ ⇒ True ]);
+                   nrewrite > H; nnormalize; napply I
+          ##]
+ ##]
+nqed.
+
+nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype.
+ #m1; #m2;
+ nelim m1;
+ nelim m2;
+ nnormalize;
+ napply (refl_eq ??).
+nqed.
+
+nlemma eqmcutype_to_eq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = true) → (m1 = m2).
+ #m1; #m2;
+ ncases m1;
+ ncases m2;
+ nnormalize;
+ ##[ ##1,6,11,16: #H; napply (refl_eq ??)
+ ##| ##*: #H; napply (bool_destruct ??? H)
+ ##]
+nqed.
+
+nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true.
+ #m1; #m2;
+ ncases m1;
+ ncases m2;
+ nnormalize;
+ ##[ ##1,6,11,16: #H; napply (refl_eq ??)
+ ##| ##*: #H; napply (mcu_type_destruct ??? H)
+ ##]
+nqed.