From 20fdd66303330e6209059e90b6a98af71ec29567 Mon Sep 17 00:00:00 2001 From: Cosimo Oliboni Date: Tue, 14 Jul 2009 03:27:50 +0000 Subject: [PATCH] freescale porting to ng, work in progress --- .../matita/contribs/ng_assembly/depends | 46 +- .../ng_assembly/freescale/aux_bases_lemmas.ma | 1205 ++++++++++------- .../ng_assembly/freescale/bool_lemmas.ma | 6 +- .../ng_assembly/freescale/exadecim_lemmas.ma | 265 ++-- .../contribs/ng_assembly/freescale/nat.ma | 7 + .../ng_assembly/freescale/nat_lemmas.ma | 4 +- .../contribs/ng_assembly/freescale/opcode.ma | 183 +++ .../ng_assembly/freescale/opcode_base.ma | 2 +- .../freescale/opcode_base_lemmas.ma | 131 ++ .../freescale/opcode_base_lemmas1.ma | 141 +- .../opcode_base_lemmas_instrmode1.ma | 933 +++++++++++++ .../opcode_base_lemmas_instrmode2.ma | 711 ++++++++++ .../freescale/opcode_base_lemmas_opcode1.ma | 974 +++++++++++++ .../freescale/opcode_base_lemmas_opcode2.ma | 388 ++++++ .../contribs/ng_assembly/freescale/option.ma | 26 +- .../ng_assembly/freescale/option_lemmas.ma | 36 +- .../ng_assembly/freescale/prod_lemmas.ma | 8 +- .../ng_assembly/freescale/table_HC05.ma | 380 ++++++ .../ng_assembly/freescale/table_HC05_tests.ma | 97 ++ .../ng_assembly/freescale/table_HC08.ma | 477 +++++++ .../ng_assembly/freescale/table_HC08_tests.ma | 126 ++ .../ng_assembly/freescale/table_HCS08.ma | 489 +++++++ .../freescale/table_HCS08_tests.ma | 121 ++ .../ng_assembly/freescale/table_RS08.ma | 398 ++++++ .../ng_assembly/freescale/table_RS08_tests.ma | 81 ++ 25 files changed, 6568 insertions(+), 667 deletions(-) create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode1.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode2.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode1.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode2.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma create mode 100755 helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma diff --git a/helm/software/matita/contribs/ng_assembly/depends b/helm/software/matita/contribs/ng_assembly/depends index 7c36e0ac0..f8b4a6570 100644 --- a/helm/software/matita/contribs/ng_assembly/depends +++ b/helm/software/matita/contribs/ng_assembly/depends @@ -1,22 +1,36 @@ -freescale/theory.ma freescale/pts.ma +freescale/option.ma freescale/bool.ma +freescale/exadecim.ma freescale/bool.ma freescale/nat.ma freescale/prod.ma +freescale/prod.ma freescale/bool.ma +freescale/prod_lemmas.ma freescale/bool_lemmas.ma freescale/prod.ma freescale/exadecim_lemmas.ma freescale/bool_lemmas.ma freescale/exadecim.ma -freescale/word32_lemmas.ma freescale/word16_lemmas.ma freescale/word32.ma +freescale/opcode.ma freescale/opcode_base.ma +freescale/aux_bases_lemmas.ma freescale/aux_bases.ma freescale/bool_lemmas.ma freescale/bool_lemmas.ma freescale/bool.ma freescale/theory.ma +freescale/table_RS08.ma freescale/opcode.ma +freescale/word32_lemmas.ma freescale/word16_lemmas.ma freescale/word32.ma +freescale/opcode_base.ma freescale/aux_bases.ma freescale/theory.ma freescale/word16.ma +freescale/nat_lemmas.ma freescale/bool_lemmas.ma freescale/nat.ma +freescale/table_HC05_tests.ma freescale/table_HC05.ma +freescale/aux_bases.ma freescale/bool.ma freescale/nat.ma +freescale/word16_lemmas.ma freescale/byte8_lemmas.ma freescale/word16.ma +freescale/table_HCS08.ma freescale/opcode.ma +freescale/table_HC08_tests.ma freescale/table_HC08.ma +freescale/opcode_base_lemmas_instrmode1.ma freescale/aux_bases_lemmas.ma freescale/exadecim_lemmas.ma freescale/opcode_base.ma +freescale/table_RS08_tests.ma freescale/table_RS08.ma +freescale/opcode_base_lemmas_opcode1.ma freescale/bool_lemmas.ma freescale/opcode_base.ma +freescale/opcode_base_lemmas_instrmode2.ma freescale/opcode_base_lemmas_instrmode1.ma +freescale/table_HCS08_tests.ma freescale/table_HCS08.ma +freescale/opcode_base_lemmas_opcode2.ma freescale/opcode_base_lemmas_opcode1.ma +freescale/table_HC05.ma freescale/opcode.ma +freescale/opcode_base_lemmas.ma freescale/bool_lemmas.ma freescale/opcode_base.ma +freescale/option_lemmas.ma freescale/bool_lemmas.ma freescale/option.ma +freescale/word16.ma freescale/byte8.ma +freescale/nat.ma freescale/bool.ma freescale/pts.ma +freescale/table_HC08.ma freescale/opcode.ma freescale/bool.ma freescale/pts.ma +freescale/theory.ma freescale/pts.ma freescale/byte8_lemmas.ma freescale/byte8.ma freescale/exadecim_lemmas.ma freescale/pts.ma -freescale/option_lemmas.ma freescale/bool_lemmas.ma freescale/option.ma -freescale/prod_lemmas.ma freescale/bool_lemmas.ma freescale/prod.ma -freescale/aux_bases.ma freescale/bool.ma freescale/nat.ma -freescale/nat.ma freescale/bool.ma freescale/pts.ma -freescale/word32.ma freescale/word16.ma -freescale/word16.ma freescale/byte8.ma +freescale/opcode_base_lemmas1.ma freescale/opcode_base_lemmas_instrmode2.ma freescale/opcode_base_lemmas_opcode2.ma freescale/word16_lemmas.ma freescale/byte8.ma freescale/exadecim.ma -freescale/opcode_base_lemmas1.ma freescale/bool_lemmas.ma freescale/opcode_base.ma -freescale/option.ma freescale/bool.ma -freescale/aux_bases_lemmas.ma freescale/aux_bases.ma freescale/bool_lemmas.ma -freescale/prod.ma freescale/bool.ma -freescale/opcode_base.ma freescale/aux_bases.ma freescale/theory.ma freescale/word16.ma -freescale/word16_lemmas.ma freescale/byte8_lemmas.ma freescale/word16.ma -freescale/exadecim.ma freescale/bool.ma freescale/nat.ma freescale/prod.ma -freescale/nat_lemmas.ma freescale/bool_lemmas.ma freescale/nat.ma +freescale/word32.ma freescale/word16.ma diff --git a/helm/software/matita/contribs/ng_assembly/freescale/aux_bases_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/aux_bases_lemmas.ma index 55ef3df23..0cc21054b 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/aux_bases_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/aux_bases_lemmas.ma @@ -31,8 +31,8 @@ include "freescale/aux_bases.ma". (* OTTALI *) (* ****** *) -ndefinition oct_destruct : - Πn1,n2:oct.ΠP:Prop.n1 = n2 → +ndefinition oct_destruct_aux ≝ +Πn1,n2:oct.ΠP:Prop.n1 = n2 → match n1 with [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ] @@ -43,6 +43,8 @@ ndefinition oct_destruct : | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ] ]. + +ndefinition oct_destruct : oct_destruct_aux. #n1; #n2; #P; nelim n1; ##[ ##1: nelim n2; nnormalize; #H; @@ -128,8 +130,392 @@ nqed. (* BITRIGESIMALI *) (* ************* *) -ndefinition bitrigesim_destruct : - Πt1,t2:bitrigesim.ΠP:Prop.t1 = t2 → +ndefinition bitrigesim_destruct1 : +Πt2:bitrigesim.ΠP:Prop.t00 = t2 → match t2 with [ t00 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##1: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t00 with [ t00 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct2 : +Πt2:bitrigesim.ΠP:Prop.t01 = t2 → match t2 with [ t01 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##2: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t01 with [ t01 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct3 : +Πt2:bitrigesim.ΠP:Prop.t02 = t2 → match t2 with [ t02 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##3: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t02 with [ t02 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct4 : +Πt2:bitrigesim.ΠP:Prop.t03 = t2 → match t2 with [ t03 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##4: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t03 with [ t03 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct5 : +Πt2:bitrigesim.ΠP:Prop.t04 = t2 → match t2 with [ t04 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##5: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t04 with [ t04 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct6 : +Πt2:bitrigesim.ΠP:Prop.t05 = t2 → match t2 with [ t05 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##6: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t05 with [ t05 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct7 : +Πt2:bitrigesim.ΠP:Prop.t06 = t2 → match t2 with [ t06 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##7: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t06 with [ t06 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct8 : +Πt2:bitrigesim.ΠP:Prop.t07 = t2 → match t2 with [ t07 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##8: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t07 with [ t07 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct9 : +Πt2:bitrigesim.ΠP:Prop.t08 = t2 → match t2 with [ t08 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##9: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t08 with [ t08 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct10 : +Πt2:bitrigesim.ΠP:Prop.t09 = t2 → match t2 with [ t09 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##10: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t09 with [ t09 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct11 : +Πt2:bitrigesim.ΠP:Prop.t0A = t2 → match t2 with [ t0A ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##11: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0A with [ t0A ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct12 : +Πt2:bitrigesim.ΠP:Prop.t0B = t2 → match t2 with [ t0B ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##12: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0B with [ t0B ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct13 : +Πt2:bitrigesim.ΠP:Prop.t0C = t2 → match t2 with [ t0C ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##13: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0C with [ t0C ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct14 : +Πt2:bitrigesim.ΠP:Prop.t0D = t2 → match t2 with [ t0D ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##14: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0D with [ t0D ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct15 : +Πt2:bitrigesim.ΠP:Prop.t0E = t2 → match t2 with [ t0E ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##15: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0E with [ t0E ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct16 : +Πt2:bitrigesim.ΠP:Prop.t0F = t2 → match t2 with [ t0F ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##16: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t0F with [ t0F ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct17 : +Πt2:bitrigesim.ΠP:Prop.t10 = t2 → match t2 with [ t10 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##17: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t10 with [ t10 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct18 : +Πt2:bitrigesim.ΠP:Prop.t11 = t2 → match t2 with [ t11 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##18: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t11 with [ t11 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct19 : +Πt2:bitrigesim.ΠP:Prop.t12 = t2 → match t2 with [ t12 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##19: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t12 with [ t12 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct20 : +Πt2:bitrigesim.ΠP:Prop.t13 = t2 → match t2 with [ t13 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##20: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t13 with [ t13 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct21 : +Πt2:bitrigesim.ΠP:Prop.t14 = t2 → match t2 with [ t14 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##21: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t14 with [ t14 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct22 : +Πt2:bitrigesim.ΠP:Prop.t15 = t2 → match t2 with [ t15 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##22: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t15 with [ t15 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct23 : +Πt2:bitrigesim.ΠP:Prop.t16 = t2 → match t2 with [ t16 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##23: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t16 with [ t16 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct24 : +Πt2:bitrigesim.ΠP:Prop.t17 = t2 → match t2 with [ t17 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##24: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t17 with [ t17 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct25 : +Πt2:bitrigesim.ΠP:Prop.t18 = t2 → match t2 with [ t18 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##25: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t18 with [ t18 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct26 : +Πt2:bitrigesim.ΠP:Prop.t19 = t2 → match t2 with [ t19 ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##26: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t19 with [ t19 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct27 : +Πt2:bitrigesim.ΠP:Prop.t1A = t2 → match t2 with [ t1A ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##27: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1A with [ t1A ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct28 : +Πt2:bitrigesim.ΠP:Prop.t1B = t2 → match t2 with [ t1B ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##28: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1B with [ t1B ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct29 : +Πt2:bitrigesim.ΠP:Prop.t1C = t2 → match t2 with [ t1C ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##29: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1C with [ t1C ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct30 : +Πt2:bitrigesim.ΠP:Prop.t1D = t2 → match t2 with [ t1D ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##30: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1D with [ t1D ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct31 : +Πt2:bitrigesim.ΠP:Prop.t1E = t2 → match t2 with [ t1E ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##31: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1E with [ t1E ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct32 : +Πt2:bitrigesim.ΠP:Prop.t1F = t2 → match t2 with [ t1F ⇒ P → P | _ ⇒ P ]. + #t2; #P; + ncases t2; + nnormalize; #H; + ##[ ##32: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match t1F with [ t1F ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition bitrigesim_destruct_aux ≝ +Πt1,t2:bitrigesim.ΠP:Prop.t1 = t2 → match t1 with [ t00 ⇒ match t2 with [ t00 ⇒ P → P | _ ⇒ P ] | t01 ⇒ match t2 with [ t01 ⇒ P → P | _ ⇒ P ] @@ -164,202 +550,44 @@ ndefinition bitrigesim_destruct : | t1E ⇒ match t2 with [ t1E ⇒ P → P | _ ⇒ P ] | t1F ⇒ match t2 with [ t1F ⇒ P → P | _ ⇒ P ] ]. - #t1; #t2; #P; - nelim t1; - ##[ ##1: nelim t2; nnormalize; #H; - ##[ ##1: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t00 with [ t00 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##2: nelim t2; nnormalize; #H; - ##[ ##2: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t01 with [ t01 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##3: nelim t2; nnormalize; #H; - ##[ ##3: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t02 with [ t02 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##4: nelim t2; nnormalize; #H; - ##[ ##4: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t03 with [ t03 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##5: nelim t2; nnormalize; #H; - ##[ ##5: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t04 with [ t04 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##6: nelim t2; nnormalize; #H; - ##[ ##6: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t05 with [ t05 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##7: nelim t2; nnormalize; #H; - ##[ ##7: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t06 with [ t06 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##8: nelim t2; nnormalize; #H; - ##[ ##8: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t07 with [ t07 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##9: nelim t2; nnormalize; #H; - ##[ ##9: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t08 with [ t08 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##10: nelim t2; nnormalize; #H; - ##[ ##10: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t09 with [ t09 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##11: nelim t2; nnormalize; #H; - ##[ ##11: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0A with [ t0A ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##12: nelim t2; nnormalize; #H; - ##[ ##12: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0B with [ t0B ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##13: nelim t2; nnormalize; #H; - ##[ ##13: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0C with [ t0C ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##14: nelim t2; nnormalize; #H; - ##[ ##14: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0D with [ t0D ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##15: nelim t2; nnormalize; #H; - ##[ ##15: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0E with [ t0E ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##16: nelim t2; nnormalize; #H; - ##[ ##16: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t0F with [ t0F ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##17: nelim t2; nnormalize; #H; - ##[ ##17: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t10 with [ t10 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##18: nelim t2; nnormalize; #H; - ##[ ##18: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t11 with [ t11 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##19: nelim t2; nnormalize; #H; - ##[ ##19: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t12 with [ t12 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##20: nelim t2; nnormalize; #H; - ##[ ##20: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t13 with [ t13 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##21: nelim t2; nnormalize; #H; - ##[ ##21: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t14 with [ t14 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##22: nelim t2; nnormalize; #H; - ##[ ##22: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t15 with [ t15 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##23: nelim t2; nnormalize; #H; - ##[ ##23: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t16 with [ t16 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##24: nelim t2; nnormalize; #H; - ##[ ##24: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t17 with [ t17 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##25: nelim t2; nnormalize; #H; - ##[ ##25: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t18 with [ t18 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##26: nelim t2; nnormalize; #H; - ##[ ##26: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t19 with [ t19 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##27: nelim t2; nnormalize; #H; - ##[ ##27: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1A with [ t1A ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##28: nelim t2; nnormalize; #H; - ##[ ##28: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1B with [ t1B ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##29: nelim t2; nnormalize; #H; - ##[ ##29: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1C with [ t1C ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##30: nelim t2; nnormalize; #H; - ##[ ##30: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1D with [ t1D ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##31: nelim t2; nnormalize; #H; - ##[ ##31: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1E with [ t1E ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##32: nelim t2; nnormalize; #H; - ##[ ##32: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match t1F with [ t1F ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] + +ndefinition bitrigesim_destruct : bitrigesim_destruct_aux. + #t1; + ncases t1; + ##[ ##1: napply bitrigesim_destruct1 + ##| ##2: napply bitrigesim_destruct2 + ##| ##3: napply bitrigesim_destruct3 + ##| ##4: napply bitrigesim_destruct4 + ##| ##5: napply bitrigesim_destruct5 + ##| ##6: napply bitrigesim_destruct6 + ##| ##7: napply bitrigesim_destruct7 + ##| ##8: napply bitrigesim_destruct8 + ##| ##9: napply bitrigesim_destruct9 + ##| ##10: napply bitrigesim_destruct10 + ##| ##11: napply bitrigesim_destruct11 + ##| ##12: napply bitrigesim_destruct12 + ##| ##13: napply bitrigesim_destruct13 + ##| ##14: napply bitrigesim_destruct14 + ##| ##15: napply bitrigesim_destruct15 + ##| ##16: napply bitrigesim_destruct16 + ##| ##17: napply bitrigesim_destruct17 + ##| ##18: napply bitrigesim_destruct18 + ##| ##19: napply bitrigesim_destruct19 + ##| ##20: napply bitrigesim_destruct20 + ##| ##21: napply bitrigesim_destruct21 + ##| ##22: napply bitrigesim_destruct22 + ##| ##23: napply bitrigesim_destruct23 + ##| ##24: napply bitrigesim_destruct24 + ##| ##25: napply bitrigesim_destruct25 + ##| ##26: napply bitrigesim_destruct26 + ##| ##27: napply bitrigesim_destruct27 + ##| ##28: napply bitrigesim_destruct28 + ##| ##29: napply bitrigesim_destruct29 + ##| ##30: napply bitrigesim_destruct30 + ##| ##31: napply bitrigesim_destruct31 + ##| ##32: napply bitrigesim_destruct32 ##] -nqed. +nqed. nlemma symmetric_eqbitrig : symmetricT bitrigesim bool eq_bitrig. #t1; @@ -399,270 +627,333 @@ nlemma symmetric_eqbitrig : symmetricT bitrigesim bool eq_bitrig. ##] nqed. +nlemma eqbitrig_to_eq1 : ∀t2.eq_bitrig t00 t2 = true → t00 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##1: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq2 : ∀t2.eq_bitrig t01 t2 = true → t01 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##2: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq3 : ∀t2.eq_bitrig t02 t2 = true → t02 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##3: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq4 : ∀t2.eq_bitrig t03 t2 = true → t03 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##4: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq5 : ∀t2.eq_bitrig t04 t2 = true → t04 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##5: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq6 : ∀t2.eq_bitrig t05 t2 = true → t05 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##6: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq7 : ∀t2.eq_bitrig t06 t2 = true → t06 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##7: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq8 : ∀t2.eq_bitrig t07 t2 = true → t07 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##8: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq9 : ∀t2.eq_bitrig t08 t2 = true → t08 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##9: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq10 : ∀t2.eq_bitrig t09 t2 = true → t09 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##10: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq11 : ∀t2.eq_bitrig t0A t2 = true → t0A = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##11: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq12 : ∀t2.eq_bitrig t0B t2 = true → t0B = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##12: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq13 : ∀t2.eq_bitrig t0C t2 = true → t0C = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##13: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq14 : ∀t2.eq_bitrig t0D t2 = true → t0D = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##14: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq15 : ∀t2.eq_bitrig t0E t2 = true → t0E = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##15: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq16 : ∀t2.eq_bitrig t0F t2 = true → t0F = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##16: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq17 : ∀t2.eq_bitrig t10 t2 = true → t10 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##17: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq18 : ∀t2.eq_bitrig t11 t2 = true → t11 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##18: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq19 : ∀t2.eq_bitrig t12 t2 = true → t12 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##19: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq20 : ∀t2.eq_bitrig t13 t2 = true → t13 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##20: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq21 : ∀t2.eq_bitrig t14 t2 = true → t14 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##21: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq22 : ∀t2.eq_bitrig t15 t2 = true → t15 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##22: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq23 : ∀t2.eq_bitrig t16 t2 = true → t16 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##23: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq24 : ∀t2.eq_bitrig t17 t2 = true → t17 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##24: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq25 : ∀t2.eq_bitrig t18 t2 = true → t18 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##25: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq26 : ∀t2.eq_bitrig t19 t2 = true → t19 = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##26: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq27 : ∀t2.eq_bitrig t1A t2 = true → t1A = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##27: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq28 : ∀t2.eq_bitrig t1B t2 = true → t1B = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##28: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq29 : ∀t2.eq_bitrig t1C t2 = true → t1C = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##29: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq30 : ∀t2.eq_bitrig t1D t2 = true → t1D = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##30: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq31 : ∀t2.eq_bitrig t1E t2 = true → t1E = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##31: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + +nlemma eqbitrig_to_eq32 : ∀t2.eq_bitrig t1F t2 = true → t1F = t2. + #t2; ncases t2; nnormalize; #H; ##[ ##32: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##] +nqed. + nlemma eqbitrig_to_eq : ∀t1,t2.eq_bitrig t1 t2 = true → t1 = t2. - #t1; #t2; + #t1; ncases t1; - ##[ ##1: ncases t2; nnormalize; #H; - ##[ ##1: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##2: ncases t2; nnormalize; #H; - ##[ ##2: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##3: ncases t2; nnormalize; #H; - ##[ ##3: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##4: ncases t2; nnormalize; #H; - ##[ ##4: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##5: ncases t2; nnormalize; #H; - ##[ ##5: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##6: ncases t2; nnormalize; #H; - ##[ ##6: napply (refl_eq ??) - ##| ##*:napply (bool_destruct ??? H) - ##] - ##| ##7: ncases t2; nnormalize; #H; - ##[ ##7: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##8: ncases t2; nnormalize; #H; - ##[ ##8: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##9: ncases t2; nnormalize; #H; - ##[ ##9: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##10: ncases t2; nnormalize; #H; - ##[ ##10: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##11: ncases t2; nnormalize; #H; - ##[ ##11: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##12: ncases t2; nnormalize; #H; - ##[ ##12: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##13: ncases t2; nnormalize; #H; - ##[ ##13: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##14: ncases t2; nnormalize; #H; - ##[ ##14: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##15: ncases t2; nnormalize; #H; - ##[ ##15: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##16: ncases t2; nnormalize; #H; - ##[ ##16: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##17: ncases t2; nnormalize; #H; - ##[ ##17: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##18: ncases t2; nnormalize; #H; - ##[ ##18: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##19: ncases t2; nnormalize; #H; - ##[ ##19: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##20: ncases t2; nnormalize; #H; - ##[ ##20: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##21: ncases t2; nnormalize; #H; - ##[ ##21: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##22: ncases t2; nnormalize; #H; - ##[ ##22: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##23: ncases t2; nnormalize; #H; - ##[ ##23: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##24: ncases t2; nnormalize; #H; - ##[ ##24: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##25: ncases t2; nnormalize; #H; - ##[ ##25: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##26: ncases t2; nnormalize; #H; - ##[ ##26: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##27: ncases t2; nnormalize; #H; - ##[ ##27: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##28: ncases t2; nnormalize; #H; - ##[ ##28: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##29: ncases t2; nnormalize; #H; - ##[ ##29: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##30: ncases t2; nnormalize; #H; - ##[ ##30: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##31: ncases t2; nnormalize; #H; - ##[ ##31: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] - ##| ##32: ncases t2; nnormalize; #H; - ##[ ##32: napply (refl_eq ??) - ##| ##*: napply (bool_destruct ??? H) - ##] + ##[ ##1: napply eqbitrig_to_eq1 + ##| ##2: napply eqbitrig_to_eq2 + ##| ##3: napply eqbitrig_to_eq3 + ##| ##4: napply eqbitrig_to_eq4 + ##| ##5: napply eqbitrig_to_eq5 + ##| ##6: napply eqbitrig_to_eq6 + ##| ##7: napply eqbitrig_to_eq7 + ##| ##8: napply eqbitrig_to_eq8 + ##| ##9: napply eqbitrig_to_eq9 + ##| ##10: napply eqbitrig_to_eq10 + ##| ##11: napply eqbitrig_to_eq11 + ##| ##12: napply eqbitrig_to_eq12 + ##| ##13: napply eqbitrig_to_eq13 + ##| ##14: napply eqbitrig_to_eq14 + ##| ##15: napply eqbitrig_to_eq15 + ##| ##16: napply eqbitrig_to_eq16 + ##| ##17: napply eqbitrig_to_eq17 + ##| ##18: napply eqbitrig_to_eq18 + ##| ##19: napply eqbitrig_to_eq19 + ##| ##20: napply eqbitrig_to_eq20 + ##| ##21: napply eqbitrig_to_eq21 + ##| ##22: napply eqbitrig_to_eq22 + ##| ##23: napply eqbitrig_to_eq23 + ##| ##24: napply eqbitrig_to_eq24 + ##| ##25: napply eqbitrig_to_eq25 + ##| ##26: napply eqbitrig_to_eq26 + ##| ##27: napply eqbitrig_to_eq27 + ##| ##28: napply eqbitrig_to_eq28 + ##| ##29: napply eqbitrig_to_eq29 + ##| ##30: napply eqbitrig_to_eq30 + ##| ##31: napply eqbitrig_to_eq31 + ##| ##32: napply eqbitrig_to_eq32 ##] nqed. +nlemma eq_to_eqbitrig1 : ∀t2.t00 = t2 → eq_bitrig t00 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##1: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig2 : ∀t2.t01 = t2 → eq_bitrig t01 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##2: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig3 : ∀t2.t02 = t2 → eq_bitrig t02 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##3: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig4 : ∀t2.t03 = t2 → eq_bitrig t03 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##4: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig5 : ∀t2.t04 = t2 → eq_bitrig t04 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##5: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig6 : ∀t2.t05 = t2 → eq_bitrig t05 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##6: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig7 : ∀t2.t06 = t2 → eq_bitrig t06 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##7: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig8 : ∀t2.t07 = t2 → eq_bitrig t07 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##8: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig9 : ∀t2.t08 = t2 → eq_bitrig t08 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##9: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig10 : ∀t2.t09 = t2 → eq_bitrig t09 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##10: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig11 : ∀t2.t0A = t2 → eq_bitrig t0A t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##11: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig12 : ∀t2.t0B = t2 → eq_bitrig t0B t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##12: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig13 : ∀t2.t0C = t2 → eq_bitrig t0C t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##13: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig14 : ∀t2.t0D = t2 → eq_bitrig t0D t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##14: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig15 : ∀t2.t0E = t2 → eq_bitrig t0E t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##15: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig16 : ∀t2.t0F = t2 → eq_bitrig t0F t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##16: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig17 : ∀t2.t10 = t2 → eq_bitrig t10 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##17: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig18 : ∀t2.t11 = t2 → eq_bitrig t11 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##18: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig19 : ∀t2.t12 = t2 → eq_bitrig t12 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##19: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig20 : ∀t2.t13 = t2 → eq_bitrig t13 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##20: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig21 : ∀t2.t14 = t2 → eq_bitrig t14 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##21: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. +nlemma eq_to_eqbitrig22 : ∀t2.t15 = t2 → eq_bitrig t15 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##22: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig23 : ∀t2.t16 = t2 → eq_bitrig t16 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##23: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig24 : ∀t2.t17 = t2 → eq_bitrig t17 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##24: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig25 : ∀t2.t18 = t2 → eq_bitrig t18 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##25: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig26 : ∀t2.t19 = t2 → eq_bitrig t19 t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##26: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig27 : ∀t2.t1A = t2 → eq_bitrig t1A t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##27: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig28 : ∀t2.t1B = t2 → eq_bitrig t1B t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##28: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig29 : ∀t2.t1C = t2 → eq_bitrig t1C t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##29: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig30 : ∀t2.t1D = t2 → eq_bitrig t1D t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##30: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig31 : ∀t2.t1E = t2 → eq_bitrig t1E t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##31: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + +nlemma eq_to_eqbitrig32 : ∀t2.t1F = t2 → eq_bitrig t1F t2 = true. + #t2; ncases t2; nnormalize; #H; ##[ ##32: napply (refl_eq ??) ##| ##*: napply (bitrigesim_destruct ??? H) ##] +nqed. + nlemma eq_to_eqbitrig : ∀t1,t2.t1 = t2 → eq_bitrig t1 t2 = true. - #t1; #t2; + #t1; ncases t1; - ##[ ##1: ncases t2; nnormalize; #H; - ##[ ##1: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##2: ncases t2; nnormalize; #H; - ##[ ##2: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##3: ncases t2; nnormalize; #H; - ##[ ##3: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##4: ncases t2; nnormalize; #H; - ##[ ##4: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##5: ncases t2; nnormalize; #H; - ##[ ##5: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##6: ncases t2; nnormalize; #H; - ##[ ##6: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##7: ncases t2; nnormalize; #H; - ##[ ##7: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##8: ncases t2; nnormalize; #H; - ##[ ##8: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##9: ncases t2; nnormalize; #H; - ##[ ##9: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##10: ncases t2; nnormalize; #H; - ##[ ##10: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##11: ncases t2; nnormalize; #H; - ##[ ##11: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##12: ncases t2; nnormalize; #H; - ##[ ##12: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##13: ncases t2; nnormalize; #H; - ##[ ##13: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##14: ncases t2; nnormalize; #H; - ##[ ##14: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##15: ncases t2; nnormalize; #H; - ##[ ##15: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##16: ncases t2; nnormalize; #H; - ##[ ##16: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##17: ncases t2; nnormalize; #H; - ##[ ##17: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##18: ncases t2; nnormalize; #H; - ##[ ##18: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##19: ncases t2; nnormalize; #H; - ##[ ##19: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##20: ncases t2; nnormalize; #H; - ##[ ##20: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##21: ncases t2; nnormalize; #H; - ##[ ##21: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##22: ncases t2; nnormalize; #H; - ##[ ##22: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##23: ncases t2; nnormalize; #H; - ##[ ##23: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##24: ncases t2; nnormalize; #H; - ##[ ##24: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##25: ncases t2; nnormalize; #H; - ##[ ##25: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##26: ncases t2; nnormalize; #H; - ##[ ##26: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##27: ncases t2; nnormalize; #H; - ##[ ##27: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##28: ncases t2; nnormalize; #H; - ##[ ##28: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##29: ncases t2; nnormalize; #H; - ##[ ##29: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##30: ncases t2; nnormalize; #H; - ##[ ##30: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##31: ncases t2; nnormalize; #H; - ##[ ##31: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] - ##| ##32: ncases t2; nnormalize; #H; - ##[ ##32: napply (refl_eq ??) - ##| ##*: napply (bitrigesim_destruct ??? H) - ##] + ##[ ##1: napply eq_to_eqbitrig1 + ##| ##2: napply eq_to_eqbitrig2 + ##| ##3: napply eq_to_eqbitrig3 + ##| ##4: napply eq_to_eqbitrig4 + ##| ##5: napply eq_to_eqbitrig5 + ##| ##6: napply eq_to_eqbitrig6 + ##| ##7: napply eq_to_eqbitrig7 + ##| ##8: napply eq_to_eqbitrig8 + ##| ##9: napply eq_to_eqbitrig9 + ##| ##10: napply eq_to_eqbitrig10 + ##| ##11: napply eq_to_eqbitrig11 + ##| ##12: napply eq_to_eqbitrig12 + ##| ##13: napply eq_to_eqbitrig13 + ##| ##14: napply eq_to_eqbitrig14 + ##| ##15: napply eq_to_eqbitrig15 + ##| ##16: napply eq_to_eqbitrig16 + ##| ##17: napply eq_to_eqbitrig17 + ##| ##18: napply eq_to_eqbitrig18 + ##| ##19: napply eq_to_eqbitrig19 + ##| ##20: napply eq_to_eqbitrig20 + ##| ##21: napply eq_to_eqbitrig21 + ##| ##22: napply eq_to_eqbitrig22 + ##| ##23: napply eq_to_eqbitrig23 + ##| ##24: napply eq_to_eqbitrig24 + ##| ##25: napply eq_to_eqbitrig25 + ##| ##26: napply eq_to_eqbitrig26 + ##| ##27: napply eq_to_eqbitrig27 + ##| ##28: napply eq_to_eqbitrig28 + ##| ##29: napply eq_to_eqbitrig29 + ##| ##30: napply eq_to_eqbitrig30 + ##| ##31: napply eq_to_eqbitrig31 + ##| ##32: napply eq_to_eqbitrig32 ##] nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/bool_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/bool_lemmas.ma index 493a8e5b6..b03e5a62d 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/bool_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/bool_lemmas.ma @@ -31,12 +31,14 @@ include "freescale/bool.ma". (* BOOLEANI *) (* ******** *) -ndefinition bool_destruct : - Πb1,b2:bool.ΠP:Prop.b1 = b2 → +ndefinition bool_destruct_aux ≝ +Πb1,b2:bool.ΠP:Prop.b1 = b2 → match b1 with [ true ⇒ match b2 with [ true ⇒ P → P | false ⇒ P ] | false ⇒ match b2 with [ true ⇒ P | false ⇒ P → P ] ]. + +ndefinition bool_destruct : bool_destruct_aux. #b1; #b2; #P; nelim b1; nelim b2; diff --git a/helm/software/matita/contribs/ng_assembly/freescale/exadecim_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/exadecim_lemmas.ma index 762ab5d03..fa0577b0f 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/exadecim_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/exadecim_lemmas.ma @@ -31,8 +31,152 @@ include "freescale/exadecim.ma". (* ESADECIMALI *) (* *********** *) -ndefinition exadecim_destruct : - Πe1,e2:exadecim.ΠP:Prop.e1 = e2 → +ndefinition exadecim_destruct1 : Πe2.ΠP:Prop.ΠH:x0 = e2.match e2 with [ x0 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##1: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x0 with [ x0 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct2 : Πe2.ΠP:Prop.ΠH:x1 = e2.match e2 with [ x1 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##2: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x1 with [ x1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct3 : Πe2.ΠP:Prop.ΠH:x2 = e2.match e2 with [ x2 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##3: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x2 with [ x2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct4 : Πe2.ΠP:Prop.ΠH:x3 = e2.match e2 with [ x3 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##4: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x3 with [ x3 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct5 : Πe2.ΠP:Prop.ΠH:x4 = e2.match e2 with [ x4 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##5: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x4 with [ x4 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct6 : Πe2.ΠP:Prop.ΠH:x5 = e2.match e2 with [ x5 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##6: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x5 with [ x5 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct7 : Πe2.ΠP:Prop.ΠH:x6 = e2.match e2 with [ x6 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##7: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x6 with [ x6 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct8 : Πe2.ΠP:Prop.ΠH:x7 = e2.match e2 with [ x7 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##8: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x7 with [ x7 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct9 : Πe2.ΠP:Prop.ΠH:x8 = e2.match e2 with [ x8 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##9: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x8 with [ x8 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct10 : Πe2.ΠP:Prop.ΠH:x9 = e2.match e2 with [ x9 ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##10: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match x9 with [ x9 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct11 : Πe2.ΠP:Prop.ΠH:xA = e2.match e2 with [ xA ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##11: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xA with [ xA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct12 : Πe2.ΠP:Prop.ΠH:xB = e2.match e2 with [ xB ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##12: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xB with [ xB ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct13 : Πe2.ΠP:Prop.ΠH:xC = e2.match e2 with [ xC ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##13: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xC with [ xC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct14 : Πe2.ΠP:Prop.ΠH:xD = e2.match e2 with [ xD ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##14: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xD with [ xD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct15 : Πe2.ΠP:Prop.ΠH:xE = e2.match e2 with [ xE ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##15: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xE with [ xE ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct16 : Πe2.ΠP:Prop.ΠH:xF = e2.match e2 with [ xF ⇒ P → P | _ ⇒ P ]. + #e2; #P; ncases e2; nnormalize; #H; + ##[ ##16: napply (λx:P.x) + ##| ##*: napply (False_ind ??); + nchange with (match xF with [ xF ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition exadecim_destruct_aux ≝ +Πe1,e2.ΠP:Prop.ΠH:e1 = e2. match e1 with [ x0 ⇒ match e2 with [ x0 ⇒ P → P | _ ⇒ P ] | x1 ⇒ match e2 with [ x1 ⇒ P → P | _ ⇒ P ] @@ -51,104 +195,25 @@ ndefinition exadecim_destruct : | xE ⇒ match e2 with [ xE ⇒ P → P | _ ⇒ P ] | xF ⇒ match e2 with [ xF ⇒ P → P | _ ⇒ P ] ]. - #e1; #e2; #P; - nelim e1; - ##[ ##1: nelim e2; nnormalize; #H; - ##[ ##1: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x0 with [ x0 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##2: nelim e2; nnormalize; #H; - ##[ ##2: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x1 with [ x1 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##3: nelim e2; nnormalize; #H; - ##[ ##3: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x2 with [ x2 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##4: nelim e2; nnormalize; #H; - ##[ ##4: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x3 with [ x3 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##5: nelim e2; nnormalize; #H; - ##[ ##5: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x4 with [ x4 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##6: nelim e2; nnormalize; #H; - ##[ ##6: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x5 with [ x5 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##7: nelim e2; nnormalize; #H; - ##[ ##7: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x6 with [ x6 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##8: nelim e2; nnormalize; #H; - ##[ ##8: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x7 with [ x7 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##9: nelim e2; nnormalize; #H; - ##[ ##9: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x8 with [ x8 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##10: nelim e2; nnormalize; #H; - ##[ ##10: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match x9 with [ x9 ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##11: nelim e2; nnormalize; #H; - ##[ ##11: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xA with [ xA ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##12: nelim e2; nnormalize; #H; - ##[ ##12: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xB with [ xB ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##13: nelim e2; nnormalize; #H; - ##[ ##13: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xC with [ xC ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##14: nelim e2; nnormalize; #H; - ##[ ##14: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xD with [ xD ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##15: nelim e2; nnormalize; #H; - ##[ ##15: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xE with [ xE ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] - ##| ##16: nelim e2; nnormalize; #H; - ##[ ##16: napply (λx:P.x) - ##| ##*: napply (False_ind ??); - nchange with (match xF with [ xF ⇒ False | _ ⇒ True ]); - nrewrite > H; nnormalize; napply I - ##] + +ndefinition exadecim_destruct : exadecim_destruct_aux. + #e1; ncases e1; + ##[ ##1: napply exadecim_destruct1 + ##| ##2: napply exadecim_destruct2 + ##| ##3: napply exadecim_destruct3 + ##| ##4: napply exadecim_destruct4 + ##| ##5: napply exadecim_destruct5 + ##| ##6: napply exadecim_destruct6 + ##| ##7: napply exadecim_destruct7 + ##| ##8: napply exadecim_destruct8 + ##| ##9: napply exadecim_destruct9 + ##| ##10: napply exadecim_destruct10 + ##| ##11: napply exadecim_destruct11 + ##| ##12: napply exadecim_destruct12 + ##| ##13: napply exadecim_destruct13 + ##| ##14: napply exadecim_destruct14 + ##| ##15: napply exadecim_destruct15 + ##| ##16: napply exadecim_destruct16 ##] nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/nat.ma b/helm/software/matita/contribs/ng_assembly/freescale/nat.ma index cff29e3c3..1b5f5f46a 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/nat.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/nat.ma @@ -56,6 +56,13 @@ nlet rec eq_nat (n1,n2:nat) on n1 ≝ | S n1' ⇒ match n2 with [ O ⇒ false | S n2' ⇒ eq_nat n1' n2' ] ]. +nlet rec le_nat n m ≝ + match n with + [ O ⇒ true + | (S p) ⇒ match m with + [ O ⇒ false | (S q) ⇒ le_nat p q ] + ]. + nlet rec plus (n1,n2:nat) on n1 ≝ match n1 with [ O ⇒ n2 diff --git a/helm/software/matita/contribs/ng_assembly/freescale/nat_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/nat_lemmas.ma index 9e6b6e8a5..70b9bbbb9 100644 --- a/helm/software/matita/contribs/ng_assembly/freescale/nat_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/nat_lemmas.ma @@ -31,7 +31,7 @@ include "freescale/nat.ma". (* NATURALI *) (* ******** *) -nlemma nat_destruct : ∀n1,n2:nat.S n1 = S n2 → n1 = n2. +nlemma nat_destruct_S_S : ∀n1,n2:nat.S n1 = S n2 → n1 = n2. #n1; #n2; #H; nchange with (match S n2 with [ O ⇒ False | S a ⇒ n1 = a ]); nrewrite < H; @@ -89,7 +89,7 @@ nlemma eq_to_eqnat : ∀n1,n2:nat.n1 = n2 → eq_nat n1 n2 = true. nnormalize; ##[ ##1: #H1; nelim (nat_destruct_S_0 ? H1) ##| ##2: #n4; #H1; - napply (H n4 (nat_destruct ?? H1)) + napply (H n4 (nat_destruct_S_S ?? H1)) ##] ##] nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode.ma new file mode 100755 index 000000000..67e46334b --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode.ma @@ -0,0 +1,183 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode_base.ma". + +(* ********************************************* *) +(* STRUMENTI PER LE DIMOSTRAZIONI DI CORRETTEZZA *) +(* ********************************************* *) + +(* su tutta la lista quante volte compare il byte *) +nlet rec get_byte_count (m:mcu_type) (b:byte8) (c:nat) + (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝ + match l with + [ nil ⇒ c + | cons hd tl ⇒ match thd4T ???? hd with + [ Byte b' ⇒ match eq_b8 b b' with + [ true ⇒ get_byte_count m b (S c) tl + | false ⇒ get_byte_count m b c tl + ] + | Word _ ⇒ get_byte_count m b c tl + ] + ]. + +(* su tutta la lista quante volte compare la word (0x9E+byte) *) +nlet rec get_word_count (m:mcu_type) (b:byte8) (c:nat) + (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝ + match l with + [ nil ⇒ c + | cons hd tl ⇒ match thd4T ???? hd with + [ Byte _ ⇒ get_word_count m b c tl + | Word w ⇒ match eq_w16 〈〈x9,xE〉:b〉 w with + [ true ⇒ get_word_count m b (S c) tl + | false ⇒ get_word_count m b c tl + ] + ] + ]. + +(* su tutta la lista quante volte compare lo pseudocodice *) +nlet rec get_pseudo_count (m:mcu_type) (o:opcode) (c:nat) + (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝ + match l with + [ nil ⇒ c + | cons hd tl ⇒ match fst4T ???? hd with + [ anyOP o' ⇒ match eq_op o o' with + [ true ⇒ get_pseudo_count m o (S c) tl + | false ⇒ get_pseudo_count m o c tl + ] + ] + ]. + +(* su tutta la lista quante volte compare la modalita' *) +nlet rec get_mode_count (m:mcu_type) (i:instr_mode) (c:nat) + (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝ + match l with + [ nil ⇒ c + | cons hd tl ⇒ match eq_instrmode (snd4T ???? hd) i with + [ true ⇒ get_mode_count m i (S c) tl + | false ⇒ get_mode_count m i c tl + ] + ]. + +(* b e' non implementato? *) +nlet rec test_not_impl_byte (b:byte8) (l:list byte8) on l ≝ + match l with + [ nil ⇒ false + | cons hd tl ⇒ match eq_b8 b hd with + [ true ⇒ true + | false ⇒ test_not_impl_byte b tl + ] + ]. + +(* o e' non implementato? *) +nlet rec test_not_impl_pseudo (o:opcode) (l:list opcode) on l ≝ + match l with + [ nil ⇒ false + | cons hd tl ⇒ match eq_op o hd with + [ true ⇒ true + | false ⇒ test_not_impl_pseudo o tl + ] + ]. + +(* i e' non implementato? *) +nlet rec test_not_impl_mode (i:instr_mode) (l:list instr_mode) on l ≝ + match l with + [ nil ⇒ false + | cons hd tl ⇒ match eq_instrmode i hd with + [ true ⇒ true + | false ⇒ test_not_impl_mode i tl + ] + ]. + +(* su tutta la lista quante volte compare la coppia opcode,instr_mode *) +nlet rec get_OpIm_count (m:mcu_type) (o:any_opcode m) (i:instr_mode) (c:nat) + (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝ + match l with + [ nil ⇒ c + | cons hd tl ⇒ + match (eq_anyop m o (fst4T ???? hd)) ⊗ + (eq_instrmode i (snd4T ???? hd)) with + [ true ⇒ get_OpIm_count m o i (S c) tl + | false ⇒ get_OpIm_count m o i c tl + ] + ]. + +(* iteratore sugli opcode *) +ndefinition forall_opcode ≝ λP. + P ADC ⊗ P ADD ⊗ P AIS ⊗ P AIX ⊗ P AND ⊗ P ASL ⊗ P ASR ⊗ P BCC ⊗ + P BCLRn ⊗ P BCS ⊗ P BEQ ⊗ P BGE ⊗ P BGND ⊗ P BGT ⊗ P BHCC ⊗ P BHCS ⊗ + P BHI ⊗ P BIH ⊗ P BIL ⊗ P BIT ⊗ P BLE ⊗ P BLS ⊗ P BLT ⊗ P BMC ⊗ + P BMI ⊗ P BMS ⊗ P BNE ⊗ P BPL ⊗ P BRA ⊗ P BRCLRn ⊗ P BRN ⊗ P BRSETn ⊗ + P BSETn ⊗ P BSR ⊗ P CBEQA ⊗ P CBEQX ⊗ P CLC ⊗ P CLI ⊗ P CLR ⊗ P CMP ⊗ + P COM ⊗ P CPHX ⊗ P CPX ⊗ P DAA ⊗ P DBNZ ⊗ P DEC ⊗ P DIV ⊗ P EOR ⊗ + P INC ⊗ P JMP ⊗ P JSR ⊗ P LDA ⊗ P LDHX ⊗ P LDX ⊗ P LSR ⊗ P MOV ⊗ + P MUL ⊗ P NEG ⊗ P NOP ⊗ P NSA ⊗ P ORA ⊗ P PSHA ⊗ P PSHH ⊗ P PSHX ⊗ + P PULA ⊗ P PULH ⊗ P PULX ⊗ P ROL ⊗ P ROR ⊗ P RSP ⊗ P RTI ⊗ P RTS ⊗ + P SBC ⊗ P SEC ⊗ P SEI ⊗ P SHA ⊗ P SLA ⊗ P STA ⊗ P STHX ⊗ P STOP ⊗ + P STX ⊗ P SUB ⊗ P SWI ⊗ P TAP ⊗ P TAX ⊗ P TPA ⊗ P TST ⊗ P TSX ⊗ + P TXA ⊗ P TXS ⊗ P WAIT. + +(* iteratore sulle modalita' *) +ndefinition forall_instr_mode ≝ λP. + P MODE_INH +⊗ P MODE_INHA +⊗ P MODE_INHX +⊗ P MODE_INHH + +⊗ P MODE_INHX0ADD +⊗ P MODE_INHX1ADD +⊗ P MODE_INHX2ADD + +⊗ P MODE_IMM1 +⊗ P MODE_IMM1EXT +⊗ P MODE_IMM2 +⊗ P MODE_DIR1 +⊗ P MODE_DIR2 +⊗ P MODE_IX0 +⊗ P MODE_IX1 +⊗ P MODE_IX2 +⊗ P MODE_SP1 +⊗ P MODE_SP2 + +⊗ P MODE_DIR1_to_DIR1 +⊗ P MODE_IMM1_to_DIR1 +⊗ P MODE_IX0p_to_DIR1 +⊗ P MODE_DIR1_to_IX0p + +⊗ P MODE_INHA_and_IMM1 +⊗ P MODE_INHX_and_IMM1 +⊗ P MODE_IMM1_and_IMM1 +⊗ P MODE_DIR1_and_IMM1 +⊗ P MODE_IX0_and_IMM1 +⊗ P MODE_IX0p_and_IMM1 +⊗ P MODE_IX1_and_IMM1 +⊗ P MODE_IX1p_and_IMM1 +⊗ P MODE_SP1_and_IMM1 + +⊗ forall_oct (λo. P (MODE_DIRn o)) +⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o)) +⊗ forall_exadecim (λe. P (MODE_TNY e)) +⊗ forall_bitrigesim (λt. P (MODE_SRT t)). diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma index 8f462ea87..b8dfc6a5a 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma @@ -578,5 +578,5 @@ ndefinition eq_b8w16 ≝ λbw1,bw2:byte8_or_word16. match bw1 with [ Byte b1 ⇒ match bw2 with [ Byte b2 ⇒ eq_b8 b1 b2 | Word _ ⇒ false ] - | Word w1 ⇒ match bw2 with [ Byte _ ⇒ false | Word w2 ⇒ eq_w16 w1 w1 ] + | Word w1 ⇒ match bw2 with [ Byte _ ⇒ false | Word w2 ⇒ eq_w16 w1 w2 ] ]. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma new file mode 100755 index 000000000..f781ffadb --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma @@ -0,0 +1,131 @@ +(**************************************************************************) +(* ___ *) +(* ||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_aux ≝ +Π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 ] + ]. + +ndefinition mcu_type_destruct : mcu_type_destruct_aux. + #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. + +nlemma instr_mode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +nlemma instr_mode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +nlemma instr_mode_destruct_MODE_TNY : ∀e1,e2.MODE_TNY e1 = MODE_TNY e2 → e1 = e2. + #e1; #e2; #H; + nchange with (match MODE_TNY e2 with [ MODE_TNY a ⇒ e1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +nlemma instr_mode_destruct_MODE_SRT : ∀t1,t2.MODE_SRT t1 = MODE_SRT t2 → t1 = t2. + #t1; #t2; #H; + nchange with (match MODE_SRT t2 with [ MODE_SRT a ⇒ t1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. 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 index 39a9baf8b..c262ed829 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma @@ -24,74 +24,107 @@ (* data ultima modifica 15/11/2007 *) (* ********************************************************************** *) -include "freescale/bool_lemmas.ma". -include "freescale/opcode_base.ma". +include "freescale/opcode_base_lemmas_opcode2.ma". +include "freescale/opcode_base_lemmas_instrmode2.ma". +include "freescale/word16_lemmas.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 - ##] - ##] +nlemma anyop_destruct : ∀m.∀x1,x2:opcode.anyOP m x1 = anyOP m x2 → x1 = x2. + #m; #x1; #x2; #H; + nchange with (match anyOP m x2 with [ anyOP a ⇒ x1 = a ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +nlemma symmetric_eqanyop : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = eq_anyop m op2 op1. + #m; + ncases m; + #op1; #op2; + ncases op1; + #x1; + ncases op2; + #x2; + nchange with (eq_op x1 x2 = eq_op x2 x1); + nrewrite > (symmetric_eqop x1 x2); + napply (refl_eq ??). nqed. -nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype. - #m1; #m2; - nelim m1; - nelim m2; +nlemma eqanyop_to_eq : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = true → op1 = op2. + #m; + ncases m; + #op1; #op2; + ncases op1; + #x1; + ncases op2; + #x2; + nchange with ((eq_op x1 x2 = true) → ?); + #H; + nrewrite > (eqop_to_eq ?? H); + napply (refl_eq ??). +nqed. + +nlemma eq_to_eqanyop : ∀m.∀op1,op2:any_opcode m.op1 = op2 → eq_anyop m op1 op2 = true. + #m; + ncases m; + #op1; #op2; + ncases op1; + #p1; + ncases op2; + #p2; #H; + nrewrite > (anyop_destruct ??? H); + nchange with (eq_op p2 p2 = true); + nrewrite > (eq_to_eqop p2 p2 (refl_eq opcode p2)); + napply (refl_eq ??). +nqed. + +nlemma b8w16_destruct_b8_b8 : ∀x1,x2.Byte x1 = Byte x2 → x1 = x2. + #x1; #x2; #H; + nchange with (match Byte x2 with [ Byte a ⇒ x1 = a | Word _ ⇒ False ]); + nrewrite < H; 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; +nlemma b8w16_destruct_w16_w16 : ∀x1,x2.Word x1 = Word x2 → x1 = x2. + #x1; #x2; #H; + nchange with (match Word x2 with [ Word a ⇒ x1 = a | Byte _ ⇒ False ]); + nrewrite < H; nnormalize; - ##[ ##1,6,11,16: #H; napply (refl_eq ??) - ##| ##*: #H; napply (bool_destruct ??? H) - ##] + napply (refl_eq ??). nqed. -nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true. - #m1; #m2; - ncases m1; - ncases m2; +nlemma b8w16_destruct_b8_w16 : ∀x1,x2.Byte x1 = Word x2 → False. + #x1; #x2; #H; + nchange with (match Byte x1 with [ Word _ ⇒ True | Byte a ⇒ False ]); + nrewrite > H; nnormalize; - ##[ ##1,6,11,16: #H; napply (refl_eq ??) - ##| ##*: #H; napply (mcu_type_destruct ??? H) + napply I. +nqed. + +nlemma b8w16_destruct_w16_b8 : ∀x1,x2.Word x1 = Byte x2 → False. + #x1; #x2; #H; + nchange with (match Word x1 with [ Word a ⇒ False | Byte _ ⇒ True ]); + nrewrite > H; + nnormalize; + napply I. +nqed. + +nlemma symmetric_eqb8w16 : ∀bw1,bw2.eq_b8w16 bw1 bw2 = eq_b8w16 bw2 bw1. + #bw1; #bw2; + ncases bw1; + #x1; + ncases bw2; + #x2; + ##[ ##1: nchange with (eq_b8 x1 x2 = eq_b8 x2 x1); + nrewrite > (symmetric_eqb8 x1 x2); + napply (refl_eq ??) + ##| ##2,3: nnormalize; napply (refl_eq ??) + ##| ##4: nchange with (eq_w16 x1 x2 = eq_w16 x2 x1); + nrewrite > (symmetric_eqw16 x1 x2); + napply (refl_eq ??) ##] nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode1.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode1.ma new file mode 100755 index 000000000..aa1f4579c --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode1.ma @@ -0,0 +1,933 @@ +(**************************************************************************) +(* ___ *) +(* ||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/aux_bases_lemmas.ma". +include "freescale/exadecim_lemmas.ma". +include "freescale/opcode_base.ma". + +(* ********************************************** *) +(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *) +(* ********************************************** *) + +ndefinition instr_mode_destruct1 : + Πi2.ΠP:Prop.MODE_INH = i2 → match i2 with [ MODE_INH ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##1: #H; napply (λx:P.x) + ##| ##2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INH with [ MODE_INH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INH with [ MODE_INH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct2 : + Πi2.ΠP:Prop.MODE_INHA = i2 → match i2 with [ MODE_INHA ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##2: #H; napply (λx:P.x) + ##| ##1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHA with [ MODE_INHA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHA with [ MODE_INHA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct3 : + Πi2.ΠP:Prop.MODE_INHX = i2 → match i2 with [ MODE_INHX ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##3: #H; napply (λx:P.x) + ##| ##1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHX with [ MODE_INHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHX with [ MODE_INHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct4 : + Πi2.ΠP:Prop.MODE_INHH = i2 → match i2 with [ MODE_INHH ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##4: #H; napply (λx:P.x) + ##| ##1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHH with [ MODE_INHH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHH with [ MODE_INHH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct5 : + Πi2.ΠP:Prop.MODE_INHX0ADD = i2 → match i2 with [ MODE_INHX0ADD ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##5: #H; napply (λx:P.x) + ##| ##1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHX0ADD with [ MODE_INHX0ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHX0ADD with [ MODE_INHX0ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct6 : + Πi2.ΠP:Prop.MODE_INHX1ADD = i2 → match i2 with [ MODE_INHX1ADD ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##6: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHX1ADD with [ MODE_INHX1ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHX1ADD with [ MODE_INHX1ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct7 : + Πi2.ΠP:Prop.MODE_INHX2ADD = i2 → match i2 with [ MODE_INHX2ADD ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##7: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHX2ADD with [ MODE_INHX2ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHX2ADD with [ MODE_INHX2ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct8 : + Πi2.ΠP:Prop.MODE_IMM1 = i2 → match i2 with [ MODE_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##8: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IMM1 with [ MODE_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IMM1 with [ MODE_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct9 : + Πi2.ΠP:Prop.MODE_IMM1EXT = i2 → match i2 with [ MODE_IMM1EXT ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##9: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IMM1EXT with [ MODE_IMM1EXT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IMM1EXT with [ MODE_IMM1EXT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct10 : + Πi2.ΠP:Prop.MODE_IMM2 = i2 → match i2 with [ MODE_IMM2 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##10: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IMM2 with [ MODE_IMM2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IMM2 with [ MODE_IMM2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct11 : + Πi2.ΠP:Prop.MODE_DIR1 = i2 → match i2 with [ MODE_DIR1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##11: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIR1 with [ MODE_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIR1 with [ MODE_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct12 : + Πi2.ΠP:Prop.MODE_DIR2 = i2 → match i2 with [ MODE_DIR2 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##12: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIR2 with [ MODE_DIR2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIR2 with [ MODE_DIR2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct13 : + Πi2.ΠP:Prop.MODE_IX0 = i2 → match i2 with [ MODE_IX0 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##13: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX0 with [ MODE_IX0 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX0 with [ MODE_IX0 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct14 : + Πi2.ΠP:Prop.MODE_IX1 = i2 → match i2 with [ MODE_IX1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##14: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX1 with [ MODE_IX1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX1 with [ MODE_IX1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct15 : + Πi2.ΠP:Prop.MODE_IX2 = i2 → match i2 with [ MODE_IX2 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##15: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX2 with [ MODE_IX2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX2 with [ MODE_IX2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct16 : + Πi2.ΠP:Prop.MODE_SP1 = i2 → match i2 with [ MODE_SP1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##16: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_SP1 with [ MODE_SP1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_SP1 with [ MODE_SP1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct17 : + Πi2.ΠP:Prop.MODE_SP2 = i2 → match i2 with [ MODE_SP2 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##17: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_SP2 with [ MODE_SP2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_SP2 with [ MODE_SP2 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct18 : + Πi2.ΠP:Prop.MODE_DIR1_to_DIR1 = i2 → match i2 with [ MODE_DIR1_to_DIR1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##18: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_to_DIR1 with [ MODE_DIR1_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_to_DIR1 with [ MODE_DIR1_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct19 : + Πi2.ΠP:Prop.MODE_IMM1_to_DIR1 = i2 → match i2 with [ MODE_IMM1_to_DIR1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##19: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IMM1_to_DIR1 with [ MODE_IMM1_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IMM1_to_DIR1 with [ MODE_IMM1_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct20 : + Πi2.ΠP:Prop.MODE_IX0p_to_DIR1 = i2 → match i2 with [ MODE_IX0p_to_DIR1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##20: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX0p_to_DIR1 with [ MODE_IX0p_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX0p_to_DIR1 with [ MODE_IX0p_to_DIR1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct21 : + Πi2.ΠP:Prop.MODE_DIR1_to_IX0p = i2 → match i2 with [ MODE_DIR1_to_IX0p ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##21: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_to_IX0p with [ MODE_DIR1_to_IX0p ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_to_IX0p with [ MODE_DIR1_to_IX0p ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct22 : + Πi2.ΠP:Prop.MODE_INHA_and_IMM1 = i2 → match i2 with [ MODE_INHA_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##22: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHA_and_IMM1 with [ MODE_INHA_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHA_and_IMM1 with [ MODE_INHA_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct23 : + Πi2.ΠP:Prop.MODE_INHX_and_IMM1 = i2 → match i2 with [ MODE_INHX_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##23: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_INHX_and_IMM1 with [ MODE_INHX_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_INHX_and_IMM1 with [ MODE_INHX_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct24 : + Πi2.ΠP:Prop.MODE_IMM1_and_IMM1 = i2 → match i2 with [ MODE_IMM1_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##24: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IMM1_and_IMM1 with [ MODE_IMM1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IMM1_and_IMM1 with [ MODE_IMM1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct25 : + Πi2.ΠP:Prop.MODE_DIR1_and_IMM1 = i2 → match i2 with [ MODE_DIR1_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##25: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_and_IMM1 with [ MODE_DIR1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIR1_and_IMM1 with [ MODE_DIR1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct26 : + Πi2.ΠP:Prop.MODE_IX0_and_IMM1 = i2 → match i2 with [ MODE_IX0_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##26: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX0_and_IMM1 with [ MODE_IX0_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX0_and_IMM1 with [ MODE_IX0_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct27 : + Πi2.ΠP:Prop.MODE_IX0p_and_IMM1 = i2 → match i2 with [ MODE_IX0p_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##27: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX0p_and_IMM1 with [ MODE_IX0p_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX0p_and_IMM1 with [ MODE_IX0p_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct28 : + Πi2.ΠP:Prop.MODE_IX1_and_IMM1 = i2 → match i2 with [ MODE_IX1_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##28: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX1_and_IMM1 with [ MODE_IX1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX1_and_IMM1 with [ MODE_IX1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct29 : + Πi2.ΠP:Prop.MODE_IX1p_and_IMM1 = i2 → match i2 with [ MODE_IX1p_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##29: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30: #H; + napply (False_ind ??); + nchange with (match MODE_IX1p_and_IMM1 with [ MODE_IX1p_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_IX1p_and_IMM1 with [ MODE_IX1p_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition instr_mode_destruct30 : + Πi2.ΠP:Prop.MODE_SP1_and_IMM1 = i2 → match i2 with [ MODE_SP1_and_IMM1 ⇒ P → P | _ ⇒ P ]. + #i2; #P; + ncases i2; + nnormalize; + ##[ ##30: #H; napply (λx:P.x) + ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29: #H; + napply (False_ind ??); + nchange with (match MODE_SP1_and_IMM1 with [ MODE_SP1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_SP1_and_IMM1 with [ MODE_SP1_and_IMM1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +nlemma instr_mode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +ndefinition instr_mode_destruct31 : + Πn1,i2.ΠP:Prop.MODE_DIRn n1 = i2 → + match i2 with + [ MODE_DIRn n2 ⇒ match n1 with + [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ] + | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ] + | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ] + | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ]. + #n1; #i2; #P; + ncases i2; + nnormalize; + ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIRn n1 with [ MODE_DIRn a ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##32,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIRn n1 with [ MODE_DIRn n1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31: #n2; + ncases n1; + ncases n2; + nnormalize; + ##[ ##1,10,19,28,37,46,55,64: #H; napply (λx:P.x) + ##| ##*: #H; napply (oct_destruct ??? (instr_mode_destruct_MODE_DIRn ?? H)) + ##] +nqed. + +nlemma instr_mode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +ndefinition instr_mode_destruct32 : + Πn1,i2.ΠP:Prop.MODE_DIRn_and_IMM1 n1 = i2 → + match i2 with + [ MODE_DIRn_and_IMM1 n2 ⇒ match n1 with + [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ] + | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ] + | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ] + | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ]. + #n1; #i2; #P; + ncases i2; + nnormalize; + ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_DIRn_and_IMM1 n1 with [ MODE_DIRn_and_IMM1 a ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,33,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_DIRn_and_IMM1 n1 with [ MODE_DIRn_and_IMM1 n1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##32: #n2; + ncases n1; + ncases n2; + nnormalize; + ##[ ##1,10,19,28,37,46,55,64: #H; napply (λx:P.x) + ##| ##*: #H; napply (oct_destruct ??? (instr_mode_destruct_MODE_DIRn_and_IMM1 ?? H)) + ##] +nqed. + +nlemma instr_mode_destruct_MODE_TNY : ∀n1,n2.MODE_TNY n1 = MODE_TNY n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_TNY n2 with [ MODE_TNY a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +ndefinition instr_mode_destruct33 : + Πn1,i2.ΠP:Prop.MODE_TNY n1 = i2 → + match i2 with + [ MODE_TNY n2 ⇒ match n1 with + [ x0 ⇒ match n2 with [ x0 ⇒ P → P | _ ⇒ P ] | x1 ⇒ match n2 with [ x1 ⇒ P → P | _ ⇒ P ] + | x2 ⇒ match n2 with [ x2 ⇒ P → P | _ ⇒ P ] | x3 ⇒ match n2 with [ x3 ⇒ P → P | _ ⇒ P ] + | x4 ⇒ match n2 with [ x4 ⇒ P → P | _ ⇒ P ] | x5 ⇒ match n2 with [ x5 ⇒ P → P | _ ⇒ P ] + | x6 ⇒ match n2 with [ x6 ⇒ P → P | _ ⇒ P ] | x7 ⇒ match n2 with [ x7 ⇒ P → P | _ ⇒ P ] + | x8 ⇒ match n2 with [ x8 ⇒ P → P | _ ⇒ P ] | x9 ⇒ match n2 with [ x9 ⇒ P → P | _ ⇒ P ] + | xA ⇒ match n2 with [ xA ⇒ P → P | _ ⇒ P ] | xB ⇒ match n2 with [ xB ⇒ P → P | _ ⇒ P ] + | xC ⇒ match n2 with [ xC ⇒ P → P | _ ⇒ P ] | xD ⇒ match n2 with [ xD ⇒ P → P | _ ⇒ P ] + | xE ⇒ match n2 with [ xE ⇒ P → P | _ ⇒ P ] | xF ⇒ match n2 with [ xF ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ]. + #n1; #i2; #P; + ncases i2; + nnormalize; + ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_TNY n1 with [ MODE_TNY a ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,34: #n; #H; + napply (False_ind ??); + nchange with (match MODE_TNY n1 with [ MODE_TNY n1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##33: #n2; + ncases n1; + ncases n2; + nnormalize; + ##[ ##1,18,35,52,69,86,103,120,137,154,171,188,205,222,239,256: #H; napply (λx:P.x) + ##| ##*: #H; napply (exadecim_destruct ??? (instr_mode_destruct_MODE_TNY ?? H)) + ##] +nqed. + +nlemma instr_mode_destruct_MODE_SRT : ∀n1,n2.MODE_SRT n1 = MODE_SRT n2 → n1 = n2. + #n1; #n2; #H; + nchange with (match MODE_SRT n2 with [ MODE_SRT a ⇒ n1 = a | _ ⇒ False ]); + nrewrite < H; + nnormalize; + napply (refl_eq ??). +nqed. + +ndefinition instr_mode_destruct34 : + Πn1,i2.ΠP:Prop.MODE_SRT n1 = i2 → + match i2 with + [ MODE_SRT n2 ⇒ match n1 with + [ t00 ⇒ match n2 with [ t00 ⇒ P → P | _ ⇒ P ] | t01 ⇒ match n2 with [ t01 ⇒ P → P | _ ⇒ P ] + | t02 ⇒ match n2 with [ t02 ⇒ P → P | _ ⇒ P ] | t03 ⇒ match n2 with [ t03 ⇒ P → P | _ ⇒ P ] + | t04 ⇒ match n2 with [ t04 ⇒ P → P | _ ⇒ P ] | t05 ⇒ match n2 with [ t05 ⇒ P → P | _ ⇒ P ] + | t06 ⇒ match n2 with [ t06 ⇒ P → P | _ ⇒ P ] | t07 ⇒ match n2 with [ t07 ⇒ P → P | _ ⇒ P ] + | t08 ⇒ match n2 with [ t08 ⇒ P → P | _ ⇒ P ] | t09 ⇒ match n2 with [ t09 ⇒ P → P | _ ⇒ P ] + | t0A ⇒ match n2 with [ t0A ⇒ P → P | _ ⇒ P ] | t0B ⇒ match n2 with [ t0B ⇒ P → P | _ ⇒ P ] + | t0C ⇒ match n2 with [ t0C ⇒ P → P | _ ⇒ P ] | t0D ⇒ match n2 with [ t0D ⇒ P → P | _ ⇒ P ] + | t0E ⇒ match n2 with [ t0E ⇒ P → P | _ ⇒ P ] | t0F ⇒ match n2 with [ t0F ⇒ P → P | _ ⇒ P ] + | t10 ⇒ match n2 with [ t10 ⇒ P → P | _ ⇒ P ] | t11 ⇒ match n2 with [ t11 ⇒ P → P | _ ⇒ P ] + | t12 ⇒ match n2 with [ t12 ⇒ P → P | _ ⇒ P ] | t13 ⇒ match n2 with [ t13 ⇒ P → P | _ ⇒ P ] + | t14 ⇒ match n2 with [ t14 ⇒ P → P | _ ⇒ P ] | t15 ⇒ match n2 with [ t15 ⇒ P → P | _ ⇒ P ] + | t16 ⇒ match n2 with [ t16 ⇒ P → P | _ ⇒ P ] | t17 ⇒ match n2 with [ t17 ⇒ P → P | _ ⇒ P ] + | t18 ⇒ match n2 with [ t18 ⇒ P → P | _ ⇒ P ] | t19 ⇒ match n2 with [ t19 ⇒ P → P | _ ⇒ P ] + | t1A ⇒ match n2 with [ t1A ⇒ P → P | _ ⇒ P ] | t1B ⇒ match n2 with [ t1B ⇒ P → P | _ ⇒ P ] + | t1C ⇒ match n2 with [ t1C ⇒ P → P | _ ⇒ P ] | t1D ⇒ match n2 with [ t1D ⇒ P → P | _ ⇒ P ] + | t1E ⇒ match n2 with [ t1E ⇒ P → P | _ ⇒ P ] | t1F ⇒ match n2 with [ t1F ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ]. + #n1; #i2; #P; + ncases i2; + nnormalize; + ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H; + napply (False_ind ??); + nchange with (match MODE_SRT n1 with [ MODE_SRT a ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##31,32,33: #n; #H; + napply (False_ind ??); + nchange with (match MODE_SRT n1 with [ MODE_SRT n1 ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##| ##34: #n2; + ncases n1; + ##[ ##1: ncases n2; nnormalize; + ##[ ##1: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##2: ncases n2; nnormalize; + ##[ ##2: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##3: ncases n2; nnormalize; + ##[ ##3: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##4: ncases n2; nnormalize; + ##[ ##4: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##5: ncases n2; nnormalize; + ##[ ##5: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##6: ncases n2; nnormalize; + ##[ ##6: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##7: ncases n2; nnormalize; + ##[ ##7: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##8: ncases n2; nnormalize; + ##[ ##8: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##9: ncases n2; nnormalize; + ##[ ##9: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##10: ncases n2; nnormalize; + ##[ ##10: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##11: ncases n2; nnormalize; + ##[ ##11: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##12: ncases n2; nnormalize; + ##[ ##12: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##13: ncases n2; nnormalize; + ##[ ##13: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##14: ncases n2; nnormalize; + ##[ ##14: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##15: ncases n2; nnormalize; + ##[ ##15: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##16: ncases n2; nnormalize; + ##[ ##16: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##17: ncases n2; nnormalize; + ##[ ##17: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##18: ncases n2; nnormalize; + ##[ ##18: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##19: ncases n2; nnormalize; + ##[ ##19: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##20: ncases n2; nnormalize; + ##[ ##20: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##21: ncases n2; nnormalize; + ##[ ##21: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##22: ncases n2; nnormalize; + ##[ ##22: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##23: ncases n2; nnormalize; + ##[ ##23: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##24: ncases n2; nnormalize; + ##[ ##24: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##25: ncases n2; nnormalize; + ##[ ##25: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##26: ncases n2; nnormalize; + ##[ ##26: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##27: ncases n2; nnormalize; + ##[ ##27: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##28: ncases n2; nnormalize; + ##[ ##28: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##29: ncases n2; nnormalize; + ##[ ##29: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##30: ncases n2; nnormalize; + ##[ ##30: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##31: ncases n2; nnormalize; + ##[ ##31: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##| ##32: ncases n2; nnormalize; + ##[ ##32: #H; napply (λx:P.x) + ##| ##*: #H; napply (bitrigesim_destruct ??? (instr_mode_destruct_MODE_SRT ?? H)) + ##] + ##] + ##] +nqed. + +ndefinition instr_mode_destruct_aux ≝ +Πi1,i2.ΠP:Prop.i1 = i2 → + match i1 with + [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ P → P | _ ⇒ P ] + | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ P → P | _ ⇒ P ] + | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ P → P | _ ⇒ P ] + | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ P → P | _ ⇒ P ] + | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ P → P | _ ⇒ P ] + | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ P → P | _ ⇒ P ] + | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ P → P | _ ⇒ P ] + | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ P → P | _ ⇒ P ] + | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ P → P | _ ⇒ P ] + | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ P → P | _ ⇒ P ] + | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ P → P | _ ⇒ P ] + | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ P → P | _ ⇒ P ] + | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ P → P | _ ⇒ P ] + | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ P → P | _ ⇒ P ] + | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ P → P | _ ⇒ P ] + | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ P → P | _ ⇒ P ] + | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ P → P | _ ⇒ P ] + | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ P → P | _ ⇒ P ] + | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ P → P | _ ⇒ P ] + | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ P → P | _ ⇒ P ] + | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ P → P | _ ⇒ P ] + | MODE_DIRn n1 ⇒ match i2 with + [ MODE_DIRn n2 ⇒ match n1 with + [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ] + | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ] + | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ] + | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ] + | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with + [ MODE_DIRn_and_IMM1 n2 ⇒ match n1 with + [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ] + | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ] + | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ] + | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ] + | MODE_TNY e1 ⇒ match i2 with + [ MODE_TNY e2 ⇒ match e1 with + [ x0 ⇒ match e2 with [ x0 ⇒ P → P | _ ⇒ P ] | x1 ⇒ match e2 with [ x1 ⇒ P → P | _ ⇒ P ] + | x2 ⇒ match e2 with [ x2 ⇒ P → P | _ ⇒ P ] | x3 ⇒ match e2 with [ x3 ⇒ P → P | _ ⇒ P ] + | x4 ⇒ match e2 with [ x4 ⇒ P → P | _ ⇒ P ] | x5 ⇒ match e2 with [ x5 ⇒ P → P | _ ⇒ P ] + | x6 ⇒ match e2 with [ x6 ⇒ P → P | _ ⇒ P ] | x7 ⇒ match e2 with [ x7 ⇒ P → P | _ ⇒ P ] + | x8 ⇒ match e2 with [ x8 ⇒ P → P | _ ⇒ P ] | x9 ⇒ match e2 with [ x9 ⇒ P → P | _ ⇒ P ] + | xA ⇒ match e2 with [ xA ⇒ P → P | _ ⇒ P ] | xB ⇒ match e2 with [ xB ⇒ P → P | _ ⇒ P ] + | xC ⇒ match e2 with [ xC ⇒ P → P | _ ⇒ P ] | xD ⇒ match e2 with [ xD ⇒ P → P | _ ⇒ P ] + | xE ⇒ match e2 with [ xE ⇒ P → P | _ ⇒ P ] | xF ⇒ match e2 with [ xF ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ] + | MODE_SRT t1 ⇒ match i2 with + [ MODE_SRT t2 ⇒ match t1 with + [ t00 ⇒ match t2 with [ t00 ⇒ P → P | _ ⇒ P ] | t01 ⇒ match t2 with [ t01 ⇒ P → P | _ ⇒ P ] + | t02 ⇒ match t2 with [ t02 ⇒ P → P | _ ⇒ P ] | t03 ⇒ match t2 with [ t03 ⇒ P → P | _ ⇒ P ] + | t04 ⇒ match t2 with [ t04 ⇒ P → P | _ ⇒ P ] | t05 ⇒ match t2 with [ t05 ⇒ P → P | _ ⇒ P ] + | t06 ⇒ match t2 with [ t06 ⇒ P → P | _ ⇒ P ] | t07 ⇒ match t2 with [ t07 ⇒ P → P | _ ⇒ P ] + | t08 ⇒ match t2 with [ t08 ⇒ P → P | _ ⇒ P ] | t09 ⇒ match t2 with [ t09 ⇒ P → P | _ ⇒ P ] + | t0A ⇒ match t2 with [ t0A ⇒ P → P | _ ⇒ P ] | t0B ⇒ match t2 with [ t0B ⇒ P → P | _ ⇒ P ] + | t0C ⇒ match t2 with [ t0C ⇒ P → P | _ ⇒ P ] | t0D ⇒ match t2 with [ t0D ⇒ P → P | _ ⇒ P ] + | t0E ⇒ match t2 with [ t0E ⇒ P → P | _ ⇒ P ] | t0F ⇒ match t2 with [ t0F ⇒ P → P | _ ⇒ P ] + | t10 ⇒ match t2 with [ t10 ⇒ P → P | _ ⇒ P ] | t11 ⇒ match t2 with [ t11 ⇒ P → P | _ ⇒ P ] + | t12 ⇒ match t2 with [ t12 ⇒ P → P | _ ⇒ P ] | t13 ⇒ match t2 with [ t13 ⇒ P → P | _ ⇒ P ] + | t14 ⇒ match t2 with [ t14 ⇒ P → P | _ ⇒ P ] | t15 ⇒ match t2 with [ t15 ⇒ P → P | _ ⇒ P ] + | t16 ⇒ match t2 with [ t16 ⇒ P → P | _ ⇒ P ] | t17 ⇒ match t2 with [ t17 ⇒ P → P | _ ⇒ P ] + | t18 ⇒ match t2 with [ t18 ⇒ P → P | _ ⇒ P ] | t19 ⇒ match t2 with [ t19 ⇒ P → P | _ ⇒ P ] + | t1A ⇒ match t2 with [ t1A ⇒ P → P | _ ⇒ P ] | t1B ⇒ match t2 with [ t1B ⇒ P → P | _ ⇒ P ] + | t1C ⇒ match t2 with [ t1C ⇒ P → P | _ ⇒ P ] | t1D ⇒ match t2 with [ t1D ⇒ P → P | _ ⇒ P ] + | t1E ⇒ match t2 with [ t1E ⇒ P → P | _ ⇒ P ] | t1F ⇒ match t2 with [ t1F ⇒ P → P | _ ⇒ P ]] + | _ ⇒ P ] + ]. + +ndefinition instr_mode_destruct : instr_mode_destruct_aux. + #t1; ncases t1; + ##[ ##1: napply instr_mode_destruct1 ##| ##2: napply instr_mode_destruct2 + ##| ##3: napply instr_mode_destruct3 ##| ##4: napply instr_mode_destruct4 + ##| ##5: napply instr_mode_destruct5 ##| ##6: napply instr_mode_destruct6 + ##| ##7: napply instr_mode_destruct7 ##| ##8: napply instr_mode_destruct8 + ##| ##9: napply instr_mode_destruct9 ##| ##10: napply instr_mode_destruct10 + ##| ##11: napply instr_mode_destruct11 ##| ##12: napply instr_mode_destruct12 + ##| ##13: napply instr_mode_destruct13 ##| ##14: napply instr_mode_destruct14 + ##| ##15: napply instr_mode_destruct15 ##| ##16: napply instr_mode_destruct16 + ##| ##17: napply instr_mode_destruct17 ##| ##18: napply instr_mode_destruct18 + ##| ##19: napply instr_mode_destruct19 ##| ##20: napply instr_mode_destruct20 + ##| ##21: napply instr_mode_destruct21 ##| ##22: napply instr_mode_destruct22 + ##| ##23: napply instr_mode_destruct23 ##| ##24: napply instr_mode_destruct24 + ##| ##25: napply instr_mode_destruct25 ##| ##26: napply instr_mode_destruct26 + ##| ##27: napply instr_mode_destruct27 ##| ##28: napply instr_mode_destruct28 + ##| ##29: napply instr_mode_destruct29 ##| ##30: napply instr_mode_destruct30 + ##| ##31: napply instr_mode_destruct31 ##| ##32: napply instr_mode_destruct32 + ##| ##33: napply instr_mode_destruct33 ##| ##34: napply instr_mode_destruct34 + ##] +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode2.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode2.ma new file mode 100755 index 000000000..ae0eb7558 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode2.ma @@ -0,0 +1,711 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode_base_lemmas_instrmode1.ma". + +(* ********************************************** *) +(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *) +(* ********************************************** *) + +nlemma symmetric_eqinstrmode : symmetricT instr_mode bool eq_instrmode. + #i1; #i2; + ncases i1; + ##[ ##1: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##2: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##3: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##4: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##5: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##6: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##7: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##8: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##9: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##10: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##11: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##12: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##13: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##14: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##15: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##16: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##17: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##18: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##19: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##20: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##21: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##22: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##23: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##24: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##25: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##26: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##27: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##28: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##29: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##30: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply (refl_eq ??) + ##| ##31: ncases i2; #n1; + ##[ ##31: #n2; + nchange with (eq_oct n2 n1 = eq_oct n1 n2); + nrewrite > (symmetric_eqoct n1 n2); + ##| ##32,33,34: #n2; nnormalize + ##] + nnormalize; napply (refl_eq ??) + ##| ##32: ncases i2; #n1; + ##[ ##32: #n2; + nchange with (eq_oct n2 n1 = eq_oct n1 n2); + nrewrite > (symmetric_eqoct n1 n2); + ##| ##31,33,34: #n2; nnormalize + ##] + nnormalize; napply (refl_eq ??) + ##| ##33: ncases i2; #n1; + ##[ ##33: #n2; + nchange with (eq_ex n2 n1 = eq_ex n1 n2); + nrewrite > (symmetric_eqex n1 n2); + ##| ##31,32,34: #n2; nnormalize + ##] + nnormalize; napply (refl_eq ??) + ##| ##34: ncases i2; #n1; + ##[ ##34: #n2; + nchange with (eq_bitrig n2 n1 = eq_bitrig n1 n2); + nrewrite > (symmetric_eqbitrig n1 n2); + ##| ##31,32,33: #n2; nnormalize + ##] + nnormalize; napply (refl_eq ??) + ##] +nqed. + +nlemma eqinstrmode_to_eq1 : ∀i2.eq_instrmode MODE_INH i2 = true → MODE_INH = i2. + #i2; ncases i2; nnormalize; + ##[ ##1: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq2 : ∀i2.eq_instrmode MODE_INHA i2 = true → MODE_INHA = i2. + #i2; ncases i2; nnormalize; + ##[ ##2: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq3 : ∀i2.eq_instrmode MODE_INHX i2 = true → MODE_INHX = i2. + #i2; ncases i2; nnormalize; + ##[ ##3: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq4 : ∀i2.eq_instrmode MODE_INHH i2 = true → MODE_INHH = i2. + #i2; ncases i2; nnormalize; + ##[ ##4: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq5 : ∀i2.eq_instrmode MODE_INHX0ADD i2 = true → MODE_INHX0ADD = i2. + #i2; ncases i2; nnormalize; + ##[ ##5: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq6 : ∀i2.eq_instrmode MODE_INHX1ADD i2 = true → MODE_INHX1ADD = i2. + #i2; ncases i2; nnormalize; + ##[ ##6: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq7 : ∀i2.eq_instrmode MODE_INHX2ADD i2 = true → MODE_INHX2ADD = i2. + #i2; ncases i2; nnormalize; + ##[ ##7: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq8 : ∀i2.eq_instrmode MODE_IMM1 i2 = true → MODE_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##8: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq9 : ∀i2.eq_instrmode MODE_IMM1EXT i2 = true → MODE_IMM1EXT = i2. + #i2; ncases i2; nnormalize; + ##[ ##9: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq10 : ∀i2.eq_instrmode MODE_IMM2 i2 = true → MODE_IMM2 = i2. + #i2; ncases i2; nnormalize; + ##[ ##10: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq11 : ∀i2.eq_instrmode MODE_DIR1 i2 = true → MODE_DIR1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##11: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq12 : ∀i2.eq_instrmode MODE_DIR2 i2 = true → MODE_DIR2 = i2. + #i2; ncases i2; nnormalize; + ##[ ##12: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq13 : ∀i2.eq_instrmode MODE_IX0 i2 = true → MODE_IX0 = i2. + #i2; ncases i2; nnormalize; + ##[ ##13: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq14 : ∀i2.eq_instrmode MODE_IX1 i2 = true → MODE_IX1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##14: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq15 : ∀i2.eq_instrmode MODE_IX2 i2 = true → MODE_IX2 = i2. + #i2; ncases i2; nnormalize; + ##[ ##15: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq16 : ∀i2.eq_instrmode MODE_SP1 i2 = true → MODE_SP1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##16: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq17 : ∀i2.eq_instrmode MODE_SP2 i2 = true → MODE_SP2 = i2. + #i2; ncases i2; nnormalize; + ##[ ##17: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq18 : ∀i2.eq_instrmode MODE_DIR1_to_DIR1 i2 = true → MODE_DIR1_to_DIR1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##18: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq19 : ∀i2.eq_instrmode MODE_IMM1_to_DIR1 i2 = true → MODE_IMM1_to_DIR1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##19: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq20 : ∀i2.eq_instrmode MODE_IX0p_to_DIR1 i2 = true → MODE_IX0p_to_DIR1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##20: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq21 : ∀i2.eq_instrmode MODE_DIR1_to_IX0p i2 = true → MODE_DIR1_to_IX0p = i2. + #i2; ncases i2; nnormalize; + ##[ ##21: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq22 : ∀i2.eq_instrmode MODE_INHA_and_IMM1 i2 = true → MODE_INHA_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##22: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq23 : ∀i2.eq_instrmode MODE_INHX_and_IMM1 i2 = true → MODE_INHX_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##23: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq24 : ∀i2.eq_instrmode MODE_IMM1_and_IMM1 i2 = true → MODE_IMM1_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##24: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq25 : ∀i2.eq_instrmode MODE_DIR1_and_IMM1 i2 = true → MODE_DIR1_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##25: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq26 : ∀i2.eq_instrmode MODE_IX0_and_IMM1 i2 = true → MODE_IX0_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##26: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq27 : ∀i2.eq_instrmode MODE_IX0p_and_IMM1 i2 = true → MODE_IX0p_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##27: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq28 : ∀i2.eq_instrmode MODE_IX1_and_IMM1 i2 = true → MODE_IX1_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##28: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq29 : ∀i2.eq_instrmode MODE_IX1p_and_IMM1 i2 = true → MODE_IX1p_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##29: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq30 : ∀i2.eq_instrmode MODE_SP1_and_IMM1 i2 = true → MODE_SP1_and_IMM1 = i2. + #i2; ncases i2; nnormalize; + ##[ ##30: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (bool_destruct ??? H) + ##| ##*: #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq31 : ∀n1,i2.eq_instrmode (MODE_DIRn n1) i2 = true → MODE_DIRn n1 = i2. + #n1; #i2; ncases i2; + ##[ ##31: #n2; #H; + nchange in H:(%) with (eq_oct n1 n2 = true); + nrewrite > (eqoct_to_eq ?? H); + napply (refl_eq ??) + ##| ##32,33,34: nnormalize; #n2; #H; napply (bool_destruct ??? H) + ##| ##*: nnormalize; #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq32 : ∀n1,i2.eq_instrmode (MODE_DIRn_and_IMM1 n1) i2 = true → MODE_DIRn_and_IMM1 n1 = i2. + #n1; #i2; ncases i2; + ##[ ##32: #n2; #H; + nchange in H:(%) with (eq_oct n1 n2 = true); + nrewrite > (eqoct_to_eq ?? H); + napply (refl_eq ??) + ##| ##31,33,34: nnormalize; #n2; #H; napply (bool_destruct ??? H) + ##| ##*: nnormalize; #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq33 : ∀n1,i2.eq_instrmode (MODE_TNY n1) i2 = true → MODE_TNY n1 = i2. + #n1; #i2; ncases i2; + ##[ ##33: #n2; #H; + nchange in H:(%) with (eq_ex n1 n2 = true); + nrewrite > (eqex_to_eq ?? H); + napply (refl_eq ??) + ##| ##31,32,34: nnormalize; #n2; #H; napply (bool_destruct ??? H) + ##| ##*: nnormalize; #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq34 : ∀n1,i2.eq_instrmode (MODE_SRT n1) i2 = true → MODE_SRT n1 = i2. + #n1; #i2; ncases i2; + ##[ ##34: #n2; #H; + nchange in H:(%) with (eq_bitrig n1 n2 = true); + nrewrite > (eqbitrig_to_eq ?? H); + napply (refl_eq ??) + ##| ##31,32,33: nnormalize; #n2; #H; napply (bool_destruct ??? H) + ##| ##*: nnormalize; #H; napply (bool_destruct ??? H) + ##] +nqed. + +nlemma eqinstrmode_to_eq : ∀i1,i2.eq_instrmode i1 i2 = true → i1 = i2. + #i1; ncases i1; + ##[ ##1: napply eqinstrmode_to_eq1 ##| ##2: napply eqinstrmode_to_eq2 + ##| ##3: napply eqinstrmode_to_eq3 ##| ##4: napply eqinstrmode_to_eq4 + ##| ##5: napply eqinstrmode_to_eq5 ##| ##6: napply eqinstrmode_to_eq6 + ##| ##7: napply eqinstrmode_to_eq7 ##| ##8: napply eqinstrmode_to_eq8 + ##| ##9: napply eqinstrmode_to_eq9 ##| ##10: napply eqinstrmode_to_eq10 + ##| ##11: napply eqinstrmode_to_eq11 ##| ##12: napply eqinstrmode_to_eq12 + ##| ##13: napply eqinstrmode_to_eq13 ##| ##14: napply eqinstrmode_to_eq14 + ##| ##15: napply eqinstrmode_to_eq15 ##| ##16: napply eqinstrmode_to_eq16 + ##| ##17: napply eqinstrmode_to_eq17 ##| ##18: napply eqinstrmode_to_eq18 + ##| ##19: napply eqinstrmode_to_eq19 ##| ##20: napply eqinstrmode_to_eq20 + ##| ##21: napply eqinstrmode_to_eq21 ##| ##22: napply eqinstrmode_to_eq22 + ##| ##23: napply eqinstrmode_to_eq23 ##| ##24: napply eqinstrmode_to_eq24 + ##| ##25: napply eqinstrmode_to_eq25 ##| ##26: napply eqinstrmode_to_eq26 + ##| ##27: napply eqinstrmode_to_eq27 ##| ##28: napply eqinstrmode_to_eq28 + ##| ##29: napply eqinstrmode_to_eq29 ##| ##30: napply eqinstrmode_to_eq30 + ##| ##31: napply eqinstrmode_to_eq31 ##| ##32: napply eqinstrmode_to_eq32 + ##| ##33: napply eqinstrmode_to_eq33 ##| ##34: napply eqinstrmode_to_eq34 + ##] +nqed. + +nlemma eq_to_eqinstrmode1 : ∀i2.MODE_INH = i2 → eq_instrmode MODE_INH i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##1: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode2 : ∀i2.MODE_INHA = i2 → eq_instrmode MODE_INHA i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##2: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode3 : ∀i2.MODE_INHX = i2 → eq_instrmode MODE_INHX i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##3: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode4 : ∀i2.MODE_INHH = i2 → eq_instrmode MODE_INHH i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##4: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode5 : ∀i2.MODE_INHX0ADD = i2 → eq_instrmode MODE_INHX0ADD i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##5: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode6 : ∀i2.MODE_INHX1ADD = i2 → eq_instrmode MODE_INHX1ADD i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##6: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode7 : ∀i2.MODE_INHX2ADD = i2 → eq_instrmode MODE_INHX2ADD i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##7: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode8 : ∀i2.MODE_IMM1 = i2 → eq_instrmode MODE_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##8: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode9 : ∀i2.MODE_IMM1EXT = i2 → eq_instrmode MODE_IMM1EXT i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##9: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode10 : ∀i2.MODE_IMM2 = i2 → eq_instrmode MODE_IMM2 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##10: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode11 : ∀i2.MODE_DIR1 = i2 → eq_instrmode MODE_DIR1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##11: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode12 : ∀i2.MODE_DIR2 = i2 → eq_instrmode MODE_DIR2 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##12: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode13 : ∀i2.MODE_IX0 = i2 → eq_instrmode MODE_IX0 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##13: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode14 : ∀i2.MODE_IX1 = i2 → eq_instrmode MODE_IX1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##14: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode15 : ∀i2.MODE_IX2 = i2 → eq_instrmode MODE_IX2 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##15: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode16 : ∀i2.MODE_SP1 = i2 → eq_instrmode MODE_SP1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##16: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode17 : ∀i2.MODE_SP2 = i2 → eq_instrmode MODE_SP2 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##17: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode18 : ∀i2.MODE_DIR1_to_DIR1 = i2 → eq_instrmode MODE_DIR1_to_DIR1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##18: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode19 : ∀i2.MODE_IMM1_to_DIR1 = i2 → eq_instrmode MODE_IMM1_to_DIR1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##19: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode20 : ∀i2.MODE_IX0p_to_DIR1 = i2 → eq_instrmode MODE_IX0p_to_DIR1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##20: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode21 : ∀i2.MODE_DIR1_to_IX0p = i2 → eq_instrmode MODE_DIR1_to_IX0p i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##21: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode22 : ∀i2.MODE_INHA_and_IMM1 = i2 → eq_instrmode MODE_INHA_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##22: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode23 : ∀i2.MODE_INHX_and_IMM1 = i2 → eq_instrmode MODE_INHX_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##23: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode24 : ∀i2.MODE_IMM1_and_IMM1 = i2 → eq_instrmode MODE_IMM1_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##24: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode25 : ∀i2.MODE_DIR1_and_IMM1 = i2 → eq_instrmode MODE_DIR1_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##25: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode26 : ∀i2.MODE_IX0_and_IMM1 = i2 → eq_instrmode MODE_IX0_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##26: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode27 : ∀i2.MODE_IX0p_and_IMM1 = i2 → eq_instrmode MODE_IX0p_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##27: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode28 : ∀i2.MODE_IX1_and_IMM1 = i2 → eq_instrmode MODE_IX1_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##28: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode29 : ∀i2.MODE_IX1p_and_IMM1 = i2 → eq_instrmode MODE_IX1p_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##29: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode30 : ∀i2.MODE_SP1_and_IMM1 = i2 → eq_instrmode MODE_SP1_and_IMM1 i2 = true. + #t2; ncases t2; nnormalize; + ##[ ##30: #H; napply (refl_eq ??) + ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct ??? H) + ##| ##*: #H; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode31 : ∀n1,i2.MODE_DIRn n1 = i2 → eq_instrmode (MODE_DIRn n1) i2 = true. + #n1; #t2; ncases t2; + ##[ ##31: #n2; #H; + nchange with (eq_oct n1 n2 = true); + nrewrite > (instr_mode_destruct_MODE_DIRn ?? H); + nrewrite > (eq_to_eqoct n2 n2 (refl_eq ??)); + napply (refl_eq ??) + ##| ##32,33,34: #n; #H; nnormalize; napply (instr_mode_destruct ??? H) + ##| ##*: #H; nnormalize; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode32 : ∀n1,i2.MODE_DIRn_and_IMM1 n1 = i2 → eq_instrmode (MODE_DIRn_and_IMM1 n1) i2 = true. + #n1; #t2; ncases t2; + ##[ ##32: #n2; #H; + nchange with (eq_oct n1 n2 = true); + nrewrite > (instr_mode_destruct_MODE_DIRn_and_IMM1 ?? H); + nrewrite > (eq_to_eqoct n2 n2 (refl_eq ??)); + napply (refl_eq ??) + ##| ##31,33,34: #n; #H; nnormalize; napply (instr_mode_destruct ??? H) + ##| ##*: #H; nnormalize; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode33 : ∀n1,i2.MODE_TNY n1 = i2 → eq_instrmode (MODE_TNY n1) i2 = true. + #n1; #t2; ncases t2; + ##[ ##33: #n2; #H; + nchange with (eq_ex n1 n2 = true); + nrewrite > (instr_mode_destruct_MODE_TNY ?? H); + nrewrite > (eq_to_eqex n2 n2 (refl_eq ??)); + napply (refl_eq ??) + ##| ##31,32,34: #n; #H; nnormalize; napply (instr_mode_destruct ??? H) + ##| ##*: #H; nnormalize; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode34 : ∀n1,i2.MODE_SRT n1 = i2 → eq_instrmode (MODE_SRT n1) i2 = true. + #n1; #t2; ncases t2; + ##[ ##34: #n2; #H; + nchange with (eq_bitrig n1 n2 = true); + nrewrite > (instr_mode_destruct_MODE_SRT ?? H); + nrewrite > (eq_to_eqbitrig n2 n2 (refl_eq ??)); + napply (refl_eq ??) + ##| ##31,32,33: #n; #H; nnormalize; napply (instr_mode_destruct ??? H) + ##| ##*: #H; nnormalize; napply (instr_mode_destruct ??? H) + ##] +nqed. + +nlemma eq_to_eqinstrmode : ∀i1,i2.i1 = i2 → eq_instrmode i1 i2 = true. + #i1; ncases i1; + ##[ ##1: napply eq_to_eqinstrmode1 ##| ##2: napply eq_to_eqinstrmode2 + ##| ##3: napply eq_to_eqinstrmode3 ##| ##4: napply eq_to_eqinstrmode4 + ##| ##5: napply eq_to_eqinstrmode5 ##| ##6: napply eq_to_eqinstrmode6 + ##| ##7: napply eq_to_eqinstrmode7 ##| ##8: napply eq_to_eqinstrmode8 + ##| ##9: napply eq_to_eqinstrmode9 ##| ##10: napply eq_to_eqinstrmode10 + ##| ##11: napply eq_to_eqinstrmode11 ##| ##12: napply eq_to_eqinstrmode12 + ##| ##13: napply eq_to_eqinstrmode13 ##| ##14: napply eq_to_eqinstrmode14 + ##| ##15: napply eq_to_eqinstrmode15 ##| ##16: napply eq_to_eqinstrmode16 + ##| ##17: napply eq_to_eqinstrmode17 ##| ##18: napply eq_to_eqinstrmode18 + ##| ##19: napply eq_to_eqinstrmode19 ##| ##20: napply eq_to_eqinstrmode20 + ##| ##21: napply eq_to_eqinstrmode21 ##| ##22: napply eq_to_eqinstrmode22 + ##| ##23: napply eq_to_eqinstrmode23 ##| ##24: napply eq_to_eqinstrmode24 + ##| ##25: napply eq_to_eqinstrmode25 ##| ##26: napply eq_to_eqinstrmode26 + ##| ##27: napply eq_to_eqinstrmode27 ##| ##28: napply eq_to_eqinstrmode28 + ##| ##29: napply eq_to_eqinstrmode29 ##| ##30: napply eq_to_eqinstrmode30 + ##| ##31: napply eq_to_eqinstrmode31 ##| ##32: napply eq_to_eqinstrmode32 + ##| ##33: napply eq_to_eqinstrmode33 ##| ##34: napply eq_to_eqinstrmode34 + ##] +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode1.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode1.ma new file mode 100755 index 000000000..8eafc8c10 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode1.ma @@ -0,0 +1,974 @@ +(**************************************************************************) +(* ___ *) +(* ||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 opcode_destruct1 : Πop2.ΠP:Prop.ADC = op2 → match op2 with [ ADC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##1: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ADC with [ ADC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct2 : Πop2.ΠP:Prop.ADD = op2 → match op2 with [ ADD ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##2: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ADD with [ ADD ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct3 : Πop2.ΠP:Prop.AIS = op2 → match op2 with [ AIS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##3: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match AIS with [ AIS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct4 : Πop2.ΠP:Prop.AIX = op2 → match op2 with [ AIX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##4: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match AIX with [ AIX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct5 : Πop2.ΠP:Prop.AND = op2 → match op2 with [ AND ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##5: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match AND with [ AND ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct6 : Πop2.ΠP:Prop.ASL = op2 → match op2 with [ ASL ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##6: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ASL with [ ASL ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct7 : Πop2.ΠP:Prop.ASR = op2 → match op2 with [ ASR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##7: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ASR with [ ASR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct8 : Πop2.ΠP:Prop.BCC = op2 → match op2 with [ BCC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##8: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BCC with [ BCC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct9 : Πop2.ΠP:Prop.BCLRn = op2 → match op2 with [ BCLRn ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##9: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BCLRn with [ BCLRn ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct10 : Πop2.ΠP:Prop.BCS = op2 → match op2 with [ BCS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##10: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BCS with [ BCS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct11 : Πop2.ΠP:Prop.BEQ = op2 → match op2 with [ BEQ ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##11: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BEQ with [ BEQ ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct12 : Πop2.ΠP:Prop.BGE = op2 → match op2 with [ BGE ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##12: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BGE with [ BGE ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct13 : Πop2.ΠP:Prop.BGND = op2 → match op2 with [ BGND ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##13: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BGND with [ BGND ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct14 : Πop2.ΠP:Prop.BGT = op2 → match op2 with [ BGT ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##14: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BGT with [ BGT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct15 : Πop2.ΠP:Prop.BHCC = op2 → match op2 with [ BHCC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##15: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BHCC with [ BHCC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct16 : Πop2.ΠP:Prop.BHCS = op2 → match op2 with [ BHCS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##16: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BHCS with [ BHCS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct17 : Πop2.ΠP:Prop.BHI = op2 → match op2 with [ BHI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##17: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BHI with [ BHI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct18 : Πop2.ΠP:Prop.BIH = op2 → match op2 with [ BIH ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##18: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BIH with [ BIH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct19 : Πop2.ΠP:Prop.BIL = op2 → match op2 with [ BIL ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##19: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BIL with [ BIL ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct20 : Πop2.ΠP:Prop.BIT = op2 → match op2 with [ BIT ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##20: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BIT with [ BIT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct21 : Πop2.ΠP:Prop.BLE = op2 → match op2 with [ BLE ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##21: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BLE with [ BLE ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct22 : Πop2.ΠP:Prop.BLS = op2 → match op2 with [ BLS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##22: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BLS with [ BLS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct23 : Πop2.ΠP:Prop.BLT = op2 → match op2 with [ BLT ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##23: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BLT with [ BLT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct24 : Πop2.ΠP:Prop.BMC = op2 → match op2 with [ BMC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##24: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BMC with [ BMC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct25 : Πop2.ΠP:Prop.BMI = op2 → match op2 with [ BMI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##25: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BMI with [ BMI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct26 : Πop2.ΠP:Prop.BMS = op2 → match op2 with [ BMS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##26: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BMS with [ BMS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct27 : Πop2.ΠP:Prop.BNE = op2 → match op2 with [ BNE ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##27: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BNE with [ BNE ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct28 : Πop2.ΠP:Prop.BPL = op2 → match op2 with [ BPL ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##28: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BPL with [ BPL ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct29 : Πop2.ΠP:Prop.BRA = op2 → match op2 with [ BRA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##29: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BRA with [ BRA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct30 : Πop2.ΠP:Prop.BRCLRn = op2 → match op2 with [ BRCLRn ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##30: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BRCLRn with [ BRCLRn ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct31 : Πop2.ΠP:Prop.BRN = op2 → match op2 with [ BRN ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##31: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BRN with [ BRN ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct32 : Πop2.ΠP:Prop.BRSETn = op2 → match op2 with [ BRSETn ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##32: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BRSETn with [ BRSETn ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct33 : Πop2.ΠP:Prop.BSETn = op2 → match op2 with [ BSETn ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##33: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BSETn with [ BSETn ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct34 : Πop2.ΠP:Prop.BSR = op2 → match op2 with [ BSR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##34: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match BSR with [ BSR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct35 : Πop2.ΠP:Prop.CBEQA = op2 → match op2 with [ CBEQA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##35: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CBEQA with [ CBEQA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct36 : Πop2.ΠP:Prop.CBEQX = op2 → match op2 with [ CBEQX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##36: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CBEQX with [ CBEQX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct37 : Πop2.ΠP:Prop.CLC = op2 → match op2 with [ CLC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##37: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CLC with [ CLC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct38 : Πop2.ΠP:Prop.CLI = op2 → match op2 with [ CLI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##38: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CLI with [ CLI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct39 : Πop2.ΠP:Prop.CLR = op2 → match op2 with [ CLR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##39: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CLR with [ CLR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct40 : Πop2.ΠP:Prop.CMP = op2 → match op2 with [ CMP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##40: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CMP with [ CMP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct41 : Πop2.ΠP:Prop.COM = op2 → match op2 with [ COM ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##41: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match COM with [ COM ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct42 : Πop2.ΠP:Prop.CPHX = op2 → match op2 with [ CPHX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##42: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CPHX with [ CPHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct43 : Πop2.ΠP:Prop.CPX = op2 → match op2 with [ CPX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##43: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match CPX with [ CPX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct44 : Πop2.ΠP:Prop.DAA = op2 → match op2 with [ DAA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##44: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match DAA with [ DAA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct45 : Πop2.ΠP:Prop.DBNZ = op2 → match op2 with [ DBNZ ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##45: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match DBNZ with [ DBNZ ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct46 : Πop2.ΠP:Prop.DEC = op2 → match op2 with [ DEC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##46: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match DEC with [ DEC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct47 : Πop2.ΠP:Prop.DIV = op2 → match op2 with [ DIV ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##47: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match DIV with [ DIV ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct48 : Πop2.ΠP:Prop.EOR = op2 → match op2 with [ EOR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##48: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match EOR with [ EOR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct49 : Πop2.ΠP:Prop.INC = op2 → match op2 with [ INC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##49: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match INC with [ INC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct50 : Πop2.ΠP:Prop.JMP = op2 → match op2 with [ JMP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##50: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match JMP with [ JMP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct51 : Πop2.ΠP:Prop.JSR = op2 → match op2 with [ JSR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##51: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match JSR with [ JSR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct52 : Πop2.ΠP:Prop.LDA = op2 → match op2 with [ LDA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##52: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match LDA with [ LDA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct53 : Πop2.ΠP:Prop.LDHX = op2 → match op2 with [ LDHX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##53: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match LDHX with [ LDHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct54 : Πop2.ΠP:Prop.LDX = op2 → match op2 with [ LDX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##54: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match LDX with [ LDX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct55 : Πop2.ΠP:Prop.LSR = op2 → match op2 with [ LSR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##55: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match LSR with [ LSR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct56 : Πop2.ΠP:Prop.MOV = op2 → match op2 with [ MOV ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##56: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match MOV with [ MOV ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct57 : Πop2.ΠP:Prop.MUL = op2 → match op2 with [ MUL ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##57: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match MUL with [ MUL ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct58 : Πop2.ΠP:Prop.NEG = op2 → match op2 with [ NEG ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##58: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match NEG with [ NEG ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct59 : Πop2.ΠP:Prop.NOP = op2 → match op2 with [ NOP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##59: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match NOP with [ NOP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct60 : Πop2.ΠP:Prop.NSA = op2 → match op2 with [ NSA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##60: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match NSA with [ NSA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct61 : Πop2.ΠP:Prop.ORA = op2 → match op2 with [ ORA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##61: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ORA with [ ORA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct62 : Πop2.ΠP:Prop.PSHA = op2 → match op2 with [ PSHA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##62: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PSHA with [ PSHA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct63 : Πop2.ΠP:Prop.PSHH = op2 → match op2 with [ PSHH ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##63: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PSHH with [ PSHH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct64 : Πop2.ΠP:Prop.PSHX = op2 → match op2 with [ PSHX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##64: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PSHX with [ PSHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct65 : Πop2.ΠP:Prop.PULA = op2 → match op2 with [ PULA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##65: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PULA with [ PULA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct66 : Πop2.ΠP:Prop.PULH = op2 → match op2 with [ PULH ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##66: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PULH with [ PULH ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct67 : Πop2.ΠP:Prop.PULX = op2 → match op2 with [ PULX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##67: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match PULX with [ PULX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct68 : Πop2.ΠP:Prop.ROL = op2 → match op2 with [ ROL ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##68: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ROL with [ ROL ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct69 : Πop2.ΠP:Prop.ROR = op2 → match op2 with [ ROR ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##69: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match ROR with [ ROR ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct70 : Πop2.ΠP:Prop.RSP = op2 → match op2 with [ RSP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##70: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match RSP with [ RSP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct71 : Πop2.ΠP:Prop.RTI = op2 → match op2 with [ RTI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##71: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match RTI with [ RTI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct72 : Πop2.ΠP:Prop.RTS = op2 → match op2 with [ RTS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##72: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match RTS with [ RTS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct73 : Πop2.ΠP:Prop.SBC = op2 → match op2 with [ SBC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##73: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SBC with [ SBC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct74 : Πop2.ΠP:Prop.SEC = op2 → match op2 with [ SEC ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##74: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SEC with [ SEC ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct75 : Πop2.ΠP:Prop.SEI = op2 → match op2 with [ SEI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##75: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SEI with [ SEI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct76 : Πop2.ΠP:Prop.SHA = op2 → match op2 with [ SHA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##76: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SHA with [ SHA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct77 : Πop2.ΠP:Prop.SLA = op2 → match op2 with [ SLA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##77: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SLA with [ SLA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct78 : Πop2.ΠP:Prop.STA = op2 → match op2 with [ STA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##78: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match STA with [ STA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct79 : Πop2.ΠP:Prop.STHX = op2 → match op2 with [ STHX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##79: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match STHX with [ STHX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct80 : Πop2.ΠP:Prop.STOP = op2 → match op2 with [ STOP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##80: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match STOP with [ STOP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct81 : Πop2.ΠP:Prop.STX = op2 → match op2 with [ STX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##81: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match STX with [ STX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct82 : Πop2.ΠP:Prop.SUB = op2 → match op2 with [ SUB ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##82: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SUB with [ SUB ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct83 : Πop2.ΠP:Prop.SWI = op2 → match op2 with [ SWI ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##83: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match SWI with [ SWI ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct84 : Πop2.ΠP:Prop.TAP = op2 → match op2 with [ TAP ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##84: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TAP with [ TAP ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct85 : Πop2.ΠP:Prop.TAX = op2 → match op2 with [ TAX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##85: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TAX with [ TAX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct86 : Πop2.ΠP:Prop.TPA = op2 → match op2 with [ TPA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##86: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TPA with [ TPA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct87 : Πop2.ΠP:Prop.TST = op2 → match op2 with [ TST ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##87: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TST with [ TST ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct88 : Πop2.ΠP:Prop.TSX = op2 → match op2 with [ TSX ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##88: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TSX with [ TSX ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct89 : Πop2.ΠP:Prop.TXA = op2 → match op2 with [ TXA ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##89: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TXA with [ TXA ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct90 : Πop2.ΠP:Prop.TXS = op2 → match op2 with [ TXS ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##90: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match TXS with [ TXS ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct91 : Πop2.ΠP:Prop.WAIT = op2 → match op2 with [ WAIT ⇒ P → P | _ ⇒ P ]. + #op2; #P; ncases op2; nnormalize; + ##[ ##91: #H; napply (λx:P.x) + ##| ##*: #H; napply (False_ind ??); + nchange with (match WAIT with [ WAIT ⇒ False | _ ⇒ True ]); + nrewrite > H; nnormalize; napply I + ##] +nqed. + +ndefinition opcode_destruct_aux ≝ +Πop1,op2.ΠP:Prop.op1 = op2 → + match op1 with + [ ADC ⇒ match op2 with [ ADC ⇒ P → P | _ ⇒ P ] + | ADD ⇒ match op2 with [ ADD ⇒ P → P | _ ⇒ P ] + | AIS ⇒ match op2 with [ AIS ⇒ P → P | _ ⇒ P ] + | AIX ⇒ match op2 with [ AIX ⇒ P → P | _ ⇒ P ] + | AND ⇒ match op2 with [ AND ⇒ P → P | _ ⇒ P ] + | ASL ⇒ match op2 with [ ASL ⇒ P → P | _ ⇒ P ] + | ASR ⇒ match op2 with [ ASR ⇒ P → P | _ ⇒ P ] + | BCC ⇒ match op2 with [ BCC ⇒ P → P | _ ⇒ P ] + | BCLRn ⇒ match op2 with [ BCLRn ⇒ P → P | _ ⇒ P ] + | BCS ⇒ match op2 with [ BCS ⇒ P → P | _ ⇒ P ] + | BEQ ⇒ match op2 with [ BEQ ⇒ P → P | _ ⇒ P ] + | BGE ⇒ match op2 with [ BGE ⇒ P → P | _ ⇒ P ] + | BGND ⇒ match op2 with [ BGND ⇒ P → P | _ ⇒ P ] + | BGT ⇒ match op2 with [ BGT ⇒ P → P | _ ⇒ P ] + | BHCC ⇒ match op2 with [ BHCC ⇒ P → P | _ ⇒ P ] + | BHCS ⇒ match op2 with [ BHCS ⇒ P → P | _ ⇒ P ] + | BHI ⇒ match op2 with [ BHI ⇒ P → P | _ ⇒ P ] + | BIH ⇒ match op2 with [ BIH ⇒ P → P | _ ⇒ P ] + | BIL ⇒ match op2 with [ BIL ⇒ P → P | _ ⇒ P ] + | BIT ⇒ match op2 with [ BIT ⇒ P → P | _ ⇒ P ] + | BLE ⇒ match op2 with [ BLE ⇒ P → P | _ ⇒ P ] + | BLS ⇒ match op2 with [ BLS ⇒ P → P | _ ⇒ P ] + | BLT ⇒ match op2 with [ BLT ⇒ P → P | _ ⇒ P ] + | BMC ⇒ match op2 with [ BMC ⇒ P → P | _ ⇒ P ] + | BMI ⇒ match op2 with [ BMI ⇒ P → P | _ ⇒ P ] + | BMS ⇒ match op2 with [ BMS ⇒ P → P | _ ⇒ P ] + | BNE ⇒ match op2 with [ BNE ⇒ P → P | _ ⇒ P ] + | BPL ⇒ match op2 with [ BPL ⇒ P → P | _ ⇒ P ] + | BRA ⇒ match op2 with [ BRA ⇒ P → P | _ ⇒ P ] + | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ P → P | _ ⇒ P ] + | BRN ⇒ match op2 with [ BRN ⇒ P → P | _ ⇒ P ] + | BRSETn ⇒ match op2 with [ BRSETn ⇒ P → P | _ ⇒ P ] + | BSETn ⇒ match op2 with [ BSETn ⇒ P → P | _ ⇒ P ] + | BSR ⇒ match op2 with [ BSR ⇒ P → P | _ ⇒ P ] + | CBEQA ⇒ match op2 with [ CBEQA ⇒ P → P | _ ⇒ P ] + | CBEQX ⇒ match op2 with [ CBEQX ⇒ P → P | _ ⇒ P ] + | CLC ⇒ match op2 with [ CLC ⇒ P → P | _ ⇒ P ] + | CLI ⇒ match op2 with [ CLI ⇒ P → P | _ ⇒ P ] + | CLR ⇒ match op2 with [ CLR ⇒ P → P | _ ⇒ P ] + | CMP ⇒ match op2 with [ CMP ⇒ P → P | _ ⇒ P ] + | COM ⇒ match op2 with [ COM ⇒ P → P | _ ⇒ P ] + | CPHX ⇒ match op2 with [ CPHX ⇒ P → P | _ ⇒ P ] + | CPX ⇒ match op2 with [ CPX ⇒ P → P | _ ⇒ P ] + | DAA ⇒ match op2 with [ DAA ⇒ P → P | _ ⇒ P ] + | DBNZ ⇒ match op2 with [ DBNZ ⇒ P → P | _ ⇒ P ] + | DEC ⇒ match op2 with [ DEC ⇒ P → P | _ ⇒ P ] + | DIV ⇒ match op2 with [ DIV ⇒ P → P | _ ⇒ P ] + | EOR ⇒ match op2 with [ EOR ⇒ P → P | _ ⇒ P ] + | INC ⇒ match op2 with [ INC ⇒ P → P | _ ⇒ P ] + | JMP ⇒ match op2 with [ JMP ⇒ P → P | _ ⇒ P ] + | JSR ⇒ match op2 with [ JSR ⇒ P → P | _ ⇒ P ] + | LDA ⇒ match op2 with [ LDA ⇒ P → P | _ ⇒ P ] + | LDHX ⇒ match op2 with [ LDHX ⇒ P → P | _ ⇒ P ] + | LDX ⇒ match op2 with [ LDX ⇒ P → P | _ ⇒ P ] + | LSR ⇒ match op2 with [ LSR ⇒ P → P | _ ⇒ P ] + | MOV ⇒ match op2 with [ MOV ⇒ P → P | _ ⇒ P ] + | MUL ⇒ match op2 with [ MUL ⇒ P → P | _ ⇒ P ] + | NEG ⇒ match op2 with [ NEG ⇒ P → P | _ ⇒ P ] + | NOP ⇒ match op2 with [ NOP ⇒ P → P | _ ⇒ P ] + | NSA ⇒ match op2 with [ NSA ⇒ P → P | _ ⇒ P ] + | ORA ⇒ match op2 with [ ORA ⇒ P → P | _ ⇒ P ] + | PSHA ⇒ match op2 with [ PSHA ⇒ P → P | _ ⇒ P ] + | PSHH ⇒ match op2 with [ PSHH ⇒ P → P | _ ⇒ P ] + | PSHX ⇒ match op2 with [ PSHX ⇒ P → P | _ ⇒ P ] + | PULA ⇒ match op2 with [ PULA ⇒ P → P | _ ⇒ P ] + | PULH ⇒ match op2 with [ PULH ⇒ P → P | _ ⇒ P ] + | PULX ⇒ match op2 with [ PULX ⇒ P → P | _ ⇒ P ] + | ROL ⇒ match op2 with [ ROL ⇒ P → P | _ ⇒ P ] + | ROR ⇒ match op2 with [ ROR ⇒ P → P | _ ⇒ P ] + | RSP ⇒ match op2 with [ RSP ⇒ P → P | _ ⇒ P ] + | RTI ⇒ match op2 with [ RTI ⇒ P → P | _ ⇒ P ] + | RTS ⇒ match op2 with [ RTS ⇒ P → P | _ ⇒ P ] + | SBC ⇒ match op2 with [ SBC ⇒ P → P | _ ⇒ P ] + | SEC ⇒ match op2 with [ SEC ⇒ P → P | _ ⇒ P ] + | SEI ⇒ match op2 with [ SEI ⇒ P → P | _ ⇒ P ] + | SHA ⇒ match op2 with [ SHA ⇒ P → P | _ ⇒ P ] + | SLA ⇒ match op2 with [ SLA ⇒ P → P | _ ⇒ P ] + | STA ⇒ match op2 with [ STA ⇒ P → P | _ ⇒ P ] + | STHX ⇒ match op2 with [ STHX ⇒ P → P | _ ⇒ P ] + | STOP ⇒ match op2 with [ STOP ⇒ P → P | _ ⇒ P ] + | STX ⇒ match op2 with [ STX ⇒ P → P | _ ⇒ P ] + | SUB ⇒ match op2 with [ SUB ⇒ P → P | _ ⇒ P ] + | SWI ⇒ match op2 with [ SWI ⇒ P → P | _ ⇒ P ] + | TAP ⇒ match op2 with [ TAP ⇒ P → P | _ ⇒ P ] + | TAX ⇒ match op2 with [ TAX ⇒ P → P | _ ⇒ P ] + | TPA ⇒ match op2 with [ TPA ⇒ P → P | _ ⇒ P ] + | TST ⇒ match op2 with [ TST ⇒ P → P | _ ⇒ P ] + | TSX ⇒ match op2 with [ TSX ⇒ P → P | _ ⇒ P ] + | TXA ⇒ match op2 with [ TXA ⇒ P → P | _ ⇒ P ] + | TXS ⇒ match op2 with [ TXS ⇒ P → P | _ ⇒ P ] + | WAIT ⇒ match op2 with [ WAIT ⇒ P → P | _ ⇒ P ] + ]. + +ndefinition opcode_destruct : opcode_destruct_aux. + #op1; ncases op1; + ##[ ##1: napply opcode_destruct1 ##| ##2: napply opcode_destruct2 ##| ##3: napply opcode_destruct3 ##| ##4: napply opcode_destruct4 + ##| ##5: napply opcode_destruct5 ##| ##6: napply opcode_destruct6 ##| ##7: napply opcode_destruct7 ##| ##8: napply opcode_destruct8 + ##| ##9: napply opcode_destruct9 ##| ##10: napply opcode_destruct10 ##| ##11: napply opcode_destruct11 ##| ##12: napply opcode_destruct12 + ##| ##13: napply opcode_destruct13 ##| ##14: napply opcode_destruct14 ##| ##15: napply opcode_destruct15 ##| ##16: napply opcode_destruct16 + ##| ##17: napply opcode_destruct17 ##| ##18: napply opcode_destruct18 ##| ##19: napply opcode_destruct19 ##| ##20: napply opcode_destruct20 + ##| ##21: napply opcode_destruct21 ##| ##22: napply opcode_destruct22 ##| ##23: napply opcode_destruct23 ##| ##24: napply opcode_destruct24 + ##| ##25: napply opcode_destruct25 ##| ##26: napply opcode_destruct26 ##| ##27: napply opcode_destruct27 ##| ##28: napply opcode_destruct28 + ##| ##29: napply opcode_destruct29 ##| ##30: napply opcode_destruct30 ##| ##31: napply opcode_destruct31 ##| ##32: napply opcode_destruct32 + ##| ##33: napply opcode_destruct33 ##| ##34: napply opcode_destruct34 ##| ##35: napply opcode_destruct35 ##| ##36: napply opcode_destruct36 + ##| ##37: napply opcode_destruct37 ##| ##38: napply opcode_destruct38 ##| ##39: napply opcode_destruct39 ##| ##40: napply opcode_destruct40 + ##| ##41: napply opcode_destruct41 ##| ##42: napply opcode_destruct42 ##| ##43: napply opcode_destruct43 ##| ##44: napply opcode_destruct44 + ##| ##45: napply opcode_destruct45 ##| ##46: napply opcode_destruct46 ##| ##47: napply opcode_destruct47 ##| ##48: napply opcode_destruct48 + ##| ##49: napply opcode_destruct49 ##| ##50: napply opcode_destruct50 ##| ##51: napply opcode_destruct51 ##| ##52: napply opcode_destruct52 + ##| ##53: napply opcode_destruct53 ##| ##54: napply opcode_destruct54 ##| ##55: napply opcode_destruct55 ##| ##56: napply opcode_destruct56 + ##| ##57: napply opcode_destruct57 ##| ##58: napply opcode_destruct58 ##| ##59: napply opcode_destruct59 ##| ##60: napply opcode_destruct60 + ##| ##61: napply opcode_destruct61 ##| ##62: napply opcode_destruct62 ##| ##63: napply opcode_destruct63 ##| ##64: napply opcode_destruct64 + ##| ##65: napply opcode_destruct65 ##| ##66: napply opcode_destruct66 ##| ##67: napply opcode_destruct67 ##| ##68: napply opcode_destruct68 + ##| ##69: napply opcode_destruct69 ##| ##70: napply opcode_destruct70 ##| ##71: napply opcode_destruct71 ##| ##72: napply opcode_destruct72 + ##| ##73: napply opcode_destruct73 ##| ##74: napply opcode_destruct74 ##| ##75: napply opcode_destruct75 ##| ##76: napply opcode_destruct76 + ##| ##77: napply opcode_destruct77 ##| ##78: napply opcode_destruct78 ##| ##79: napply opcode_destruct79 ##| ##80: napply opcode_destruct80 + ##| ##81: napply opcode_destruct81 ##| ##82: napply opcode_destruct82 ##| ##83: napply opcode_destruct83 ##| ##84: napply opcode_destruct84 + ##| ##85: napply opcode_destruct85 ##| ##86: napply opcode_destruct86 ##| ##87: napply opcode_destruct87 ##| ##88: napply opcode_destruct88 + ##| ##89: napply opcode_destruct89 ##| ##90: napply opcode_destruct90 ##| ##91: napply opcode_destruct91 ##] +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode2.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode2.ma new file mode 100755 index 000000000..cca9a9406 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode2.ma @@ -0,0 +1,388 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode_base_lemmas_opcode1.ma". + +(* ********************************************** *) +(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *) +(* ********************************************** *) + +nlemma symmetric_eqop1 : ∀op2.eq_op ADC op2 = eq_op op2 ADC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop2 : ∀op2.eq_op ADD op2 = eq_op op2 ADD. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop3 : ∀op2.eq_op AIS op2 = eq_op op2 AIS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop4 : ∀op2.eq_op AIX op2 = eq_op op2 AIX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop5 : ∀op2.eq_op AND op2 = eq_op op2 AND. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop6 : ∀op2.eq_op ASL op2 = eq_op op2 ASL. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop7 : ∀op2.eq_op ASR op2 = eq_op op2 ASR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop8 : ∀op2.eq_op BCC op2 = eq_op op2 BCC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop9 : ∀op2.eq_op BCLRn op2 = eq_op op2 BCLRn. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop10 : ∀op2.eq_op BCS op2 = eq_op op2 BCS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop11 : ∀op2.eq_op BEQ op2 = eq_op op2 BEQ. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop12 : ∀op2.eq_op BGE op2 = eq_op op2 BGE. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop13 : ∀op2.eq_op BGND op2 = eq_op op2 BGND. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop14 : ∀op2.eq_op BGT op2 = eq_op op2 BGT. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop15 : ∀op2.eq_op BHCC op2 = eq_op op2 BHCC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop16 : ∀op2.eq_op BHCS op2 = eq_op op2 BHCS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop17 : ∀op2.eq_op BHI op2 = eq_op op2 BHI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop18 : ∀op2.eq_op BIH op2 = eq_op op2 BIH. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop19 : ∀op2.eq_op BIL op2 = eq_op op2 BIL. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop20 : ∀op2.eq_op BIT op2 = eq_op op2 BIT. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop21 : ∀op2.eq_op BLE op2 = eq_op op2 BLE. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop22 : ∀op2.eq_op BLS op2 = eq_op op2 BLS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop23 : ∀op2.eq_op BLT op2 = eq_op op2 BLT. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop24 : ∀op2.eq_op BMC op2 = eq_op op2 BMC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop25 : ∀op2.eq_op BMI op2 = eq_op op2 BMI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop26 : ∀op2.eq_op BMS op2 = eq_op op2 BMS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop27 : ∀op2.eq_op BNE op2 = eq_op op2 BNE. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop28 : ∀op2.eq_op BPL op2 = eq_op op2 BPL. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop29 : ∀op2.eq_op BRA op2 = eq_op op2 BRA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop30 : ∀op2.eq_op BRCLRn op2 = eq_op op2 BRCLRn. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop31 : ∀op2.eq_op BRN op2 = eq_op op2 BRN. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop32 : ∀op2.eq_op BRSETn op2 = eq_op op2 BRSETn. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop33 : ∀op2.eq_op BSETn op2 = eq_op op2 BSETn. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop34 : ∀op2.eq_op BSR op2 = eq_op op2 BSR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop35 : ∀op2.eq_op CBEQA op2 = eq_op op2 CBEQA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop36 : ∀op2.eq_op CBEQX op2 = eq_op op2 CBEQX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop37 : ∀op2.eq_op CLC op2 = eq_op op2 CLC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop38 : ∀op2.eq_op CLI op2 = eq_op op2 CLI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop39 : ∀op2.eq_op CLR op2 = eq_op op2 CLR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop40 : ∀op2.eq_op CMP op2 = eq_op op2 CMP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop41 : ∀op2.eq_op COM op2 = eq_op op2 COM. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop42 : ∀op2.eq_op CPHX op2 = eq_op op2 CPHX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop43 : ∀op2.eq_op CPX op2 = eq_op op2 CPX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop44 : ∀op2.eq_op DAA op2 = eq_op op2 DAA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop45 : ∀op2.eq_op DBNZ op2 = eq_op op2 DBNZ. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop46 : ∀op2.eq_op DEC op2 = eq_op op2 DEC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop47 : ∀op2.eq_op DIV op2 = eq_op op2 DIV. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop48 : ∀op2.eq_op EOR op2 = eq_op op2 EOR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop49 : ∀op2.eq_op INC op2 = eq_op op2 INC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop50 : ∀op2.eq_op JMP op2 = eq_op op2 JMP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop51 : ∀op2.eq_op JSR op2 = eq_op op2 JSR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop52 : ∀op2.eq_op LDA op2 = eq_op op2 LDA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop53 : ∀op2.eq_op LDHX op2 = eq_op op2 LDHX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop54 : ∀op2.eq_op LDX op2 = eq_op op2 LDX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop55 : ∀op2.eq_op LSR op2 = eq_op op2 LSR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop56 : ∀op2.eq_op MOV op2 = eq_op op2 MOV. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop57 : ∀op2.eq_op MUL op2 = eq_op op2 MUL. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop58 : ∀op2.eq_op NEG op2 = eq_op op2 NEG. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop59 : ∀op2.eq_op NOP op2 = eq_op op2 NOP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop60 : ∀op2.eq_op NSA op2 = eq_op op2 NSA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop61 : ∀op2.eq_op ORA op2 = eq_op op2 ORA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop62 : ∀op2.eq_op PSHA op2 = eq_op op2 PSHA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop63 : ∀op2.eq_op PSHH op2 = eq_op op2 PSHH. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop64 : ∀op2.eq_op PSHX op2 = eq_op op2 PSHX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop65 : ∀op2.eq_op PULA op2 = eq_op op2 PULA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop66 : ∀op2.eq_op PULH op2 = eq_op op2 PULH. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop67 : ∀op2.eq_op PULX op2 = eq_op op2 PULX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop68 : ∀op2.eq_op ROL op2 = eq_op op2 ROL. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop69 : ∀op2.eq_op ROR op2 = eq_op op2 ROR. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop70 : ∀op2.eq_op RSP op2 = eq_op op2 RSP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop71 : ∀op2.eq_op RTI op2 = eq_op op2 RTI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop72 : ∀op2.eq_op RTS op2 = eq_op op2 RTS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop73 : ∀op2.eq_op SBC op2 = eq_op op2 SBC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop74 : ∀op2.eq_op SEC op2 = eq_op op2 SEC. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop75 : ∀op2.eq_op SEI op2 = eq_op op2 SEI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop76 : ∀op2.eq_op SHA op2 = eq_op op2 SHA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop77 : ∀op2.eq_op SLA op2 = eq_op op2 SLA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop78 : ∀op2.eq_op STA op2 = eq_op op2 STA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop79 : ∀op2.eq_op STHX op2 = eq_op op2 STHX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop80 : ∀op2.eq_op STOP op2 = eq_op op2 STOP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop81 : ∀op2.eq_op STX op2 = eq_op op2 STX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop82 : ∀op2.eq_op SUB op2 = eq_op op2 SUB. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop83 : ∀op2.eq_op SWI op2 = eq_op op2 SWI. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop84 : ∀op2.eq_op TAP op2 = eq_op op2 TAP. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop85 : ∀op2.eq_op TAX op2 = eq_op op2 TAX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop86 : ∀op2.eq_op TPA op2 = eq_op op2 TPA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop87 : ∀op2.eq_op TST op2 = eq_op op2 TST. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop88 : ∀op2.eq_op TSX op2 = eq_op op2 TSX. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop89 : ∀op2.eq_op TXA op2 = eq_op op2 TXA. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop90 : ∀op2.eq_op TXS op2 = eq_op op2 TXS. #op2; nnormalize; napply (refl_eq ??).nqed. +nlemma symmetric_eqop91 : ∀op2.eq_op WAIT op2 = eq_op op2 WAIT. #op2; nnormalize; napply (refl_eq ??).nqed. + +nlemma symmetric_eqop : symmetricT opcode bool eq_op. + #op1; ncases op1; + ##[ ##1: napply symmetric_eqop1 ##| ##2: napply symmetric_eqop2 ##| ##3: napply symmetric_eqop3 ##| ##4: napply symmetric_eqop4 + ##| ##5: napply symmetric_eqop5 ##| ##6: napply symmetric_eqop6 ##| ##7: napply symmetric_eqop7 ##| ##8: napply symmetric_eqop8 + ##| ##9: napply symmetric_eqop9 ##| ##10: napply symmetric_eqop10 ##| ##11: napply symmetric_eqop11 ##| ##12: napply symmetric_eqop12 + ##| ##13: napply symmetric_eqop13 ##| ##14: napply symmetric_eqop14 ##| ##15: napply symmetric_eqop15 ##| ##16: napply symmetric_eqop16 + ##| ##17: napply symmetric_eqop17 ##| ##18: napply symmetric_eqop18 ##| ##19: napply symmetric_eqop19 ##| ##20: napply symmetric_eqop20 + ##| ##21: napply symmetric_eqop21 ##| ##22: napply symmetric_eqop22 ##| ##23: napply symmetric_eqop23 ##| ##24: napply symmetric_eqop24 + ##| ##25: napply symmetric_eqop25 ##| ##26: napply symmetric_eqop26 ##| ##27: napply symmetric_eqop27 ##| ##28: napply symmetric_eqop28 + ##| ##29: napply symmetric_eqop29 ##| ##30: napply symmetric_eqop30 ##| ##31: napply symmetric_eqop31 ##| ##32: napply symmetric_eqop32 + ##| ##33: napply symmetric_eqop33 ##| ##34: napply symmetric_eqop34 ##| ##35: napply symmetric_eqop35 ##| ##36: napply symmetric_eqop36 + ##| ##37: napply symmetric_eqop37 ##| ##38: napply symmetric_eqop38 ##| ##39: napply symmetric_eqop39 ##| ##40: napply symmetric_eqop40 + ##| ##41: napply symmetric_eqop41 ##| ##42: napply symmetric_eqop42 ##| ##43: napply symmetric_eqop43 ##| ##44: napply symmetric_eqop44 + ##| ##45: napply symmetric_eqop45 ##| ##46: napply symmetric_eqop46 ##| ##47: napply symmetric_eqop47 ##| ##48: napply symmetric_eqop48 + ##| ##49: napply symmetric_eqop49 ##| ##50: napply symmetric_eqop50 ##| ##51: napply symmetric_eqop51 ##| ##52: napply symmetric_eqop52 + ##| ##53: napply symmetric_eqop53 ##| ##54: napply symmetric_eqop54 ##| ##55: napply symmetric_eqop55 ##| ##56: napply symmetric_eqop56 + ##| ##57: napply symmetric_eqop57 ##| ##58: napply symmetric_eqop58 ##| ##59: napply symmetric_eqop59 ##| ##60: napply symmetric_eqop60 + ##| ##61: napply symmetric_eqop61 ##| ##62: napply symmetric_eqop62 ##| ##63: napply symmetric_eqop63 ##| ##64: napply symmetric_eqop64 + ##| ##65: napply symmetric_eqop65 ##| ##66: napply symmetric_eqop66 ##| ##67: napply symmetric_eqop67 ##| ##68: napply symmetric_eqop68 + ##| ##69: napply symmetric_eqop69 ##| ##70: napply symmetric_eqop70 ##| ##71: napply symmetric_eqop71 ##| ##72: napply symmetric_eqop72 + ##| ##73: napply symmetric_eqop73 ##| ##74: napply symmetric_eqop74 ##| ##75: napply symmetric_eqop75 ##| ##76: napply symmetric_eqop76 + ##| ##77: napply symmetric_eqop77 ##| ##78: napply symmetric_eqop78 ##| ##79: napply symmetric_eqop79 ##| ##80: napply symmetric_eqop80 + ##| ##81: napply symmetric_eqop81 ##| ##82: napply symmetric_eqop82 ##| ##83: napply symmetric_eqop83 ##| ##84: napply symmetric_eqop84 + ##| ##85: napply symmetric_eqop85 ##| ##86: napply symmetric_eqop86 ##| ##87: napply symmetric_eqop87 ##| ##88: napply symmetric_eqop88 + ##| ##89: napply symmetric_eqop89 ##| ##90: napply symmetric_eqop90 ##| ##91: napply symmetric_eqop91 ##] +nqed. + +nlemma eqop_to_eq1 : ∀op2.eq_op ADC op2 = true → ADC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##1: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq2 : ∀op2.eq_op ADD op2 = true → ADD = op2. #op2; ncases op2; nnormalize; #H; ##[ ##2: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq3 : ∀op2.eq_op AIS op2 = true → AIS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##3: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq4 : ∀op2.eq_op AIX op2 = true → AIX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##4: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq5 : ∀op2.eq_op AND op2 = true → AND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##5: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq6 : ∀op2.eq_op ASL op2 = true → ASL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##6: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq7 : ∀op2.eq_op ASR op2 = true → ASR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##7: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq8 : ∀op2.eq_op BCC op2 = true → BCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##8: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq9 : ∀op2.eq_op BCLRn op2 = true → BCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##9: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq10 : ∀op2.eq_op BCS op2 = true → BCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##10: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq11 : ∀op2.eq_op BEQ op2 = true → BEQ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##11: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq12 : ∀op2.eq_op BGE op2 = true → BGE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##12: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq13 : ∀op2.eq_op BGND op2 = true → BGND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##13: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq14 : ∀op2.eq_op BGT op2 = true → BGT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##14: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq15 : ∀op2.eq_op BHCC op2 = true → BHCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##15: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq16 : ∀op2.eq_op BHCS op2 = true → BHCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##16: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq17 : ∀op2.eq_op BHI op2 = true → BHI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##17: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq18 : ∀op2.eq_op BIH op2 = true → BIH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##18: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq19 : ∀op2.eq_op BIL op2 = true → BIL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##19: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq20 : ∀op2.eq_op BIT op2 = true → BIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##20: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq21 : ∀op2.eq_op BLE op2 = true → BLE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##21: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq22 : ∀op2.eq_op BLS op2 = true → BLS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##22: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq23 : ∀op2.eq_op BLT op2 = true → BLT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##23: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq24 : ∀op2.eq_op BMC op2 = true → BMC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##24: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq25 : ∀op2.eq_op BMI op2 = true → BMI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##25: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq26 : ∀op2.eq_op BMS op2 = true → BMS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##26: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq27 : ∀op2.eq_op BNE op2 = true → BNE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##27: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq28 : ∀op2.eq_op BPL op2 = true → BPL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##28: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq29 : ∀op2.eq_op BRA op2 = true → BRA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##29: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq30 : ∀op2.eq_op BRCLRn op2 = true → BRCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##30: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq31 : ∀op2.eq_op BRN op2 = true → BRN = op2. #op2; ncases op2; nnormalize; #H; ##[ ##31: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq32 : ∀op2.eq_op BRSETn op2 = true → BRSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##32: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq33 : ∀op2.eq_op BSETn op2 = true → BSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##33: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq34 : ∀op2.eq_op BSR op2 = true → BSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##34: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq35 : ∀op2.eq_op CBEQA op2 = true → CBEQA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##35: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq36 : ∀op2.eq_op CBEQX op2 = true → CBEQX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##36: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq37 : ∀op2.eq_op CLC op2 = true → CLC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##37: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq38 : ∀op2.eq_op CLI op2 = true → CLI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##38: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq39 : ∀op2.eq_op CLR op2 = true → CLR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##39: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq40 : ∀op2.eq_op CMP op2 = true → CMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##40: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq41 : ∀op2.eq_op COM op2 = true → COM = op2. #op2; ncases op2; nnormalize; #H; ##[ ##41: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq42 : ∀op2.eq_op CPHX op2 = true → CPHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##42: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq43 : ∀op2.eq_op CPX op2 = true → CPX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##43: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq44 : ∀op2.eq_op DAA op2 = true → DAA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##44: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq45 : ∀op2.eq_op DBNZ op2 = true → DBNZ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##45: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq46 : ∀op2.eq_op DEC op2 = true → DEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##46: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq47 : ∀op2.eq_op DIV op2 = true → DIV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##47: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq48 : ∀op2.eq_op EOR op2 = true → EOR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##48: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq49 : ∀op2.eq_op INC op2 = true → INC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##49: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq50 : ∀op2.eq_op JMP op2 = true → JMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##50: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq51 : ∀op2.eq_op JSR op2 = true → JSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##51: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq52 : ∀op2.eq_op LDA op2 = true → LDA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##52: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq53 : ∀op2.eq_op LDHX op2 = true → LDHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##53: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq54 : ∀op2.eq_op LDX op2 = true → LDX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##54: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq55 : ∀op2.eq_op LSR op2 = true → LSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##55: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq56 : ∀op2.eq_op MOV op2 = true → MOV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##56: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq57 : ∀op2.eq_op MUL op2 = true → MUL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##57: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq58 : ∀op2.eq_op NEG op2 = true → NEG = op2. #op2; ncases op2; nnormalize; #H; ##[ ##58: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq59 : ∀op2.eq_op NOP op2 = true → NOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##59: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq60 : ∀op2.eq_op NSA op2 = true → NSA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##60: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq61 : ∀op2.eq_op ORA op2 = true → ORA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##61: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq62 : ∀op2.eq_op PSHA op2 = true → PSHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##62: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq63 : ∀op2.eq_op PSHH op2 = true → PSHH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##63: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq64 : ∀op2.eq_op PSHX op2 = true → PSHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##64: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq65 : ∀op2.eq_op PULA op2 = true → PULA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##65: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq66 : ∀op2.eq_op PULH op2 = true → PULH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##66: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq67 : ∀op2.eq_op PULX op2 = true → PULX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##67: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq68 : ∀op2.eq_op ROL op2 = true → ROL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##68: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq69 : ∀op2.eq_op ROR op2 = true → ROR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##69: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq70 : ∀op2.eq_op RSP op2 = true → RSP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##70: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq71 : ∀op2.eq_op RTI op2 = true → RTI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##71: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq72 : ∀op2.eq_op RTS op2 = true → RTS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##72: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq73 : ∀op2.eq_op SBC op2 = true → SBC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##73: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq74 : ∀op2.eq_op SEC op2 = true → SEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##74: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq75 : ∀op2.eq_op SEI op2 = true → SEI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##75: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq76 : ∀op2.eq_op SHA op2 = true → SHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##76: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq77 : ∀op2.eq_op SLA op2 = true → SLA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##77: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq78 : ∀op2.eq_op STA op2 = true → STA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##78: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq79 : ∀op2.eq_op STHX op2 = true → STHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##79: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq80 : ∀op2.eq_op STOP op2 = true → STOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##80: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq81 : ∀op2.eq_op STX op2 = true → STX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##81: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq82 : ∀op2.eq_op SUB op2 = true → SUB = op2. #op2; ncases op2; nnormalize; #H; ##[ ##82: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq83 : ∀op2.eq_op SWI op2 = true → SWI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##83: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq84 : ∀op2.eq_op TAP op2 = true → TAP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##84: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq85 : ∀op2.eq_op TAX op2 = true → TAX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##85: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq86 : ∀op2.eq_op TPA op2 = true → TPA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##86: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq87 : ∀op2.eq_op TST op2 = true → TST = op2. #op2; ncases op2; nnormalize; #H; ##[ ##87: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq88 : ∀op2.eq_op TSX op2 = true → TSX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##88: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq89 : ∀op2.eq_op TXA op2 = true → TXA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##89: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq90 : ∀op2.eq_op TXS op2 = true → TXS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##90: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. +nlemma eqop_to_eq91 : ∀op2.eq_op WAIT op2 = true → WAIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##91: napply (refl_eq ??) ##| ##*: napply (bool_destruct ??? H) ##]nqed. + +nlemma eqop_to_eq : ∀op1,op2.eq_op op1 op2 = true → op1 = op2. + #op1; ncases op1; + ##[ ##1: napply eqop_to_eq1 ##| ##2: napply eqop_to_eq2 ##| ##3: napply eqop_to_eq3 ##| ##4: napply eqop_to_eq4 + ##| ##5: napply eqop_to_eq5 ##| ##6: napply eqop_to_eq6 ##| ##7: napply eqop_to_eq7 ##| ##8: napply eqop_to_eq8 + ##| ##9: napply eqop_to_eq9 ##| ##10: napply eqop_to_eq10 ##| ##11: napply eqop_to_eq11 ##| ##12: napply eqop_to_eq12 + ##| ##13: napply eqop_to_eq13 ##| ##14: napply eqop_to_eq14 ##| ##15: napply eqop_to_eq15 ##| ##16: napply eqop_to_eq16 + ##| ##17: napply eqop_to_eq17 ##| ##18: napply eqop_to_eq18 ##| ##19: napply eqop_to_eq19 ##| ##20: napply eqop_to_eq20 + ##| ##21: napply eqop_to_eq21 ##| ##22: napply eqop_to_eq22 ##| ##23: napply eqop_to_eq23 ##| ##24: napply eqop_to_eq24 + ##| ##25: napply eqop_to_eq25 ##| ##26: napply eqop_to_eq26 ##| ##27: napply eqop_to_eq27 ##| ##28: napply eqop_to_eq28 + ##| ##29: napply eqop_to_eq29 ##| ##30: napply eqop_to_eq30 ##| ##31: napply eqop_to_eq31 ##| ##32: napply eqop_to_eq32 + ##| ##33: napply eqop_to_eq33 ##| ##34: napply eqop_to_eq34 ##| ##35: napply eqop_to_eq35 ##| ##36: napply eqop_to_eq36 + ##| ##37: napply eqop_to_eq37 ##| ##38: napply eqop_to_eq38 ##| ##39: napply eqop_to_eq39 ##| ##40: napply eqop_to_eq40 + ##| ##41: napply eqop_to_eq41 ##| ##42: napply eqop_to_eq42 ##| ##43: napply eqop_to_eq43 ##| ##44: napply eqop_to_eq44 + ##| ##45: napply eqop_to_eq45 ##| ##46: napply eqop_to_eq46 ##| ##47: napply eqop_to_eq47 ##| ##48: napply eqop_to_eq48 + ##| ##49: napply eqop_to_eq49 ##| ##50: napply eqop_to_eq50 ##| ##51: napply eqop_to_eq51 ##| ##52: napply eqop_to_eq52 + ##| ##53: napply eqop_to_eq53 ##| ##54: napply eqop_to_eq54 ##| ##55: napply eqop_to_eq55 ##| ##56: napply eqop_to_eq56 + ##| ##57: napply eqop_to_eq57 ##| ##58: napply eqop_to_eq58 ##| ##59: napply eqop_to_eq59 ##| ##60: napply eqop_to_eq60 + ##| ##61: napply eqop_to_eq61 ##| ##62: napply eqop_to_eq62 ##| ##63: napply eqop_to_eq63 ##| ##64: napply eqop_to_eq64 + ##| ##65: napply eqop_to_eq65 ##| ##66: napply eqop_to_eq66 ##| ##67: napply eqop_to_eq67 ##| ##68: napply eqop_to_eq68 + ##| ##69: napply eqop_to_eq69 ##| ##70: napply eqop_to_eq70 ##| ##71: napply eqop_to_eq71 ##| ##72: napply eqop_to_eq72 + ##| ##73: napply eqop_to_eq73 ##| ##74: napply eqop_to_eq74 ##| ##75: napply eqop_to_eq75 ##| ##76: napply eqop_to_eq76 + ##| ##77: napply eqop_to_eq77 ##| ##78: napply eqop_to_eq78 ##| ##79: napply eqop_to_eq79 ##| ##80: napply eqop_to_eq80 + ##| ##81: napply eqop_to_eq81 ##| ##82: napply eqop_to_eq82 ##| ##83: napply eqop_to_eq83 ##| ##84: napply eqop_to_eq84 + ##| ##85: napply eqop_to_eq85 ##| ##86: napply eqop_to_eq86 ##| ##87: napply eqop_to_eq87 ##| ##88: napply eqop_to_eq88 + ##| ##89: napply eqop_to_eq89 ##| ##90: napply eqop_to_eq90 ##| ##91: napply eqop_to_eq91 ##] +nqed. + +nlemma eq_to_eqop1 : ∀op2.ADC = op2 → eq_op ADC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##1: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop2 : ∀op2.ADD = op2 → eq_op ADD op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##2: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop3 : ∀op2.AIS = op2 → eq_op AIS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##3: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop4 : ∀op2.AIX = op2 → eq_op AIX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##4: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop5 : ∀op2.AND = op2 → eq_op AND op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##5: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop6 : ∀op2.ASL = op2 → eq_op ASL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##6: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop7 : ∀op2.ASR = op2 → eq_op ASR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##7: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop8 : ∀op2.BCC = op2 → eq_op BCC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##8: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop9 : ∀op2.BCLRn = op2 → eq_op BCLRn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##9: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop10 : ∀op2.BCS = op2 → eq_op BCS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##10: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop11 : ∀op2.BEQ = op2 → eq_op BEQ op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##11: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop12 : ∀op2.BGE = op2 → eq_op BGE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##12: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop13 : ∀op2.BGND = op2 → eq_op BGND op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##13: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop14 : ∀op2.BGT = op2 → eq_op BGT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##14: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop15 : ∀op2.BHCC = op2 → eq_op BHCC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##15: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop16 : ∀op2.BHCS = op2 → eq_op BHCS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##16: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop17 : ∀op2.BHI = op2 → eq_op BHI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##17: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop18 : ∀op2.BIH = op2 → eq_op BIH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##18: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop19 : ∀op2.BIL = op2 → eq_op BIL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##19: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop20 : ∀op2.BIT = op2 → eq_op BIT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##20: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop21 : ∀op2.BLE = op2 → eq_op BLE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##21: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop22 : ∀op2.BLS = op2 → eq_op BLS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##22: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop23 : ∀op2.BLT = op2 → eq_op BLT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##23: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop24 : ∀op2.BMC = op2 → eq_op BMC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##24: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop25 : ∀op2.BMI = op2 → eq_op BMI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##25: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop26 : ∀op2.BMS = op2 → eq_op BMS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##26: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop27 : ∀op2.BNE = op2 → eq_op BNE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##27: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop28 : ∀op2.BPL = op2 → eq_op BPL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##28: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop29 : ∀op2.BRA = op2 → eq_op BRA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##29: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop30 : ∀op2.BRCLRn = op2 → eq_op BRCLRn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##30: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop31 : ∀op2.BRN = op2 → eq_op BRN op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##31: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop32 : ∀op2.BRSETn = op2 → eq_op BRSETn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##32: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop33 : ∀op2.BSETn = op2 → eq_op BSETn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##33: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop34 : ∀op2.BSR = op2 → eq_op BSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##34: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop35 : ∀op2.CBEQA = op2 → eq_op CBEQA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##35: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop36 : ∀op2.CBEQX = op2 → eq_op CBEQX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##36: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop37 : ∀op2.CLC = op2 → eq_op CLC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##37: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop38 : ∀op2.CLI = op2 → eq_op CLI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##38: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop39 : ∀op2.CLR = op2 → eq_op CLR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##39: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop40 : ∀op2.CMP = op2 → eq_op CMP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##40: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop41 : ∀op2.COM = op2 → eq_op COM op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##41: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop42 : ∀op2.CPHX = op2 → eq_op CPHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##42: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop43 : ∀op2.CPX = op2 → eq_op CPX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##43: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop44 : ∀op2.DAA = op2 → eq_op DAA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##44: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop45 : ∀op2.DBNZ = op2 → eq_op DBNZ op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##45: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop46 : ∀op2.DEC = op2 → eq_op DEC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##46: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop47 : ∀op2.DIV = op2 → eq_op DIV op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##47: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop48 : ∀op2.EOR = op2 → eq_op EOR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##48: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop49 : ∀op2.INC = op2 → eq_op INC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##49: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop50 : ∀op2.JMP = op2 → eq_op JMP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##50: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop51 : ∀op2.JSR = op2 → eq_op JSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##51: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop52 : ∀op2.LDA = op2 → eq_op LDA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##52: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop53 : ∀op2.LDHX = op2 → eq_op LDHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##53: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop54 : ∀op2.LDX = op2 → eq_op LDX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##54: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop55 : ∀op2.LSR = op2 → eq_op LSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##55: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop56 : ∀op2.MOV = op2 → eq_op MOV op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##56: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop57 : ∀op2.MUL = op2 → eq_op MUL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##57: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop58 : ∀op2.NEG = op2 → eq_op NEG op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##58: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop59 : ∀op2.NOP = op2 → eq_op NOP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##59: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop60 : ∀op2.NSA = op2 → eq_op NSA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##60: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop61 : ∀op2.ORA = op2 → eq_op ORA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##61: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop62 : ∀op2.PSHA = op2 → eq_op PSHA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##62: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop63 : ∀op2.PSHH = op2 → eq_op PSHH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##63: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop64 : ∀op2.PSHX = op2 → eq_op PSHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##64: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop65 : ∀op2.PULA = op2 → eq_op PULA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##65: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop66 : ∀op2.PULH = op2 → eq_op PULH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##66: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop67 : ∀op2.PULX = op2 → eq_op PULX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##67: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop68 : ∀op2.ROL = op2 → eq_op ROL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##68: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop69 : ∀op2.ROR = op2 → eq_op ROR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##69: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop70 : ∀op2.RSP = op2 → eq_op RSP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##70: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop71 : ∀op2.RTI = op2 → eq_op RTI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##71: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop72 : ∀op2.RTS = op2 → eq_op RTS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##72: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop73 : ∀op2.SBC = op2 → eq_op SBC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##73: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop74 : ∀op2.SEC = op2 → eq_op SEC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##74: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop75 : ∀op2.SEI = op2 → eq_op SEI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##75: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop76 : ∀op2.SHA = op2 → eq_op SHA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##76: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop77 : ∀op2.SLA = op2 → eq_op SLA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##77: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop78 : ∀op2.STA = op2 → eq_op STA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##78: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop79 : ∀op2.STHX = op2 → eq_op STHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##79: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop80 : ∀op2.STOP = op2 → eq_op STOP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##80: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop81 : ∀op2.STX = op2 → eq_op STX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##81: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop82 : ∀op2.SUB = op2 → eq_op SUB op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##82: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop83 : ∀op2.SWI = op2 → eq_op SWI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##83: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop84 : ∀op2.TAP = op2 → eq_op TAP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##84: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop85 : ∀op2.TAX = op2 → eq_op TAX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##85: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop86 : ∀op2.TPA = op2 → eq_op TPA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##86: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop87 : ∀op2.TST = op2 → eq_op TST op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##87: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop88 : ∀op2.TSX = op2 → eq_op TSX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##88: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop89 : ∀op2.TXA = op2 → eq_op TXA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##89: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop90 : ∀op2.TXS = op2 → eq_op TXS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##90: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. +nlemma eq_to_eqop91 : ∀op2.WAIT = op2 → eq_op WAIT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##91: napply (refl_eq ??) ##| ##*: napply (opcode_destruct ?? (false = true) H) ##]nqed. + +nlemma eq_to_eqop : ∀op1,op2.op1 = op2 → eq_op op1 op2 = true. + #op1; ncases op1; + ##[ ##1: napply eq_to_eqop1 ##| ##2: napply eq_to_eqop2 ##| ##3: napply eq_to_eqop3 ##| ##4: napply eq_to_eqop4 + ##| ##5: napply eq_to_eqop5 ##| ##6: napply eq_to_eqop6 ##| ##7: napply eq_to_eqop7 ##| ##8: napply eq_to_eqop8 + ##| ##9: napply eq_to_eqop9 ##| ##10: napply eq_to_eqop10 ##| ##11: napply eq_to_eqop11 ##| ##12: napply eq_to_eqop12 + ##| ##13: napply eq_to_eqop13 ##| ##14: napply eq_to_eqop14 ##| ##15: napply eq_to_eqop15 ##| ##16: napply eq_to_eqop16 + ##| ##17: napply eq_to_eqop17 ##| ##18: napply eq_to_eqop18 ##| ##19: napply eq_to_eqop19 ##| ##20: napply eq_to_eqop20 + ##| ##21: napply eq_to_eqop21 ##| ##22: napply eq_to_eqop22 ##| ##23: napply eq_to_eqop23 ##| ##24: napply eq_to_eqop24 + ##| ##25: napply eq_to_eqop25 ##| ##26: napply eq_to_eqop26 ##| ##27: napply eq_to_eqop27 ##| ##28: napply eq_to_eqop28 + ##| ##29: napply eq_to_eqop29 ##| ##30: napply eq_to_eqop30 ##| ##31: napply eq_to_eqop31 ##| ##32: napply eq_to_eqop32 + ##| ##33: napply eq_to_eqop33 ##| ##34: napply eq_to_eqop34 ##| ##35: napply eq_to_eqop35 ##| ##36: napply eq_to_eqop36 + ##| ##37: napply eq_to_eqop37 ##| ##38: napply eq_to_eqop38 ##| ##39: napply eq_to_eqop39 ##| ##40: napply eq_to_eqop40 + ##| ##41: napply eq_to_eqop41 ##| ##42: napply eq_to_eqop42 ##| ##43: napply eq_to_eqop43 ##| ##44: napply eq_to_eqop44 + ##| ##45: napply eq_to_eqop45 ##| ##46: napply eq_to_eqop46 ##| ##47: napply eq_to_eqop47 ##| ##48: napply eq_to_eqop48 + ##| ##49: napply eq_to_eqop49 ##| ##50: napply eq_to_eqop50 ##| ##51: napply eq_to_eqop51 ##| ##52: napply eq_to_eqop52 + ##| ##53: napply eq_to_eqop53 ##| ##54: napply eq_to_eqop54 ##| ##55: napply eq_to_eqop55 ##| ##56: napply eq_to_eqop56 + ##| ##57: napply eq_to_eqop57 ##| ##58: napply eq_to_eqop58 ##| ##59: napply eq_to_eqop59 ##| ##60: napply eq_to_eqop60 + ##| ##61: napply eq_to_eqop61 ##| ##62: napply eq_to_eqop62 ##| ##63: napply eq_to_eqop63 ##| ##64: napply eq_to_eqop64 + ##| ##65: napply eq_to_eqop65 ##| ##66: napply eq_to_eqop66 ##| ##67: napply eq_to_eqop67 ##| ##68: napply eq_to_eqop68 + ##| ##69: napply eq_to_eqop69 ##| ##70: napply eq_to_eqop70 ##| ##71: napply eq_to_eqop71 ##| ##72: napply eq_to_eqop72 + ##| ##73: napply eq_to_eqop73 ##| ##74: napply eq_to_eqop74 ##| ##75: napply eq_to_eqop75 ##| ##76: napply eq_to_eqop76 + ##| ##77: napply eq_to_eqop77 ##| ##78: napply eq_to_eqop78 ##| ##79: napply eq_to_eqop79 ##| ##80: napply eq_to_eqop80 + ##| ##81: napply eq_to_eqop81 ##| ##82: napply eq_to_eqop82 ##| ##83: napply eq_to_eqop83 ##| ##84: napply eq_to_eqop84 + ##| ##85: napply eq_to_eqop85 ##| ##86: napply eq_to_eqop86 ##| ##87: napply eq_to_eqop87 ##| ##88: napply eq_to_eqop88 + ##| ##89: napply eq_to_eqop89 ##| ##90: napply eq_to_eqop90 ##| ##91: napply eq_to_eqop91 ##] +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/option.ma b/helm/software/matita/contribs/ng_assembly/freescale/option.ma index 2041a2a55..a30a8f08d 100644 --- a/helm/software/matita/contribs/ng_assembly/freescale/option.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/option.ma @@ -34,23 +34,23 @@ ninductive option (A:Type) : Type ≝ None : option A | Some : A → option A. -ndefinition option_ind : ΠA:Type.ΠP:option A → Prop.P (None A) → (Πa:A.P (Some A a)) → Πo:option A.P o ≝ -λA:Type.λP:option A → Prop.λp:P (None A).λf:Πa:A.P (Some A a).λo:option A. - match o with [ None ⇒ p | Some (a:A) ⇒ f a ]. +ndefinition option_ind : ΠA:Type.ΠP:option A → Prop.P (None A) → (Πa:A.P (Some A a)) → Πop:option A.P op ≝ +λA:Type.λP:option A → Prop.λp:P (None A).λf:Πa:A.P (Some A a).λop:option A. + match op with [ None ⇒ p | Some (a:A) ⇒ f a ]. -ndefinition option_rec : ΠA:Type.ΠP:option A → Set.P (None A) → (Πa:A.P (Some A a)) → Πo:option A.P o ≝ -λA:Type.λP:option A → Set.λp:P (None A).λf:Πa:A.P (Some A a).λo:option A. - match o with [ None ⇒ p | Some (a:A) ⇒ f a ]. +ndefinition option_rec : ΠA:Type.ΠP:option A → Set.P (None A) → (Πa:A.P (Some A a)) → Πop:option A.P op ≝ +λA:Type.λP:option A → Set.λp:P (None A).λf:Πa:A.P (Some A a).λop:option A. + match op with [ None ⇒ p | Some (a:A) ⇒ f a ]. -ndefinition option_rect : ΠA:Type.ΠP:option A → Type.P (None A) → (Πa:A.P (Some A a)) → Πo:option A.P o ≝ -λA:Type.λP:option A → Type.λp:P (None A).λf:Πa:A.P (Some A a).λo:option A. - match o with [ None ⇒ p | Some (a:A) ⇒ f a ]. +ndefinition option_rect : ΠA:Type.ΠP:option A → Type.P (None A) → (Πa:A.P (Some A a)) → Πop:option A.P op ≝ +λA:Type.λP:option A → Type.λp:P (None A).λf:Πa:A.P (Some A a).λop:option A. + match op with [ None ⇒ p | Some (a:A) ⇒ f a ]. ndefinition eq_option ≝ -λT.λo1,o2:option T.λf:T → T → bool. - match o1 with - [ None ⇒ match o2 with [ None ⇒ true | Some _ ⇒ false ] - | Some x1 ⇒ match o2 with [ None ⇒ false | Some x2 ⇒ f x1 x2 ] +λT.λop1,op2:option T.λf:T → T → bool. + match op1 with + [ None ⇒ match op2 with [ None ⇒ true | Some _ ⇒ false ] + | Some x1 ⇒ match op2 with [ None ⇒ false | Some x2 ⇒ f x1 x2 ] ]. (* option map = match ... with [ None ⇒ None ? | Some .. ⇒ .. ] *) diff --git a/helm/software/matita/contribs/ng_assembly/freescale/option_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/option_lemmas.ma index 114dbdefd..4f362a873 100644 --- a/helm/software/matita/contribs/ng_assembly/freescale/option_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/option_lemmas.ma @@ -31,7 +31,7 @@ include "freescale/option.ma". (* OPTION *) (* ****** *) -nlemma option_destruct : ∀T.∀x1,x2:T.Some T x1 = Some T x2 → x1 = x2. +nlemma option_destruct_some_some : ∀T.∀x1,x2:T.Some T x1 = Some T x2 → x1 = x2. #T; #x1; #x2; #H; nchange with (match Some T x2 with [ None ⇒ False | Some a ⇒ x1 = a ]); nrewrite < H; @@ -55,13 +55,13 @@ nlemma option_destruct_none_some : ∀T.∀x:T.None T = Some T x → False. napply I. nqed. -nlemma bsymmetric_eqoption : -∀T:Type.∀o1,o2:option T.∀f:T → T → bool. +nlemma symmetric_eqoption : +∀T:Type.∀op1,op2:option T.∀f:T → T → bool. (symmetricT T bool f) → - (eq_option T o1 o2 f = eq_option T o2 o1 f). - #T; #o1; #o2; #f; #H; - napply (option_ind T ??? o1); - napply (option_ind T ??? o2); + (eq_option T op1 op2 f = eq_option T op2 op1 f). + #T; #op1; #op2; #f; #H; + napply (option_ind T ??? op1); + napply (option_ind T ??? op2); nnormalize; ##[ ##1: napply (refl_eq ??) ##| ##2,3: #H; napply (refl_eq ??) @@ -72,30 +72,30 @@ nlemma bsymmetric_eqoption : nqed. nlemma eq_to_eqoption : -∀T.∀o1,o2:option T.∀f:T → T → bool. +∀T.∀op1,op2:option T.∀f:T → T → bool. (∀x1,x2:T.x1 = x2 → f x1 x2 = true) → - (o1 = o2 → eq_option T o1 o2 f = true). - #T; #o1; #o2; #f; #H; - napply (option_ind T ??? o1); - napply (option_ind T ??? o2); + (op1 = op2 → eq_option T op1 op2 f = true). + #T; #op1; #op2; #f; #H; + napply (option_ind T ??? op1); + napply (option_ind T ??? op2); nnormalize; ##[ ##1: #H1; napply (refl_eq ??) ##| ##2: #a; #H1; nelim (option_destruct_none_some ?? H1) ##| ##3: #a; #H1; nelim (option_destruct_some_none ?? H1) ##| ##4: #a; #a0; #H1; - nrewrite > (option_destruct ??? H1); + nrewrite > (option_destruct_some_some ??? H1); nrewrite > (H a a (refl_eq ??)); napply (refl_eq ??) ##] nqed. nlemma eqoption_to_eq : -∀T.∀o1,o2:option T.∀f:T → T → bool. +∀T.∀op1,op2:option T.∀f:T → T → bool. (∀x1,x2:T.f x1 x2 = true → x1 = x2) → - (eq_option T o1 o2 f = true → o1 = o2). - #T; #o1; #o2; #f; #H; - napply (option_ind T ??? o1); - napply (option_ind T ??? o2); + (eq_option T op1 op2 f = true → op1 = op2). + #T; #op1; #op2; #f; #H; + napply (option_ind T ??? op1); + napply (option_ind T ??? op2); nnormalize; ##[ ##1: #H1; napply (refl_eq ??) ##| ##2,3: #a; #H1; napply (bool_destruct ??? H1) diff --git a/helm/software/matita/contribs/ng_assembly/freescale/prod_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/prod_lemmas.ma index 0c8c6e633..6d666ca0d 100644 --- a/helm/software/matita/contribs/ng_assembly/freescale/prod_lemmas.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/prod_lemmas.ma @@ -51,7 +51,7 @@ nlemma pair_destruct_2 : napply (refl_eq ??). nqed. -nlemma bsymmetric_eqpair : +nlemma symmetric_eqpair : ∀T1,T2:Type.∀p1,p2:ProdT T1 T2. ∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool. (symmetricT T1 bool f1) → @@ -142,7 +142,7 @@ nlemma triple_destruct_3 : napply (refl_eq ??). nqed. -nlemma bsymmetric_eqtriple : +nlemma symmetric_eqtriple : ∀T1,T2,T3:Type.∀p1,p2:Prod3T T1 T2 T3. ∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool. (symmetricT T1 bool f1) → @@ -257,7 +257,7 @@ nlemma quadruple_destruct_4 : napply (refl_eq ??). nqed. -nlemma bsymmetric_eqquadruple : +nlemma symmetric_eqquadruple : ∀T1,T2,T3,T4:Type.∀p1,p2:Prod4T T1 T2 T3 T4. ∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool. (symmetricT T1 bool f1) → @@ -397,7 +397,7 @@ nlemma quintuple_destruct_5 : napply (refl_eq ??). nqed. -nlemma bsymmetric_eqquintuple : +nlemma symmetric_eqquintuple : ∀T1,T2,T3,T4,T5:Type.∀p1,p2:Prod5T T1 T2 T3 T4 T5. ∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.∀f5:T5 → T5 → bool. (symmetricT T1 bool f1) → diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma new file mode 100755 index 000000000..c85dfcb31 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma @@ -0,0 +1,380 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode.ma". + +(* ***************** *) +(* TABELLA DELL'HC05 *) +(* ***************** *) + +(* definizione come concatenazione finale di liste per velocizzare il parsing *) +(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *) +(* NB: l'uso di any_opcode m + concatenazione finale tutte liste + impedisce di introdurre opcode disomogenei (per mcu) *) + +ndefinition opcode_table_HC05_1 ≝ +[ + quadruple ???? (anyOP HC05 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC05_2 ≝ +[ + quadruple ???? (anyOP HC05 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_3 ≝ +[ + quadruple ???? (anyOP HC05 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_4 ≝ +[ + quadruple ???? (anyOP HC05 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_5 ≝ +[ + quadruple ???? (anyOP HC05 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_6 ≝ +[ + quadruple ???? (anyOP HC05 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_7 ≝ +[ + quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_8 ≝ +[ + quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_9 ≝ +[ + quadruple ???? (anyOP HC05 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_10 ≝ +[ + quadruple ???? (anyOP HC05 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,xB〉 +; quadruple ???? (anyOP HC05 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉 +; quadruple ???? (anyOP HC05 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,xA〉 +; quadruple ???? (anyOP HC05 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_HC05_11 ≝ +[ + quadruple ???? (anyOP HC05 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_12 ≝ +[ + quadruple ???? (anyOP HC05 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_13 ≝ +[ + quadruple ???? (anyOP HC05 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_14 ≝ +[ + quadruple ???? (anyOP HC05 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_15 ≝ +[ + quadruple ???? (anyOP HC05 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_16 ≝ +[ + quadruple ???? (anyOP HC05 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_17 ≝ +[ + quadruple ???? (anyOP HC05 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_18 ≝ +[ + quadruple ???? (anyOP HC05 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_HC05_19 ≝ +[ + quadruple ???? (anyOP HC05 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x7〉 +; quadruple ???? (anyOP HC05 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_20 ≝ +[ + quadruple ???? (anyOP HC05 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_21 ≝ +[ + quadruple ???? (anyOP HC05 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_22 ≝ +[ + quadruple ???? (anyOP HC05 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_23 ≝ +[ + quadruple ???? (anyOP HC05 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_24 ≝ +[ + quadruple ???? (anyOP HC05 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_25 ≝ +[ + quadruple ???? (anyOP HC05 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_26 ≝ +[ + quadruple ???? (anyOP HC05 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC05_27 ≝ +[ + quadruple ???? (anyOP HC05 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_28 ≝ +[ + quadruple ???? (anyOP HC05 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC05_29 ≝ +[ + quadruple ???? (anyOP HC05 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC05 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC05_30 ≝ +[ + quadruple ???? (anyOP HC05 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC05 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC05_31 ≝ +[ + quadruple ???? (anyOP HC05 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC05 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC05 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC05 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC05 ≝ + opcode_table_HC05_1 @ opcode_table_HC05_2 @ opcode_table_HC05_3 @ opcode_table_HC05_4 @ + opcode_table_HC05_5 @ opcode_table_HC05_6 @ opcode_table_HC05_7 @ opcode_table_HC05_8 @ + opcode_table_HC05_9 @ opcode_table_HC05_10 @ opcode_table_HC05_11 @ opcode_table_HC05_12 @ + opcode_table_HC05_13 @ opcode_table_HC05_14 @ opcode_table_HC05_15 @ opcode_table_HC05_16 @ + opcode_table_HC05_17 @ opcode_table_HC05_18 @ opcode_table_HC05_19 @ opcode_table_HC05_20 @ + opcode_table_HC05_21 @ opcode_table_HC05_22 @ opcode_table_HC05_23 @ opcode_table_HC05_24 @ + opcode_table_HC05_25 @ opcode_table_HC05_26 @ opcode_table_HC05_27 @ opcode_table_HC05_28 @ + opcode_table_HC05_29 @ opcode_table_HC05_30 @ opcode_table_HC05_31. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma new file mode 100755 index 000000000..61d9abdeb --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma @@ -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/table_HC05.ma". + +(* ***************** *) +(* TABELLA DELL'HC05 *) +(* ***************** *) + +(* HC05: opcode non implementati come da manuale *) +ndefinition HC05_not_impl_byte ≝ + [〈x3,x1〉;〈x3,x2〉;〈x3,x5〉;〈x3,xB〉;〈x3,xE〉 + ;〈x4,x1〉;〈x4,x5〉;〈x4,xB〉;〈x4,xE〉 + ;〈x5,x1〉;〈x5,x2〉;〈x5,x5〉;〈x5,xB〉;〈x5,xE〉 + ;〈x6,x1〉;〈x6,x2〉;〈x6,x5〉;〈x6,xB〉;〈x6,xE〉 + ;〈x7,x1〉;〈x7,x2〉;〈x7,x5〉;〈x7,xB〉;〈x7,xE〉 + ;〈x8,x2〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉 + ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,xE〉 + ;〈xA,x7〉;〈xA,xC〉;〈xA,xF〉 + ]. + +nlemma ok_byte_table_HC05 : forall_byte8 (λb. + (test_not_impl_byte b HC05_not_impl_byte ⊙ eq_nat (get_byte_count HC05 b 0 opcode_table_HC05) 1) ⊗ + (⊖ (test_not_impl_byte b HC05_not_impl_byte) ⊙ eq_nat (get_byte_count HC05 b 0 opcode_table_HC05) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HC05: pseudocodici non implementati come da manuale *) +ndefinition HC05_not_impl_pseudo ≝ + [ AIS ; AIX ; BGE ; BGND ; BGT ; BLE ; BLT ; CBEQA ; CBEQX ; CPHX ; DAA + ; DBNZ ; DIV ; LDHX ; MOV ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX + ; SHA ; SLA ; STHX ; TAP ; TPA ; TSX ; TXS ]. + +nlemma ok_pseudo_table_HC05 : forall_opcode (λo. + (test_not_impl_pseudo o HC05_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HC05 o 0 opcode_table_HC05)) ⊗ + (⊖ (test_not_impl_pseudo o HC05_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HC05 o 0 opcode_table_HC05) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HC05: modalita' non implementate come da manuale *) +ndefinition HC05_not_impl_mode ≝ + [ MODE_INHH ; MODE_SP1 ; MODE_SP2 ; MODE_DIR1_to_DIR1 + ; MODE_IMM1_to_DIR1 ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p + ; MODE_INHA_and_IMM1 ; MODE_INHX_and_IMM1 ; MODE_IMM1_and_IMM1 + ; MODE_DIR1_and_IMM1 ; MODE_IX0_and_IMM1 ; MODE_IX0p_and_IMM1 + ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1 + ; MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3 + ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7 + ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB + ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF + ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03 + ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07 + ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B + ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F + ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13 + ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17 + ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B + ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ]. + +nlemma ok_mode_table_HC05 : forall_instr_mode (λi. + (test_not_impl_mode i HC05_not_impl_mode ⊙ le_nat 1 (get_mode_count HC05 i 0 opcode_table_HC05)) ⊗ + (⊖ (test_not_impl_mode i HC05_not_impl_mode) ⊙ eq_nat (get_mode_count HC05 i 0 opcode_table_HC05) 0)) + = true. + napply (refl_eq ??). +nqed. + +nlemma ok_OpIm_table_HC05 : + forall_instr_mode (λi:instr_mode. + forall_opcode (λop:opcode. + le_nat (get_OpIm_count HC05 (anyOP HC05 op) i 0 opcode_table_HC05) 1)) = true. + napply (refl_eq ??). +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma new file mode 100755 index 000000000..70105ee0b --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma @@ -0,0 +1,477 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode.ma". + +(* ***************** *) +(* TABELLA DELL'HC08 *) +(* ***************** *) + +(* definizione come concatenazione finale di liste per velocizzare il parsing *) +(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *) +(* NB: l'uso di any_opcode m + concatenazione finale tutte liste + impedisce di introdurre opcode disomogenei (per mcu) *) + +ndefinition opcode_table_HC08_1 ≝ +[ + quadruple ???? (anyOP HC08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ADC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 ADC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_2 ≝ +[ + quadruple ???? (anyOP HC08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ADD) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 ADD) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_3 ≝ +[ + quadruple ???? (anyOP HC08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 AND) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 AND) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_4 ≝ +[ + quadruple ???? (anyOP HC08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ASL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_5 ≝ +[ + quadruple ???? (anyOP HC08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ASR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_6 ≝ +[ + quadruple ???? (anyOP HC08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC08_7 ≝ +[ + quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_8 ≝ +[ + quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_9 ≝ +[ + quadruple ???? (anyOP HC08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 BIT) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 BIT) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_10 ≝ +[ + quadruple ???? (anyOP HC08 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 DIV ) MODE_INH (Byte 〈x5,x2〉) 〈x0,x7〉 +; quadruple ???? (anyOP HC08 NSA ) MODE_INH (Byte 〈x6,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 DAA ) MODE_INH (Byte 〈x7,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x7〉 +; quadruple ???? (anyOP HC08 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,x9〉 +; quadruple ???? (anyOP HC08 TAP ) MODE_INH (Byte 〈x8,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 TPA ) MODE_INH (Byte 〈x8,x5〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 PULA) MODE_INH (Byte 〈x8,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 PSHA) MODE_INH (Byte 〈x8,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 PULX) MODE_INH (Byte 〈x8,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 PSHX) MODE_INH (Byte 〈x8,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 PULH) MODE_INH (Byte 〈x8,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 PSHH) MODE_INH (Byte 〈x8,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 TXS ) MODE_INH (Byte 〈x9,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 TSX ) MODE_INH (Byte 〈x9,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_HC08_11 ≝ +[ + quadruple ???? (anyOP HC08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CBEQA) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HC08_12 ≝ +[ + quadruple ???? (anyOP HC08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 CLR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_13 ≝ +[ + quadruple ???? (anyOP HC08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 CMP) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 CMP) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_14 ≝ +[ + quadruple ???? (anyOP HC08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 COM) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_15 ≝ +[ + quadruple ???? (anyOP HC08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_16 ≝ +[ + quadruple ???? (anyOP HC08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 CPX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 CPX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_17 ≝ +[ + quadruple ???? (anyOP HC08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 DBNZ) MODE_IX1_and_IMM1 (Byte 〈x6,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 DBNZ) MODE_IX0_and_IMM1 (Byte 〈x7,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 DBNZ) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HC08_18 ≝ +[ + quadruple ???? (anyOP HC08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 DEC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_19 ≝ +[ + quadruple ???? (anyOP HC08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 EOR) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 EOR) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_20 ≝ +[ + quadruple ???? (anyOP HC08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 INC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_21 ≝ +[ + quadruple ???? (anyOP HC08 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HC08_22 ≝ +[ + quadruple ???? (anyOP HC08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HC08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_23 ≝ +[ + quadruple ???? (anyOP HC08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 LDA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 LDA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_24 ≝ +[ + quadruple ???? (anyOP HC08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 LDX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 LDX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_25 ≝ +[ + quadruple ???? (anyOP HC08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 LSR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_26 ≝ +[ + quadruple ???? (anyOP HC08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_27 ≝ +[ + quadruple ???? (anyOP HC08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 NEG) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_28 ≝ +[ + quadruple ???? (anyOP HC08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 ORA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 ORA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_29 ≝ +[ + quadruple ???? (anyOP HC08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ROL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_30 ≝ +[ + quadruple ???? (anyOP HC08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 ROR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HC08_31 ≝ +[ + quadruple ???? (anyOP HC08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 SBC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 SBC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_32 ≝ +[ + quadruple ???? (anyOP HC08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 STA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 STA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_33 ≝ +[ + quadruple ???? (anyOP HC08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 STX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 STX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_34 ≝ +[ + quadruple ???? (anyOP HC08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HC08 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 SUB) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HC08 SUB) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08_35 ≝ +[ + quadruple ???? (anyOP HC08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HC08 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HC08 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP HC08 TST) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HC08 ≝ +opcode_table_HC08_1 @ opcode_table_HC08_2 @ opcode_table_HC08_3 @ opcode_table_HC08_4 @ +opcode_table_HC08_5 @ opcode_table_HC08_6 @ opcode_table_HC08_7 @ opcode_table_HC08_8 @ +opcode_table_HC08_9 @ opcode_table_HC08_10 @ opcode_table_HC08_11 @ opcode_table_HC08_12 @ +opcode_table_HC08_13 @ opcode_table_HC08_14 @ opcode_table_HC08_15 @ opcode_table_HC08_16 @ +opcode_table_HC08_17 @ opcode_table_HC08_18 @ opcode_table_HC08_19 @ opcode_table_HC08_20 @ +opcode_table_HC08_21 @ opcode_table_HC08_22 @ opcode_table_HC08_23 @ opcode_table_HC08_24 @ +opcode_table_HC08_25 @ opcode_table_HC08_26 @ opcode_table_HC08_27 @ opcode_table_HC08_28 @ +opcode_table_HC08_29 @ opcode_table_HC08_30 @ opcode_table_HC08_31 @ opcode_table_HC08_32 @ +opcode_table_HC08_33 @ opcode_table_HC08_34 @ opcode_table_HC08_35. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma new file mode 100755 index 000000000..b7e7e21fa --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma @@ -0,0 +1,126 @@ +(**************************************************************************) +(* ___ *) +(* ||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/table_HC08.ma". + +(* ***************** *) +(* TABELLA DELL'HC08 *) +(* ***************** *) + +(* HC08: opcode non implementati come da manuale (byte) *) +ndefinition HC08_not_impl_byte ≝ + [〈x3,x2〉;〈x3,xE〉 + ;〈x8,x2〉;〈x8,xD〉 + ;〈x9,x6〉;〈x9,xE〉 + ;〈xA,xC〉 + ]. + +nlemma ok_byte_table_HC08 : forall_byte8 (λb. + (test_not_impl_byte b HC08_not_impl_byte ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 1) ⊗ + (⊖ (test_not_impl_byte b HC08_not_impl_byte) ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HC08: opcode non implementati come da manuale (0x9E+byte) *) +ndefinition HC08_not_impl_word ≝ + [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉 + ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉 + ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉 + ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉 + ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉 + ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉 + ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉 + ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉 + ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉 + ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉 + ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉 + ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉 + ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉 + ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉 + ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉 + ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉 + ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉 + ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉 + ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉 + ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉 + ;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xE〉;〈xA,xF〉 + ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉 + ;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xE〉;〈xB,xF〉 + ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉 + ;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xE〉;〈xC,xF〉 + ;〈xD,xC〉;〈xD,xD〉 + ;〈xE,xC〉;〈xE,xD〉 + ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x3〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉 + ;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉;〈xF,xE〉;〈xF,xF〉 + ]. + +nlemma ok_word_table_HC08 : forall_byte8 (λb. + (test_not_impl_byte b HC08_not_impl_word ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 1) ⊗ + (⊖ (test_not_impl_byte b HC08_not_impl_word) ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HC08: pseudocodici non implementati come da manuale *) +ndefinition HC08_not_impl_pseudo ≝ + [ BGND ; SHA ; SLA ]. + +nlemma ok_pseudo_table_HC08 : forall_opcode (λo. + (test_not_impl_pseudo o HC08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HC08 o 0 opcode_table_HC08)) ⊗ + (⊖ (test_not_impl_pseudo o HC08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HC08 o 0 opcode_table_HC08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HC08: modalita' non implementate come da manuale *) +ndefinition HC08_not_impl_mode ≝ + [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3 + ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7 + ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB + ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF + ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03 + ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07 + ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B + ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F + ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13 + ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17 + ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B + ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ]. + +nlemma ok_mode_table_HC08 : forall_instr_mode (λi. + (test_not_impl_mode i HC08_not_impl_mode ⊙ le_nat 1 (get_mode_count HC08 i 0 opcode_table_HC08)) ⊗ + (⊖ (test_not_impl_mode i HC08_not_impl_mode) ⊙ eq_nat (get_mode_count HC08 i 0 opcode_table_HC08) 0)) + = true. + napply (refl_eq ??). +nqed. + +nlemma ok_OpIm_table_HC08 : + forall_instr_mode (λi:instr_mode. + forall_opcode (λop:opcode. + le_nat (get_OpIm_count HC08 (anyOP HC08 op) i 0 opcode_table_HC08) 1)) = true. + napply (refl_eq ??). +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma new file mode 100755 index 000000000..d44c45a48 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma @@ -0,0 +1,489 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode.ma". + +(* ****************** *) +(* TABELLA DELL'HCS08 *) +(* ****************** *) + +(* definizione come concatenazione finale di liste per velocizzare il parsing *) +(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *) +(* NB: l'uso di any_opcode m + concatenazione finale tutte liste + impedisce di introdurre opcode disomogenei (per mcu) *) + +ndefinition opcode_table_HCS08_1 ≝ +[ + quadruple ???? (anyOP HCS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ADC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_2 ≝ +[ + quadruple ???? (anyOP HCS08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ADD) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_3 ≝ +[ + quadruple ???? (anyOP HCS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 AND) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 AND) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_4 ≝ +[ + quadruple ???? (anyOP HCS08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ASL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_5 ≝ +[ + quadruple ???? (anyOP HCS08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ASR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_6 ≝ +[ + quadruple ???? (anyOP HCS08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HCS08_7 ≝ +[ + quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08_8 ≝ +[ + quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08_9 ≝ +[ + quadruple ???? (anyOP HCS08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 BIT) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_10 ≝ +[ + quadruple ???? (anyOP HCS08 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 DIV ) MODE_INH (Byte 〈x5,x2〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 NSA ) MODE_INH (Byte 〈x6,x2〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 DAA ) MODE_INH (Byte 〈x7,x2〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉 +; quadruple ???? (anyOP HCS08 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,xB〉 +; quadruple ???? (anyOP HCS08 BGND) MODE_INH (Byte 〈x8,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 TAP ) MODE_INH (Byte 〈x8,x4〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 TPA ) MODE_INH (Byte 〈x8,x5〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 PULA) MODE_INH (Byte 〈x8,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 PSHA) MODE_INH (Byte 〈x8,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 PULX) MODE_INH (Byte 〈x8,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 PSHX) MODE_INH (Byte 〈x8,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 PULH) MODE_INH (Byte 〈x8,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 PSHH) MODE_INH (Byte 〈x8,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 TXS ) MODE_INH (Byte 〈x9,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 TSX ) MODE_INH (Byte 〈x9,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_HCS08_11 ≝ +[ + quadruple ???? (anyOP HCS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CBEQA) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_12 ≝ +[ + quadruple ???? (anyOP HCS08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 CLR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_13 ≝ +[ + quadruple ???? (anyOP HCS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CMP) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_14 ≝ +[ + quadruple ???? (anyOP HCS08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 COM) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_15 ≝ +[ + quadruple ???? (anyOP HCS08 CPHX) MODE_DIR2 (Byte 〈x3,xE〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CPHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,x3〉〉) 〈x0,x6〉 + +; quadruple ???? (anyOP HCS08 LDHX) MODE_DIR2 (Byte 〈x3,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_IX0 (Word 〈〈x9,xE〉:〈xA,xE〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_IX2 (Word 〈〈x9,xE〉:〈xB,xE〉〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_IX1 (Word 〈〈x9,xE〉:〈xC,xE〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LDHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,xE〉〉) 〈x0,x5〉 + +; quadruple ???? (anyOP HCS08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 STHX) MODE_DIR2 (Byte 〈x9,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 STHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,xF〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08_16 ≝ +[ + quadruple ???? (anyOP HCS08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 CPX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_17 ≝ +[ + quadruple ???? (anyOP HCS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉 +; quadruple ???? (anyOP HCS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 DBNZ) MODE_IX1_and_IMM1 (Byte 〈x6,xB〉) 〈x0,x7〉 +; quadruple ???? (anyOP HCS08 DBNZ) MODE_IX0_and_IMM1 (Byte 〈x7,xB〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 DBNZ) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x8〉 +]. + +ndefinition opcode_table_HCS08_18 ≝ +[ + quadruple ???? (anyOP HCS08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 DEC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_19 ≝ +[ + quadruple ???? (anyOP HCS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 EOR) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_20 ≝ +[ + quadruple ???? (anyOP HCS08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 INC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_21 ≝ +[ + quadruple ???? (anyOP HCS08 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_HCS08_22 ≝ +[ + quadruple ???? (anyOP HCS08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉 +; quadruple ???? (anyOP HCS08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08_23 ≝ +[ + quadruple ???? (anyOP HCS08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LDA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_24 ≝ +[ + quadruple ???? (anyOP HCS08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LDX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_25 ≝ +[ + quadruple ???? (anyOP HCS08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 LSR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_26 ≝ +[ + quadruple ???? (anyOP HCS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08_27 ≝ +[ + quadruple ???? (anyOP HCS08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 NEG) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_28 ≝ +[ + quadruple ???? (anyOP HCS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ORA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_29 ≝ +[ + quadruple ???? (anyOP HCS08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ROL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_30 ≝ +[ + quadruple ???? (anyOP HCS08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 ROR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x6〉 +]. + +ndefinition opcode_table_HCS08_31 ≝ +[ + quadruple ???? (anyOP HCS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 SBC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_32 ≝ +[ + quadruple ???? (anyOP HCS08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 STA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 STA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_33 ≝ +[ + quadruple ???? (anyOP HCS08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 STX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 STX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_34 ≝ +[ + quadruple ???? (anyOP HCS08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉 +; quadruple ???? (anyOP HCS08 SUB) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_HCS08_35 ≝ +[ + quadruple ???? (anyOP HCS08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉 +; quadruple ???? (anyOP HCS08 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP HCS08 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP HCS08 TST) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_HCS08 ≝ +opcode_table_HCS08_1 @ opcode_table_HCS08_2 @ opcode_table_HCS08_3 @ opcode_table_HCS08_4 @ +opcode_table_HCS08_5 @ opcode_table_HCS08_6 @ opcode_table_HCS08_7 @ opcode_table_HCS08_8 @ +opcode_table_HCS08_9 @ opcode_table_HCS08_10 @ opcode_table_HCS08_11 @ opcode_table_HCS08_12 @ +opcode_table_HCS08_13 @ opcode_table_HCS08_14 @ opcode_table_HCS08_15 @ opcode_table_HCS08_16 @ +opcode_table_HCS08_17 @ opcode_table_HCS08_18 @ opcode_table_HCS08_19 @ opcode_table_HCS08_20 @ +opcode_table_HCS08_21 @ opcode_table_HCS08_22 @ opcode_table_HCS08_23 @ opcode_table_HCS08_24 @ +opcode_table_HCS08_25 @ opcode_table_HCS08_26 @ opcode_table_HCS08_27 @ opcode_table_HCS08_28 @ +opcode_table_HCS08_29 @ opcode_table_HCS08_30 @ opcode_table_HCS08_31 @ opcode_table_HCS08_32 @ +opcode_table_HCS08_33 @ opcode_table_HCS08_34 @ opcode_table_HCS08_35. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma new file mode 100755 index 000000000..463a3b7a6 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma @@ -0,0 +1,121 @@ +(**************************************************************************) +(* ___ *) +(* ||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/table_HCS08.ma". + +(* ****************** *) +(* TABELLA DELL'HCS08 *) +(* ****************** *) + +(* HCS08: opcode non implementati come da manuale (byte) *) +ndefinition HCS08_not_impl_byte ≝ + [〈x8,xD〉 + ;〈x9,xE〉 + ;〈xA,xC〉 + ]. + +nlemma ok_byte_table_HCS08 : forall_byte8 (λb. + (test_not_impl_byte b HCS08_not_impl_byte ⊙ eq_nat (get_byte_count HCS08 b 0 opcode_table_HCS08) 1) ⊗ + (⊖ (test_not_impl_byte b HCS08_not_impl_byte) ⊙ eq_nat (get_byte_count HCS08 b 0 opcode_table_HCS08) 0)) + = true. + napply (refl_eq ??). +qed. + +(* HCS08: opcode non implementati come da manuale (0x9E+byte) *) +ndefinition HCS08_not_impl_word ≝ + [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉 + ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉 + ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉 + ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉 + ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉 + ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉 + ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉 + ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉 + ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉 + ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉 + ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉 + ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉 + ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉 + ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉 + ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉 + ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉 + ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉 + ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉 + ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉 + ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xF〉 + ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xF〉 + ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xF〉 + ;〈xD,xC〉;〈xD,xD〉 + ;〈xE,xC〉;〈xE,xD〉 + ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉 + ]. + +nlemma ok_word_table_HCS08 : forall_byte8 (λb. + (test_not_impl_byte b HCS08_not_impl_word ⊙ eq_nat (get_word_count HCS08 b 0 opcode_table_HCS08) 1) ⊗ + (⊖ (test_not_impl_byte b HCS08_not_impl_word) ⊙ eq_nat (get_word_count HCS08 b 0 opcode_table_HCS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HCS08: pseudocodici non implementati come da manuale *) +ndefinition HCS08_not_impl_pseudo ≝ + [ SHA ; SLA ]. + +nlemma ok_pseudo_table_HCS08 : forall_opcode (λo. + (test_not_impl_pseudo o HCS08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HCS08 o 0 opcode_table_HCS08)) ⊗ + (⊖ (test_not_impl_pseudo o HCS08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HCS08 o 0 opcode_table_HCS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* HCS08: modalita' non implementate come da manuale *) +ndefinition HCS08_not_impl_mode ≝ + [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3 + ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7 + ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB + ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF + ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03 + ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07 + ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B + ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F + ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13 + ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17 + ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B + ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ]. + +nlemma ok_mode_table_HCS08 : forall_instr_mode (λi. + (test_not_impl_mode i HCS08_not_impl_mode ⊙ le_nat 1 (get_mode_count HCS08 i 0 opcode_table_HCS08)) ⊗ + (⊖ (test_not_impl_mode i HCS08_not_impl_mode) ⊙ eq_nat (get_mode_count HCS08 i 0 opcode_table_HCS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +nlemma ok_OpIm_table_HCS08 : + forall_instr_mode (λi:instr_mode. + forall_opcode (λop:opcode. + le_nat (get_OpIm_count HCS08 (anyOP HCS08 op) i 0 opcode_table_HCS08) 1)) = true. + napply (refl_eq ??). +nqed. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma new file mode 100755 index 000000000..374e0e7a3 --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma @@ -0,0 +1,398 @@ +(**************************************************************************) +(* ___ *) +(* ||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/opcode.ma". + +(* ***************** *) +(* TABELLA DELL'RS08 *) +(* ***************** *) + +(* definizione come concatenazione finale di liste per velocizzare il parsing *) +(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *) +(* NB: l'uso di any_opcode m + concatenazione finale tutte liste + impedisce di introdurre opcode disomogenei (per mcu) *) + +ndefinition opcode_table_RS08_1 ≝ +[ + quadruple ???? (anyOP RS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_2 ≝ +[ + quadruple ???? (anyOP RS08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x0) (Byte 〈x6,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x1) (Byte 〈x6,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x2) (Byte 〈x6,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x3) (Byte 〈x6,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x4) (Byte 〈x6,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x5) (Byte 〈x6,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x6) (Byte 〈x6,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x7) (Byte 〈x6,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x8) (Byte 〈x6,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY x9) (Byte 〈x6,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xA) (Byte 〈x6,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xB) (Byte 〈x6,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xC) (Byte 〈x6,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xD) (Byte 〈x6,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xE) (Byte 〈x6,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 ADD) (MODE_TNY xF) (Byte 〈x6,xF〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_3 ≝ +[ + quadruple ???? (anyOP RS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_4 ≝ +[ + quadruple ???? (anyOP RS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉 +]. + +ndefinition opcode_table_RS08_5 ≝ +[ + quadruple ???? (anyOP RS08 BRA) MODE_IMM1 (Byte 〈x3,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 BCC) MODE_IMM1 (Byte 〈x3,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 BCS) MODE_IMM1 (Byte 〈x3,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 BNE) MODE_IMM1 (Byte 〈x3,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 BEQ) MODE_IMM1 (Byte 〈x3,x7〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_6 ≝ +[ + quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_RS08_7 ≝ +[ + quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_RS08_8 ≝ +[ + quadruple ???? (anyOP RS08 CLC ) MODE_INH (Byte 〈x3,x8〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 SEC ) MODE_INH (Byte 〈x3,x9〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 SLA ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 SHA ) MODE_INH (Byte 〈x4,x5〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 NOP ) MODE_INH (Byte 〈xA,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 STOP) MODE_INH (Byte 〈xA,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 WAIT) MODE_INH (Byte 〈xA,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 RTS ) MODE_INH (Byte 〈xB,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 BGND) MODE_INH (Byte 〈xB,xF〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_RS08_9 ≝ +[ + quadruple ???? (anyOP RS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_10 ≝ +[ + quadruple ???? (anyOP RS08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t00) (Byte 〈x8,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t01) (Byte 〈x8,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t02) (Byte 〈x8,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t03) (Byte 〈x8,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t04) (Byte 〈x8,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t05) (Byte 〈x8,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t06) (Byte 〈x8,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t07) (Byte 〈x8,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t08) (Byte 〈x8,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t09) (Byte 〈x8,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0A) (Byte 〈x8,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0B) (Byte 〈x8,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0C) (Byte 〈x8,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0D) (Byte 〈x8,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0E) (Byte 〈x8,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t0F) (Byte 〈x8,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t10) (Byte 〈x9,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t11) (Byte 〈x9,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t12) (Byte 〈x9,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t13) (Byte 〈x9,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t14) (Byte 〈x9,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t15) (Byte 〈x9,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t16) (Byte 〈x9,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t17) (Byte 〈x9,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t18) (Byte 〈x9,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t19) (Byte 〈x9,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1A) (Byte 〈x9,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1B) (Byte 〈x9,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1C) (Byte 〈x9,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1D) (Byte 〈x9,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1E) (Byte 〈x9,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CLR) (MODE_SRT t1F) (Byte 〈x9,xF〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_RS08_11 ≝ +[ + quadruple ???? (anyOP RS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_12 ≝ +[ + quadruple ???? (anyOP RS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉 +]. + +ndefinition opcode_table_RS08_13 ≝ +[ + quadruple ???? (anyOP RS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉 +; quadruple ???? (anyOP RS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_14 ≝ +[ + quadruple ???? (anyOP RS08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x0) (Byte 〈x5,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x1) (Byte 〈x5,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x2) (Byte 〈x5,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x3) (Byte 〈x5,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x4) (Byte 〈x5,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x5) (Byte 〈x5,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x6) (Byte 〈x5,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x7) (Byte 〈x5,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x8) (Byte 〈x5,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY x9) (Byte 〈x5,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xA) (Byte 〈x5,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xB) (Byte 〈x5,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xC) (Byte 〈x5,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xD) (Byte 〈x5,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xE) (Byte 〈x5,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 DEC) (MODE_TNY xF) (Byte 〈x5,xF〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_15 ≝ +[ + quadruple ???? (anyOP RS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_16 ≝ +[ + quadruple ???? (anyOP RS08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉 +; quadruple ???? (anyOP RS08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x0) (Byte 〈x2,x0〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x1) (Byte 〈x2,x1〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x2) (Byte 〈x2,x2〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x3) (Byte 〈x2,x3〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x4) (Byte 〈x2,x4〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x5) (Byte 〈x2,x5〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x6) (Byte 〈x2,x6〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x7) (Byte 〈x2,x7〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x8) (Byte 〈x2,x8〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY x9) (Byte 〈x2,x9〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xA) (Byte 〈x2,xA〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xB) (Byte 〈x2,xB〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xC) (Byte 〈x2,xC〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xD) (Byte 〈x2,xD〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xE) (Byte 〈x2,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 INC) (MODE_TNY xF) (Byte 〈x2,xF〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_17 ≝ +[ + quadruple ???? (anyOP RS08 JMP) MODE_IMM2 (Byte 〈xB,xC〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_18 ≝ +[ + quadruple ???? (anyOP RS08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 JSR) MODE_IMM2 (Byte 〈xB,xD〉) 〈x0,x4〉 +]. + +ndefinition opcode_table_RS08_19 ≝ +[ + quadruple ???? (anyOP RS08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t00) (Byte 〈xC,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t01) (Byte 〈xC,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t02) (Byte 〈xC,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t03) (Byte 〈xC,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t04) (Byte 〈xC,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t05) (Byte 〈xC,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t06) (Byte 〈xC,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t07) (Byte 〈xC,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t08) (Byte 〈xC,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t09) (Byte 〈xC,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0A) (Byte 〈xC,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0B) (Byte 〈xC,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0C) (Byte 〈xC,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0D) (Byte 〈xC,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0E) (Byte 〈xC,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t0F) (Byte 〈xC,xF〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t10) (Byte 〈xD,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t11) (Byte 〈xD,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t12) (Byte 〈xD,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t13) (Byte 〈xD,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t14) (Byte 〈xD,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t15) (Byte 〈xD,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t16) (Byte 〈xD,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t17) (Byte 〈xD,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t18) (Byte 〈xD,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t19) (Byte 〈xD,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1A) (Byte 〈xD,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1B) (Byte 〈xD,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1C) (Byte 〈xD,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1D) (Byte 〈xD,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1E) (Byte 〈xD,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 LDA) (MODE_SRT t1F) (Byte 〈xD,xF〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_20 ≝ +[ + quadruple ???? (anyOP RS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉 +]. + +ndefinition opcode_table_RS08_21 ≝ +[ + quadruple ???? (anyOP RS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x3,xE〉) 〈x0,x4〉 +; quadruple ???? (anyOP RS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉 +]. + +ndefinition opcode_table_RS08_22 ≝ +[ + quadruple ???? (anyOP RS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_23 ≝ +[ + quadruple ???? (anyOP RS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉 +]. + +ndefinition opcode_table_RS08_24 ≝ +[ + quadruple ???? (anyOP RS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉 +]. + +ndefinition opcode_table_RS08_25 ≝ +[ + quadruple ???? (anyOP RS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08_26 ≝ +[ + quadruple ???? (anyOP RS08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t00) (Byte 〈xE,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t01) (Byte 〈xE,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t02) (Byte 〈xE,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t03) (Byte 〈xE,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t04) (Byte 〈xE,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t05) (Byte 〈xE,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t06) (Byte 〈xE,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t07) (Byte 〈xE,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t08) (Byte 〈xE,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t09) (Byte 〈xE,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0A) (Byte 〈xE,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0B) (Byte 〈xE,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0C) (Byte 〈xE,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0D) (Byte 〈xE,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0E) (Byte 〈xE,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t0F) (Byte 〈xE,xF〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t10) (Byte 〈xF,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t11) (Byte 〈xF,x1〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t12) (Byte 〈xF,x2〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t13) (Byte 〈xF,x3〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t14) (Byte 〈xF,x4〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t15) (Byte 〈xF,x5〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t16) (Byte 〈xF,x6〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t17) (Byte 〈xF,x7〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t18) (Byte 〈xF,x8〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t19) (Byte 〈xF,x9〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1A) (Byte 〈xF,xA〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1B) (Byte 〈xF,xB〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1C) (Byte 〈xF,xC〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1D) (Byte 〈xF,xD〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1E) (Byte 〈xF,xE〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 STA) (MODE_SRT t1F) (Byte 〈xF,xF〉) 〈x0,x2〉 +]. + +ndefinition opcode_table_RS08_27 ≝ +[ + quadruple ???? (anyOP RS08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉 +; quadruple ???? (anyOP RS08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x0) (Byte 〈x7,x0〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x1) (Byte 〈x7,x1〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x2) (Byte 〈x7,x2〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x3) (Byte 〈x7,x3〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x4) (Byte 〈x7,x4〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x5) (Byte 〈x7,x5〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x6) (Byte 〈x7,x6〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x7) (Byte 〈x7,x7〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x8) (Byte 〈x7,x8〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY x9) (Byte 〈x7,x9〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xA) (Byte 〈x7,xA〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xB) (Byte 〈x7,xB〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xC) (Byte 〈x7,xC〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xD) (Byte 〈x7,xD〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xE) (Byte 〈x7,xE〉) 〈x0,x3〉 +; quadruple ???? (anyOP RS08 SUB) (MODE_TNY xF) (Byte 〈x7,xF〉) 〈x0,x3〉 +]. + +ndefinition opcode_table_RS08 ≝ +opcode_table_RS08_1 @ opcode_table_RS08_2 @ opcode_table_RS08_3 @ opcode_table_RS08_4 @ +opcode_table_RS08_5 @ opcode_table_RS08_6 @ opcode_table_RS08_7 @ opcode_table_RS08_8 @ +opcode_table_RS08_9 @ opcode_table_RS08_10 @ opcode_table_RS08_11 @ opcode_table_RS08_12 @ +opcode_table_RS08_13 @ opcode_table_RS08_14 @ opcode_table_RS08_15 @ opcode_table_RS08_16 @ +opcode_table_RS08_17 @ opcode_table_RS08_18 @ opcode_table_RS08_19 @ opcode_table_RS08_20 @ +opcode_table_RS08_21 @ opcode_table_RS08_22 @ opcode_table_RS08_23 @ opcode_table_RS08_24 @ +opcode_table_RS08_25 @ opcode_table_RS08_26 @ opcode_table_RS08_27. diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma new file mode 100755 index 000000000..ed801fbec --- /dev/null +++ b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma @@ -0,0 +1,81 @@ +(**************************************************************************) +(* ___ *) +(* ||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/table_RS08.ma". + +(* ***************** *) +(* TABELLA DELL'RS08 *) +(* ***************** *) + +(* RS08: opcode non implementati come da manuale *) +ndefinition RS08_not_impl_byte ≝ + [〈x3,x2〉;〈x3,x3〉;〈x3,xD〉 + ;〈x4,x0〉;〈x4,x7〉;〈x4,xD〉 + ;〈xA,x3〉;〈xA,x5〉;〈xA,x7〉 + ;〈xB,x3〉;〈xB,x5〉 + ]. + +nlemma ok_byte_table_RS08 : forall_byte8 (λb. + (test_not_impl_byte b RS08_not_impl_byte ⊙ eq_nat (get_byte_count RS08 b 0 opcode_table_RS08) 1) ⊗ + (⊖ (test_not_impl_byte b RS08_not_impl_byte) ⊙ eq_nat (get_byte_count RS08 b 0 opcode_table_RS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* RS08: pseudocodici non implementati come da manuale *) +ndefinition RS08_not_impl_pseudo ≝ + [ AIS ; AIX ; ASR ; BGE ; BGT ; BHCC ; BHCS ; BHI ; BIH ; BIL ; BIT ; BLE ; BLS + ; BLT ; BMC ; BMI ; BMS ; BPL ; BRN ; CBEQX ; CLI ; CPHX ; CPX ; DAA ; DIV + ; LDHX ; LDX ; MUL ; NEG ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX ; RSP + ; RTI ; SEI ; STHX ; STX ; SWI ; TAP ; TAX ; TPA ; TST ; TSX ; TXA ; TXS ]. + +nlemma ok_pseudo_table_RS08 : forall_opcode (λo. + (test_not_impl_pseudo o RS08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count RS08 o 0 opcode_table_RS08)) ⊗ + (⊖ (test_not_impl_pseudo o RS08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count RS08 o 0 opcode_table_RS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +(* RS08: modalita' non implementate come da manuale *) +ndefinition RS08_not_impl_mode ≝ + [ MODE_INHX ; MODE_INHH ; MODE_INHX0ADD ; MODE_INHX1ADD ; MODE_INHX2ADD ; MODE_IMM1EXT + ; MODE_DIR2 ; MODE_IX0 ; MODE_IX1 ; MODE_IX2 ; MODE_SP1 ; MODE_SP2 + ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p ; MODE_INHX_and_IMM1 ; MODE_IX0_and_IMM1 + ; MODE_IX0p_and_IMM1 ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1 ]. + +nlemma ok_mode_table_RS08 : forall_instr_mode (λi. + (test_not_impl_mode i RS08_not_impl_mode ⊙ le_nat 1 (get_mode_count RS08 i 0 opcode_table_RS08)) ⊗ + (⊖ (test_not_impl_mode i RS08_not_impl_mode) ⊙ eq_nat (get_mode_count RS08 i 0 opcode_table_RS08) 0)) + = true. + napply (refl_eq ??). +nqed. + +nlemma ok_OpIm_table_RS08 : + forall_instr_mode (λi:instr_mode. + forall_opcode (λop:opcode. + le_nat (get_OpIm_count RS08 (anyOP RS08 op) i 0 opcode_table_RS08) 1)) = true. + napply (refl_eq ??). +nqed. -- 2.39.2