]> matita.cs.unibo.it Git - helm.git/commitdiff
freescale porting, work in progress
authorCosimo Oliboni <??>
Wed, 5 Aug 2009 13:23:02 +0000 (13:23 +0000)
committerCosimo Oliboni <??>
Wed, 5 Aug 2009 13:23:02 +0000 (13:23 +0000)
helm/software/matita/contribs/ng_assembly/common/nat_to_num.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/depends
helm/software/matita/contribs/ng_assembly/freescale/status_lemmas.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests_tools.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/freescale_tests/micro_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/num/byte8.ma
helm/software/matita/contribs/ng_assembly/num/word16.ma

diff --git a/helm/software/matita/contribs/ng_assembly/common/nat_to_num.ma b/helm/software/matita/contribs/ng_assembly/common/nat_to_num.ma
new file mode 100755 (executable)
index 0000000..db38d08
--- /dev/null
@@ -0,0 +1,78 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                   *)
+(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "common/nat.ma".
+include "num/word32.ma".
+
+(* ************************ *)
+(* NUMERI FINITI → NATURALI *)
+(* ************************ *)
+
+nlet rec nat_of_qu_aux n (r:rec_quatern n) on r ≝
+ match r with
+  [ qu_O ⇒ 0
+  | qu_S t n' ⇒ S (nat_of_qu_aux t n')
+  ].
+
+ndefinition nat_of_qu : quatern → nat ≝ λn.nat_of_qu_aux n (qu_to_recqu n).
+
+nlet rec nat_of_oct_aux n (r:rec_oct n) on r ≝
+ match r with
+  [ oc_O ⇒ 0
+  | oc_S t n' ⇒ S (nat_of_oct_aux t n')
+  ].
+
+ndefinition nat_of_oct : oct → nat ≝ λn.nat_of_oct_aux n (oct_to_recoct n).
+
+nlet rec nat_of_ex_aux n (r:rec_exadecim n) on r ≝
+ match r with
+  [ ex_O ⇒ 0
+  | ex_S t n' ⇒ S (nat_of_ex_aux t n')
+  ].
+
+ndefinition nat_of_ex : exadecim → nat ≝ λn.nat_of_ex_aux n (ex_to_recex n).
+
+nlet rec nat_of_bit_aux n (r:rec_bitrigesim n) on r ≝
+ match r with
+  [ bi_O ⇒ 0
+  | bi_S t n' ⇒ S (nat_of_bit_aux t n')
+  ].
+
+ndefinition nat_of_bit : bitrigesim → nat ≝ λn.nat_of_bit_aux n (bit_to_recbit n).
+
+nlet rec nat_of_b8_aux n (r:rec_byte8 n) on r ≝
+ match r with
+  [ b8_O ⇒ 0
+  | b8_S t n' ⇒ S (nat_of_b8_aux t n')
+  ].
+
+ndefinition nat_of_b8 : byte8 → nat ≝ λn:byte8.nat_of_b8_aux n (b8_to_recb8 n).
+
+nlet rec nat_of_w16_aux n (r:rec_word16 n) on r : nat ≝
+ match r with
+  [ w16_O ⇒ 0
+  | w16_S t n' ⇒ S (nat_of_w16_aux t n')
+  ].
+
+ndefinition nat_of_w16 : word16 → nat ≝ λn:word16.nat_of_w16_aux n (w16_to_recw16 n).
+
+ndefinition nat_of_w32 : word32 → nat ≝ λn:word32.(256*256*(nat_of_w16 (w32h n))) + (nat_of_w16 (w32l n)).
index ef011e97262167731c86c354584f8e291e2b1a76..86f3a56195aca17375fc2d900e7081f78b44641f 100644 (file)
@@ -6,9 +6,11 @@ num/bool.ma common/theory.ma
 freescale/table_HCS08_tests.ma freescale/opcode.ma freescale/table_HCS08.ma
 freescale/multivm.ma freescale/load_write.ma
 common/ascii_lemmas1.ma common/ascii.ma
+common/nat_to_num.ma common/nat.ma num/word32.ma
+common/nat.ma num/bool.ma
 freescale/opcode_base_lemmas.ma freescale/opcode_base.ma num/bool_lemmas.ma
+freescale_tests/medium_tests_tools.ma freescale/multivm.ma
 common/string_lemmas.ma common/ascii_lemmas2.ma common/list_utility_lemmas.ma common/string.ma
-common/nat.ma num/bool.ma
 num/quatern.ma num/bool.ma
 freescale/table_HC05_tests.ma freescale/opcode.ma freescale/table_HC05.ma
 num/exadecim.ma common/nat.ma common/prod.ma num/bool.ma num/oct.ma num/quatern.ma
@@ -36,18 +38,21 @@ common/prod.ma num/bool.ma
 freescale/opcode_base_lemmas_instrmode2.ma freescale/opcode_base_lemmas_instrmode1.ma
 num/exadecim_lemmas.ma num/bool_lemmas.ma num/exadecim.ma
 num/word16_lemmas.ma num/byte8_lemmas.ma num/word16.ma
+freescale_tests/medium_tests.ma common/list_utility.ma common/nat_to_num.ma freescale_tests/medium_tests_tools.ma
 freescale/opcode_base_lemmas1.ma freescale/opcode_base_lemmas_instrmode2.ma freescale/opcode_base_lemmas_opcode2.ma num/word16_lemmas.ma
 freescale/table_HC08.ma common/list.ma freescale/opcode_base.ma
 num/bool_lemmas.ma num/bool.ma
+freescale_tests/micro_tests.ma freescale/multivm.ma freescale/status_lemmas.ma
 freescale/table_HCS08.ma common/list.ma freescale/opcode_base.ma
 num/oct_lemmas.ma num/bool_lemmas.ma num/oct.ma
 common/ascii.ma num/bool.ma
 num/word32.ma num/word16.ma
 freescale/opcode_base.ma num/word16.ma
+freescale/status_lemmas.ma common/option_lemmas.ma common/prod_lemmas.ma freescale/opcode_base_lemmas1.ma freescale/status.ma num/word16_lemmas.ma
 num/quatern_lemmas.ma num/bool_lemmas.ma num/quatern.ma
 freescale/table_HC08_tests.ma freescale/opcode.ma freescale/table_HC08.ma
-common/option.ma num/bool.ma
 common/option_lemmas.ma common/option.ma num/bool_lemmas.ma
+common/option.ma num/bool.ma
 num/byte8_lemmas.ma num/byte8.ma num/exadecim_lemmas.ma
 common/ascii_lemmas2.ma common/ascii_lemmas1.ma num/bool_lemmas.ma
 common/list_lemmas.ma common/list.ma
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/status_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/status_lemmas.ma
new file mode 100755 (executable)
index 0000000..7016154
--- /dev/null
@@ -0,0 +1,1045 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                   *)
+(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "num/word16_lemmas.ma".
+include "freescale/opcode_base_lemmas1.ma".
+include "freescale/status.ma".
+include "common/option_lemmas.ma".
+include "common/prod_lemmas.ma".
+
+(* *********************************** *)
+(* STATUS INTERNO DEL PROCESSORE (ALU) *)
+(* *********************************** *)
+
+nlemma aluHC05_destruct_1 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x1 = y1.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 a _ _ _ _ _ _ _ _ _ _ _ _ ⇒ x1 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_2 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x2 = y2.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ a _ _ _ _ _ _ _ _ _ _ _ ⇒ x2 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_3 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x3 = y3.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ a _ _ _ _ _ _ _ _ _ _ ⇒ x3 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_4 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x4 = y4.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ a _ _ _ _ _ _ _ _ _ ⇒ x4 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_5 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x5 = y5.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ a _ _ _ _ _ _ _ _ ⇒ x5 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_6 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x6 = y6.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ a _ _ _ _ _ _ _ ⇒ x6 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_7 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x7 = y7.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ a _ _ _ _ _ _ ⇒ x7 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_8 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x8 = y8.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ a _ _ _ _ _ ⇒ x8 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_9 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x9 = y9.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ _ a _ _ _ _ ⇒ x9 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_10 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x10 = y10.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ _ _ a _ _ _ ⇒ x10 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_11 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x11 = y11.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ _ _ _ a _ _ ⇒ x11 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_12 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x12 = y12.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ _ _ _ _ a _ ⇒ x12 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC05_destruct_13 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13.
+ mk_alu_HC05 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 = mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 →
+ x13 = y13.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange with (match mk_alu_HC05 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13
+                with [ mk_alu_HC05 _ _ _ _ _ _ _ _ _ _ _ _ a ⇒ x13 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma symmetric_eqaluHC05 : symmetricT alu_HC05 bool eq_alu_HC05.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13;
+ nchange with (
+  ((eq_b8 x1 y1) ⊗ (eq_b8 x2 y2) ⊗ (eq_w16 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+  (eq_w16 x5 y5) ⊗ (eq_w16 x6 y6) ⊗  (eq_w16 x7 y7) ⊗ (eq_bool x8 y8) ⊗
+  (eq_bool x9 y9) ⊗ (eq_bool x10 y10) ⊗  (eq_bool x11 y11) ⊗ (eq_bool x12 y12) ⊗
+  (eq_bool x13 y13)) = ((eq_b8 y1 x1) ⊗  (eq_b8 y2 x2) ⊗ (eq_w16 y3 x3) ⊗
+  (eq_w16 y4 x4) ⊗ (eq_w16 y5 x5) ⊗  (eq_w16 y6 x6) ⊗ (eq_w16 y7 x7) ⊗
+  (eq_bool y8 x8) ⊗ (eq_bool y9 x9) ⊗  (eq_bool y10 x10) ⊗ (eq_bool y11 x11) ⊗
+  (eq_bool y12 x12) ⊗ (eq_bool y13 x13)));
+ nrewrite > (symmetric_eqb8 x1 y1);
+ nrewrite > (symmetric_eqb8 x2 y2);
+ nrewrite > (symmetric_eqw16 x3 y3);
+ nrewrite > (symmetric_eqw16 x4 y4);
+ nrewrite > (symmetric_eqw16 x5 y5);
+ nrewrite > (symmetric_eqw16 x6 y6);
+ nrewrite > (symmetric_eqw16 x7 y7);
+ nrewrite > (symmetric_eqbool x8 y8);
+ nrewrite > (symmetric_eqbool x9 y9);
+ nrewrite > (symmetric_eqbool x10 y10);
+ nrewrite > (symmetric_eqbool x11 y11);
+ nrewrite > (symmetric_eqbool x12 y12);
+ nrewrite > (symmetric_eqbool x13 y13);
+ napply refl_eq.
+nqed.
+
+nlemma eqaluHC05_to_eq : ∀alu1,alu2.eq_alu_HC05 alu1 alu2 = true → alu1 = alu2.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nchange in H:(%) with (
+ ((eq_b8 x1 y1) ⊗ (eq_b8 x2 y2) ⊗
+  (eq_w16 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+  (eq_w16 x5 y5) ⊗ (eq_w16 x6 y6) ⊗
+  (eq_w16 x7 y7) ⊗ (eq_bool x8 y8) ⊗
+  (eq_bool x9 y9) ⊗ (eq_bool x10 y10) ⊗
+  (eq_bool x11 y11) ⊗ (eq_bool x12 y12) ⊗
+  (eq_bool x13 y13)) = true);  
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H));
+ nletin H1 ≝ (andb_true_true_l … H);
+ nrewrite > (eqbool_to_eq x12 y12 (andb_true_true_r … (andb_true_true_l … H)));
+ nletin H2 ≝ (andb_true_true_l … H1);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H2));
+ nletin H3 ≝ (andb_true_true_l … H2);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H3));
+ nletin H4 ≝ (andb_true_true_l … H3);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H4));
+ nletin H5 ≝ (andb_true_true_l … H4);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H5));
+ nletin H6 ≝ (andb_true_true_l … H5);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H6));
+ nletin H7 ≝ (andb_true_true_l … H6);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H7));
+ nletin H8 ≝ (andb_true_true_l … H7);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H8));
+ nletin H9 ≝ (andb_true_true_l … H8);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H9));
+ nletin H10 ≝ (andb_true_true_l … H9);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H10));
+ nletin H11 ≝ (andb_true_true_l … H10);
+ nrewrite > (eqb8_to_eq … (andb_true_true_r … H11));
+ nrewrite > (eqb8_to_eq … (andb_true_true_l … H11));
+ napply refl_eq.
+nqed.
+
+nlemma eq_to_eqaluHC05 : ∀alu1,alu2.alu1 = alu2 → eq_alu_HC05 alu1 alu2 = true.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12; #x13;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #y13; #H;
+ nrewrite > (aluHC05_destruct_1 … H);
+ nrewrite > (aluHC05_destruct_2 … H);
+ nrewrite > (aluHC05_destruct_3 … H);
+ nrewrite > (aluHC05_destruct_4 … H);
+ nrewrite > (aluHC05_destruct_5 … H);
+ nrewrite > (aluHC05_destruct_6 … H);
+ nrewrite > (aluHC05_destruct_7 … H);
+ nrewrite > (aluHC05_destruct_8 … H);
+ nrewrite > (aluHC05_destruct_9 … H);
+ nrewrite > (aluHC05_destruct_10 … H);
+ nrewrite > (aluHC05_destruct_11 … H);
+ nrewrite > (aluHC05_destruct_12 … H);
+ nrewrite > (aluHC05_destruct_13 … H);
+ nchange with (
+ ((eq_b8 y1 y1) ⊗ (eq_b8 y2 y2) ⊗
+  (eq_w16 y3 y3) ⊗ (eq_w16 y4 y4) ⊗
+  (eq_w16 y5 y5) ⊗ (eq_w16 y6 y6) ⊗
+  (eq_w16 y7 y7) ⊗ (eq_bool y8 y8) ⊗
+  (eq_bool y9 y9) ⊗ (eq_bool y10 y10) ⊗
+  (eq_bool y11 y11) ⊗ (eq_bool y12 y12) ⊗
+  (eq_bool y13 y13)) = true); 
+ nrewrite > (eq_to_eqb8 y1 y1 (refl_eq …));
+ nrewrite > (eq_to_eqb8 y2 y2 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y3 y3 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y4 y4 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y5 y5 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y6 y6 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y7 y7 (refl_eq …));
+ nrewrite > (eq_to_eqbool y8 y8 (refl_eq …));
+ nrewrite > (eq_to_eqbool y9 y9 (refl_eq …));
+ nrewrite > (eq_to_eqbool y10 y10 (refl_eq …));
+ nrewrite > (eq_to_eqbool y11 y11 (refl_eq …));
+ nrewrite > (eq_to_eqbool y12 y12 (refl_eq …));
+ nrewrite > (eq_to_eqbool y13 y13 (refl_eq …));
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_1 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x1 = y1.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 a _ _ _ _ _ _ _ _ _ _ _ ⇒ x1 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_2 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x2 = y2.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ a _ _ _ _ _ _ _ _ _ _ ⇒ x2 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_3 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x3 = y3.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ a _ _ _ _ _ _ _ _ _ ⇒ x3 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_4 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x4 = y4.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ a _ _ _ _ _ _ _ _ ⇒ x4 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_5 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x5 = y5.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ a _ _ _ _ _ _ _ ⇒ x5 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_6 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x6 = y6.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ a _ _ _ _ _ _ ⇒ x6 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_7 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x7 = y7.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ a _ _ _ _ _ ⇒ x7 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_8 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x8 = y8.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ _ a _ _ _ _ ⇒ x8 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_9 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x9 = y9.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ _ _ a _ _ _ ⇒ x9 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_10 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x10 = y10.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ _ _ _ a _ _ ⇒ x10 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_11 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x11 = y11.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ _ _ _ _ a _ ⇒ x11 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluHC08_destruct_12 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12.
+ mk_alu_HC08 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 = mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 →
+ x12 = y12.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange with (match mk_alu_HC08 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12
+                with [ mk_alu_HC08 _ _ _ _ _ _ _ _ _ _ _ a ⇒ x12 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma symmetric_eqaluHC08 : symmetricT alu_HC08 bool eq_alu_HC08.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12;
+ nchange with (
+  ((eq_b8 x1 y1) ⊗ (eq_b8 x2 y2) ⊗ (eq_b8 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+   (eq_w16 x5 y5) ⊗ (eq_bool x6 y6) ⊗ (eq_bool x7 y7) ⊗ (eq_bool x8 y8) ⊗
+   (eq_bool x9 y9) ⊗ (eq_bool x10 y10) ⊗ (eq_bool x11 y11) ⊗ (eq_bool x12 y12)) =
+   ((eq_b8 y1 x1) ⊗ (eq_b8 y2 x2) ⊗ (eq_b8 y3 x3) ⊗ (eq_w16 y4 x4) ⊗
+   (eq_w16 y5 x5) ⊗ (eq_bool y6 x6) ⊗ (eq_bool y7 x7) ⊗ (eq_bool y8 x8) ⊗
+   (eq_bool y9 x9) ⊗ (eq_bool y10 x10) ⊗ (eq_bool y11 x11) ⊗ (eq_bool y12 x12))); 
+ nrewrite > (symmetric_eqb8 x1 y1);
+ nrewrite > (symmetric_eqb8 x2 y2);
+ nrewrite > (symmetric_eqb8 x3 y3);
+ nrewrite > (symmetric_eqw16 x4 y4);
+ nrewrite > (symmetric_eqw16 x5 y5);
+ nrewrite > (symmetric_eqbool x6 y6);
+ nrewrite > (symmetric_eqbool x7 y7);
+ nrewrite > (symmetric_eqbool x8 y8);
+ nrewrite > (symmetric_eqbool x9 y9);
+ nrewrite > (symmetric_eqbool x10 y10);
+ nrewrite > (symmetric_eqbool x11 y11);
+ nrewrite > (symmetric_eqbool x12 y12);
+ napply refl_eq.
+nqed.
+
+nlemma eqaluHC08_to_eq : ∀alu1,alu2.eq_alu_HC08 alu1 alu2 = true → alu1 = alu2.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nchange in H:(%) with (
+ ((eq_b8 x1 y1) ⊗ (eq_b8 x2 y2) ⊗ (eq_b8 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+  (eq_w16 x5 y5) ⊗ (eq_bool x6 y6) ⊗ (eq_bool x7 y7) ⊗ (eq_bool x8 y8) ⊗
+  (eq_bool x9 y9) ⊗ (eq_bool x10 y10) ⊗ (eq_bool x11 y11) ⊗ (eq_bool x12 y12)) = true);  
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H));
+ nletin H1 ≝ (andb_true_true_l … H);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H1));
+ nletin H2 ≝ (andb_true_true_l … H1);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H2));
+ nletin H3 ≝ (andb_true_true_l … H2);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H3));
+ nletin H4 ≝ (andb_true_true_l … H3);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H4));
+ nletin H5 ≝ (andb_true_true_l … H4);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H5));
+ nletin H6 ≝ (andb_true_true_l … H5);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H6));
+ nletin H7 ≝ (andb_true_true_l … H6);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H7));
+ nletin H8 ≝ (andb_true_true_l … H7);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H8));
+ nletin H9 ≝ (andb_true_true_l … H8);
+ nrewrite > (eqb8_to_eq … (andb_true_true_r … H9));
+ nletin H10 ≝ (andb_true_true_l … H9);
+ nrewrite > (eqb8_to_eq … (andb_true_true_r … H10));
+ nrewrite > (eqb8_to_eq … (andb_true_true_l … H10));
+ napply refl_eq.
+nqed.
+
+nlemma eq_to_eqaluHC08 : ∀alu1,alu2.alu1 = alu2 → eq_alu_HC08 alu1 alu2 = true.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8; #x9; #x10; #x11; #x12;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #y9; #y10; #y11; #y12; #H;
+ nrewrite > (aluHC08_destruct_1 … H);
+ nrewrite > (aluHC08_destruct_2 … H);
+ nrewrite > (aluHC08_destruct_3 … H);
+ nrewrite > (aluHC08_destruct_4 … H);
+ nrewrite > (aluHC08_destruct_5 … H);
+ nrewrite > (aluHC08_destruct_6 … H);
+ nrewrite > (aluHC08_destruct_7 … H);
+ nrewrite > (aluHC08_destruct_8 … H);
+ nrewrite > (aluHC08_destruct_9 … H);
+ nrewrite > (aluHC08_destruct_10 … H);
+ nrewrite > (aluHC08_destruct_11 … H);
+ nrewrite > (aluHC08_destruct_12 … H);
+ nchange with (
+ ((eq_b8 y1 y1) ⊗ (eq_b8 y2 y2) ⊗ (eq_b8 y3 y3) ⊗ (eq_w16 y4 y4) ⊗
+  (eq_w16 y5 y5) ⊗ (eq_bool y6 y6) ⊗ (eq_bool y7 y7) ⊗ (eq_bool y8 y8) ⊗
+  (eq_bool y9 y9) ⊗ (eq_bool y10 y10) ⊗ (eq_bool y11 y11) ⊗ (eq_bool y12 y12)) = true); 
+ nrewrite > (eq_to_eqb8 y1 y1 (refl_eq …));
+ nrewrite > (eq_to_eqb8 y2 y2 (refl_eq …));
+ nrewrite > (eq_to_eqb8 y3 y3 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y4 y4 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y5 y5 (refl_eq …));
+ nrewrite > (eq_to_eqbool y6 y6 (refl_eq …));
+ nrewrite > (eq_to_eqbool y7 y7 (refl_eq …));
+ nrewrite > (eq_to_eqbool y8 y8 (refl_eq …));
+ nrewrite > (eq_to_eqbool y9 y9 (refl_eq …));
+ nrewrite > (eq_to_eqbool y10 y10 (refl_eq …));
+ nrewrite > (eq_to_eqbool y11 y11 (refl_eq …));
+ nrewrite > (eq_to_eqbool y12 y12 (refl_eq …));
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_1 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x1 = y1.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 a _ _ _ _ _ _ _ ⇒ x1 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_2 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x2 = y2.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ a _ _ _ _ _ _ ⇒ x2 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_3 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x3 = y3.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ a _ _ _ _ _ ⇒ x3 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_4 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x4 = y4.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ _ a _ _ _ _ ⇒ x4 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_5 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x5 = y5.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ _ _ a _ _ _ ⇒ x5 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_6 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x6 = y6.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ _ _ _ a _ _ ⇒ x6 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_7 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x7 = y7.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ _ _ _ _ a _ ⇒ x7 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma aluRS08_destruct_8 :
+∀x1,x2,x3,x4,x5,x6,x7,x8,y1,y2,y3,y4,y5,y6,y7,y8.
+ mk_alu_RS08 x1 x2 x3 x4 x5 x6 x7 x8 = mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8 →
+ x8 = y8.
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange with (match mk_alu_RS08 y1 y2 y3 y4 y5 y6 y7 y8
+                with [ mk_alu_RS08 _ _ _ _ _ _ _ a ⇒ x8 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma symmetric_eqaluRS08 : symmetricT alu_RS08 bool eq_alu_RS08.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8;
+ nchange with (
+  ((eq_b8 x1 y1) ⊗ (eq_w16 x2 y2) ⊗
+   (eq_w16 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+   (eq_b8 x5 y5) ⊗ (eq_b8 x6 y6) ⊗
+   (eq_bool x7 y7) ⊗ (eq_bool x8 y8)) =
+  ((eq_b8 y1 x1) ⊗ (eq_w16 y2 x2) ⊗
+   (eq_w16 y3 x3) ⊗ (eq_w16 y4 x4) ⊗
+   (eq_b8 y5 x5) ⊗ (eq_b8 y6 x6) ⊗
+   (eq_bool y7 x7) ⊗ (eq_bool y8 x8)));
+ nrewrite > (symmetric_eqb8 x1 y1);
+ nrewrite > (symmetric_eqw16 x2 y2);
+ nrewrite > (symmetric_eqw16 x3 y3);
+ nrewrite > (symmetric_eqw16 x4 y4);
+ nrewrite > (symmetric_eqb8 x5 y5);
+ nrewrite > (symmetric_eqb8 x6 y6);
+ nrewrite > (symmetric_eqbool x7 y7);
+ nrewrite > (symmetric_eqbool x8 y8);
+ napply refl_eq.
+nqed.
+
+nlemma eqaluRS08_to_eq : ∀alu1,alu2.eq_alu_RS08 alu1 alu2 = true → alu1 = alu2.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nchange in H:(%) with (
+  ((eq_b8 x1 y1) ⊗ (eq_w16 x2 y2) ⊗
+   (eq_w16 x3 y3) ⊗ (eq_w16 x4 y4) ⊗
+   (eq_b8 x5 y5) ⊗ (eq_b8 x6 y6) ⊗
+   (eq_bool x7 y7) ⊗ (eq_bool x8 y8)) = true);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H));
+ nletin H1 ≝ (andb_true_true_l … H);
+ nrewrite > (eqbool_to_eq … (andb_true_true_r … H1));
+ nletin H2 ≝ (andb_true_true_l … H1);
+ nrewrite > (eqb8_to_eq … (andb_true_true_r … H2));
+ nletin H3 ≝ (andb_true_true_l … H2);
+ nrewrite > (eqb8_to_eq … (andb_true_true_r … H3));
+ nletin H4 ≝ (andb_true_true_l … H3);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H4));
+ nletin H5 ≝ (andb_true_true_l … H4);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H5));
+ nletin H6 ≝ (andb_true_true_l … H5);
+ nrewrite > (eqw16_to_eq … (andb_true_true_r … H6));
+ nrewrite > (eqb8_to_eq … (andb_true_true_l … H6));
+ napply refl_eq.
+nqed.
+
+nlemma eq_to_eqaluRS08 : ∀alu1,alu2.alu1 = alu2 → eq_alu_RS08 alu1 alu2 = true.
+ #alu1; #alu2;
+ ncases alu1;
+ #x1; #x2; #x3; #x4; #x5; #x6; #x7; #x8;
+ ncases alu2;
+ #y1; #y2; #y3; #y4; #y5; #y6; #y7; #y8; #H;
+ nrewrite > (aluRS08_destruct_1 … H);
+ nrewrite > (aluRS08_destruct_2 … H);
+ nrewrite > (aluRS08_destruct_3 … H);
+ nrewrite > (aluRS08_destruct_4 … H);
+ nrewrite > (aluRS08_destruct_5 … H);
+ nrewrite > (aluRS08_destruct_6 … H);
+ nrewrite > (aluRS08_destruct_7 … H);
+ nrewrite > (aluRS08_destruct_8 … H);
+ nchange with (
+  ((eq_b8 y1 y1) ⊗ (eq_w16 y2 y2) ⊗
+   (eq_w16 y3 y3) ⊗ (eq_w16 y4 y4) ⊗
+   (eq_b8 y5 y5) ⊗ (eq_b8 y6 y6) ⊗
+   (eq_bool y7 y7) ⊗ (eq_bool y8 y8)) = true);
+ nrewrite > (eq_to_eqb8 y1 y1 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y2 y2 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y3 y3 (refl_eq …));
+ nrewrite > (eq_to_eqw16 y4 y4 (refl_eq …));
+ nrewrite > (eq_to_eqb8 y5 y5 (refl_eq …));
+ nrewrite > (eq_to_eqb8 y6 y6 (refl_eq …));
+ nrewrite > (eq_to_eqbool y7 y7 (refl_eq …));
+ nrewrite > (eq_to_eqbool y8 y8 (refl_eq …));
+ napply refl_eq.
+nqed.
+
+nlemma symmetric_eqclk : ∀mcu,clk1,clk2.eq_clk mcu clk1 clk2 = eq_clk mcu clk2 clk1.
+ #mcu; #clk1; #clk2;
+ ncases clk1;
+ ncases clk2;
+ ##[ ##1: napply refl_eq
+ ##| ##2,3: nnormalize; #H; napply refl_eq
+ ##| ##4: #p1; ncases p1; #x1; #x2; #x3; #x4; #x5;
+          #p2; ncases p2; #y1; #y2; #y3; #y4; #y5;
+          nchange with (
+           ((eq_b8 y1 x1) ⊗ (eq_anyop ? y2 x2) ⊗ (eq_im y3 x3) ⊗ (eq_b8 y4 x4) ⊗ (eq_w16 y5 x5)) =
+           ((eq_b8 x1 y1) ⊗ (eq_anyop ? x2 y2) ⊗ (eq_im x3 y3) ⊗ (eq_b8 x4 y4) ⊗ (eq_w16 x5 y5)));
+          nrewrite > (symmetric_eqb8 x1 y1);
+          nrewrite > (symmetric_eqanyop ? x2 y2);
+          nrewrite > (symmetric_eqim x3 y3);
+          nrewrite > (symmetric_eqb8 x4 y4);
+          nrewrite > (symmetric_eqw16 x5 y5);
+          napply refl_eq
+ ##]
+nqed.
+
+nlemma eqclk_to_eq : ∀mcu,clk1,clk2.eq_clk mcu clk1 clk2 = true → clk1 = clk2.
+ #mcu; #clk1; #clk2;
+ ncases clk1;
+ ncases clk2;
+ ##[ ##1: nnormalize; #H; napply refl_eq
+ ##| ##2,3: nnormalize; #H; #H1; napply (bool_destruct … H1)
+ ##| ##4: #p1; ncases p1; #x1; #x2; #x3; #x4; #x5;
+          #p2; ncases p2; #y1; #y2; #y3; #y4; #y5; #H;
+          nchange in H:(%) with (
+           ((eq_b8 y1 x1) ⊗ (eq_anyop ? y2 x2) ⊗ (eq_im y3 x3) ⊗ (eq_b8 y4 x4) ⊗ (eq_w16 y5 x5)) = true);
+           nrewrite > (eqw16_to_eq … (andb_true_true_r … H));
+           nletin H1 ≝ (andb_true_true_l … H);
+           nrewrite > (eqb8_to_eq … (andb_true_true_r … H1));
+           nletin H2 ≝ (andb_true_true_l … H1);
+           nrewrite > (eqim_to_eq … (andb_true_true_r … H2));
+           nletin H3 ≝ (andb_true_true_l … H2);
+           nrewrite > (eqanyop_to_eq … (andb_true_true_r … H3));
+           nrewrite > (eqb8_to_eq … (andb_true_true_l … H3));
+           napply refl_eq
+ ##]
+nqed.
+
+nlemma eq_to_eqclk : ∀mcu,clk1,clk2.clk1 = clk2 → eq_clk mcu clk1 clk2 = true.
+ #mcu; #clk1; #clk2;
+ ncases clk1;
+ ncases clk2;
+ ##[ ##1: nnormalize; #H; napply refl_eq
+ ##| ##2: nnormalize; #p; #H1; nelim (option_destruct_none_some ? p … H1)
+ ##| ##3: nnormalize; #p; #H1; nelim (option_destruct_some_none ? p … H1)
+ ##| ##4: #p1; ncases p1; #x1; #x2; #x3; #x4; #x5;
+          #p2; ncases p2; #y1; #y2; #y3; #y4; #y5; #H;
+          nrewrite > (quintuple_destruct_1 … (option_destruct_some_some … H));
+          nrewrite > (quintuple_destruct_2 … (option_destruct_some_some … H));
+          nrewrite > (quintuple_destruct_3 … (option_destruct_some_some … H));
+          nrewrite > (quintuple_destruct_4 … (option_destruct_some_some … H));
+          nrewrite > (quintuple_destruct_5 … (option_destruct_some_some … H));
+          nchange with (
+           ((eq_b8 x1 x1) ⊗ (eq_anyop ? x2 x2) ⊗ (eq_im x3 x3) ⊗ (eq_b8 x4 x4) ⊗ (eq_w16 x5 x5)) = true);
+          nrewrite > (eq_to_eqb8 x1 x1 (refl_eq …));
+          nrewrite > (eq_to_eqanyop mcu x2 x2 (refl_eq ? x2));
+          nrewrite > (eq_to_eqim x3 x3 (refl_eq …));
+          nrewrite > (eq_to_eqb8 x4 x4 (refl_eq …));
+          nrewrite > (eq_to_eqw16 x5 x5 (refl_eq …));
+          nnormalize;
+          napply refl_eq
+ ##]
+nqed.
+
+nlemma symmetric_forallmemoryranged :
+∀t.∀chk1,chk2:aux_chk_type t.∀mem1,mem2:aux_mem_type t.∀addrl.
+ forall_memory_ranged t chk1 chk2 mem1 mem2 addrl =
+ forall_memory_ranged t chk2 chk1 mem2 mem1 addrl.
+ #t; #chk1; #chk2; #mem1; #mem2; #addrl;
+ napply (list_ind word16 … addrl);
+ ##[ ##1: nnormalize; napply refl_eq
+ ##| ##2: #a; #l; #H;
+          nchange with (
+           ((eq_option byte8 (mem_read t mem1 chk1 a)
+                            (mem_read t mem2 chk2 a) eq_b8) ⊗
+           (forall_memory_ranged t chk1 chk2 mem1 mem2 l)) =
+           ((eq_option byte8 (mem_read t mem2 chk2 a)
+                            (mem_read t mem1 chk1 a) eq_b8) ⊗
+           (forall_memory_ranged t chk2 chk1 mem2 mem1 l)));
+           nrewrite > H;
+           nrewrite > (symmetric_eqoption ? (mem_read t mem1 chk1 a) (mem_read t mem2 chk2 a) eq_b8 symmetric_eqb8);
+           napply refl_eq
+ ##]
+nqed.
+
+nlemma anystatus_destruct_1 :
+∀m,t.∀x1,x2,x3,x4,y1,y2,y3,y4.
+ mk_any_status m t x1 x2 x3 x4 = mk_any_status m t y1 y2 y3 y4 →
+ x1 = y1.
+ #m; #t;
+ #x1; #x2; #x3; #x4;
+ #y1; #y2; #y3; #y4; #H;
+ nchange with (match mk_any_status m t y1 y2 y3 y4
+                with [ mk_any_status a _ _ _ ⇒ x1 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma anystatus_destruct_2 :
+∀m,t.∀x1,x2,x3,x4,y1,y2,y3,y4.
+ mk_any_status m t x1 x2 x3 x4 = mk_any_status m t y1 y2 y3 y4 →
+ x2 = y2.
+ #m; #t;
+ #x1; #x2; #x3; #x4;
+ #y1; #y2; #y3; #y4; #H;
+ nchange with (match mk_any_status m t y1 y2 y3 y4
+                with [ mk_any_status _ a _ _ ⇒ x2 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma anystatus_destruct_3 :
+∀m,t.∀x1,x2,x3,x4,y1,y2,y3,y4.
+ mk_any_status m t x1 x2 x3 x4 = mk_any_status m t y1 y2 y3 y4 →
+ x3 = y3.
+ #m; #t;
+ #x1; #x2; #x3; #x4;
+ #y1; #y2; #y3; #y4; #H;
+ nchange with (match mk_any_status m t y1 y2 y3 y4
+                with [ mk_any_status _ _ a _ ⇒ x3 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma anystatus_destruct_4 :
+∀m,t.∀x1,x2,x3,x4,y1,y2,y3,y4.
+ mk_any_status m t x1 x2 x3 x4 = mk_any_status m t y1 y2 y3 y4 →
+ x4 = y4.
+ #m; #t;
+ #x1; #x2; #x3; #x4;
+ #y1; #y2; #y3; #y4; #H;
+ nchange with (match mk_any_status m t y1 y2 y3 y4
+                with [ mk_any_status _ _ _ a ⇒ x4 = a ]);
+ nrewrite < H;
+ nnormalize;
+ napply refl_eq.
+nqed.
+
+nlemma symmetric_eqstatus :
+∀addrl:list word16.∀m:mcu_type.∀t:memory_impl.∀s1,s2:any_status m t.
+ eq_status m t s1 s2 addrl = eq_status m t s2 s1 addrl.
+ #addrl; #m;
+ ncases m; #t; #s1;
+ ##[ ##1: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4;
+          nchange with (
+           ((eq_alu_HC05 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk HC05 x4 y4)) =
+           ((eq_alu_HC05 y1 x1) ⊗ (forall_memory_ranged t y3 x3 y2 x2 addrl) ⊗ (eq_clk HC05 y4 x4)));
+           nrewrite > (symmetric_eqaluHC05 x1 y1)
+ ##| ##2,3: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4;
+          nchange with (
+           ((eq_alu_HC08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) =
+           ((eq_alu_HC08 y1 x1) ⊗ (forall_memory_ranged t y3 x3 y2 x2 addrl) ⊗ (eq_clk ? y4 x4)));
+           nrewrite > (symmetric_eqaluHC08 x1 y1)
+ ##| ##4: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4;
+          nchange with (
+           ((eq_alu_RS08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk RS08 x4 y4)) =
+           ((eq_alu_RS08 y1 x1) ⊗ (forall_memory_ranged t y3 x3 y2 x2 addrl) ⊗ (eq_clk RS08 y4 x4)));
+           nrewrite > (symmetric_eqaluRS08 x1 y1)
+ ##]
+ nrewrite > (symmetric_forallmemoryranged t x3 y3 x2 y2 addrl);
+ nrewrite > (symmetric_eqclk ? x4 y4);
+ napply refl_eq.
+nqed.
+
+nlemma eqstatus_to_eq :
+∀addrl:list word16.∀m:mcu_type.∀t:memory_impl.∀s1,s2:any_status m t.
+ (eq_status m t s1 s2 addrl = true) →
+  ((alu m t s1 = alu m t s2) ∧
+   (clk_desc m t s1 = clk_desc m t s2) ∧
+   ((forall_memory_ranged t (chk_desc m t s1) (chk_desc m t s2)
+                            (mem_desc m t s1) (mem_desc m t s2) addrl) = true)).
+ #addrl; #m; #t;
+ ncases m; #s1;
+ ##[ ##1: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange in H:(%) with (
+           ((eq_alu_HC05 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+           nrewrite > (eqaluHC05_to_eq … (andb_true_true_l … (andb_true_true_l … H)))
+ ##| ##2,3: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange in H:(%) with (
+           ((eq_alu_HC08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+           nrewrite > (eqaluHC08_to_eq … (andb_true_true_l … (andb_true_true_l … H)))
+ ##| ##4: ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange in H:(%) with (
+           ((eq_alu_RS08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+           nrewrite > (eqaluRS08_to_eq … (andb_true_true_l … (andb_true_true_l … H)))
+ ##]
+ nchange with ((y1 = y1) ∧ (x4 = y4) ∧ (forall_memory_ranged t x3 y3 x2 y2 addrl = true));
+ nrewrite > (andb_true_true_r … (andb_true_true_l … H));
+ nrewrite > (eqclk_to_eq … (andb_true_true_r … H));
+ napply (conj … (conj … (refl_eq ? y1) (refl_eq ? y4)) (refl_eq ? true)).
+nqed.
+
+nlemma eq_to_eqstatus_strong :
+∀addrl:list word16.∀m:mcu_type.∀t:memory_impl.∀s1,s2:any_status m t.
+ s1 = s2 → (eq_status m t s1 s2 addrl = true).
+ #addrl; #m; #t;
+ ncases m;
+ ##[ ##1: #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange with (
+           ((eq_alu_HC05 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nrewrite > (anystatus_destruct_1 … H);
+          nrewrite > (eq_to_eqaluHC05 y1 y1 (refl_eq …))
+ ##| ##2,3:  #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange with (
+           ((eq_alu_HC08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nrewrite > (anystatus_destruct_1 … H);
+          nrewrite > (eq_to_eqaluHC08 y1 y1 (refl_eq …))
+ ##| ##4: #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H;
+          nchange with (
+           ((eq_alu_RS08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nrewrite > (anystatus_destruct_1 … H);
+          nrewrite > (eq_to_eqaluRS08 y1 y1 (refl_eq …))
+ ##]
+ nrewrite > (anystatus_destruct_2 … H);
+ nrewrite > (anystatus_destruct_3 … H);
+ nrewrite > (anystatus_destruct_4 … H);
+ nrewrite > (eq_to_eqclk ? y4 y4 (refl_eq …));
+ nchange with ((forall_memory_ranged … ⊗ true) =true);
+ nrewrite > (symmetric_andbool (forall_memory_ranged t y3 y3 y2 y2 addrl) true);
+ nchange with ((forall_memory_ranged t y3 y3 y2 y2 ?) = true);
+ napply (list_ind word16 … addrl);
+ ##[ ##1,3,5,7: nnormalize; napply refl_eq
+ ##| ##2,4,6,8: #a; #l'; #H;
+          nchange with (
+          ((eq_option byte8 (mem_read t y2 y3 a)
+                            (mem_read t y2 y3 a) eq_b8) ⊗
+           (forall_memory_ranged t y3 y3 y2 y2 l')) = true);
+          nrewrite > H;
+          nrewrite > (eq_to_eqoption ? (mem_read t y2 y3 a) (mem_read t y2 y3 a) eq_b8 eq_to_eqb8 (refl_eq …));
+          nnormalize;
+          napply refl_eq
+ ##]
+nqed.
+
+nlemma eq_to_eqstatus_weak :
+∀addrl:list word16.∀m:mcu_type.∀t:memory_impl.∀s1,s2:any_status m t.
+ (alu m t s1 = alu m t s2) →
+ (clk_desc m t s1 = clk_desc m t s2) →
+ ((forall_memory_ranged t (chk_desc m t s1) (chk_desc m t s2)
+                            (mem_desc m t s1) (mem_desc m t s2) addrl) = true) →
+ (eq_status m t s1 s2 addrl = true).
+ #addrl; #m; #t;
+ ncases m;
+ ##[ ##1: #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H; #H1; #H2;
+          nchange with (((eq_alu_HC05 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nchange in H:(%) with (x1 = y1);
+          nrewrite > H; 
+          nrewrite > (eq_to_eqaluHC05 y1 y1 (refl_eq …))
+ ##| ##2,3: #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H; #H1; #H2;
+          nchange with (((eq_alu_HC08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nchange in H:(%) with (x1 = y1);
+          nrewrite > H; 
+          nrewrite > (eq_to_eqaluHC08 y1 y1 (refl_eq …))
+ ##| ##4: #s1; ncases s1; #x1; #x2; #x3; #x4;
+          #s2; ncases s2; #y1; #y2; #y3; #y4; #H; #H1; #H2;
+          nchange with (((eq_alu_RS08 x1 y1) ⊗ (forall_memory_ranged t x3 y3 x2 y2 addrl) ⊗ (eq_clk ? x4 y4)) = true);
+          nchange in H:(%) with (x1 = y1);
+          nrewrite > H; 
+          nrewrite > (eq_to_eqaluRS08 y1 y1 (refl_eq …))
+ ##]
+ nchange in H2:(%) with (forall_memory_ranged t x3 y3 x2 y2 addrl = true);
+ nrewrite > H2;
+ nchange in H1:(%) with (x4 = y4);
+ nrewrite > H1;
+ nrewrite > (eq_to_eqclk ? y4 y4 (refl_eq …));
+ nnormalize;
+ napply refl_eq.
+nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests.ma
new file mode 100755 (executable)
index 0000000..4653cbf
--- /dev/null
@@ -0,0 +1,887 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                   *)
+(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "freescale_tests/medium_tests_tools.ma".
+include "common/list_utility.ma".
+include "common/nat_to_num.ma".
+(* ************************ *)
+(* HCS08GB60 String Reverse *)
+(* ************************ *)
+
+(* versione ridotta, in cui non si riazzerano gli elementi di counters *)
+ndefinition dTest_HCS08_sReverse_source : word16 → (list byte8) ≝
+λelems:word16.
+let m ≝ HCS08 in source_to_byte8 m (
+(* BEFORE: A=0x00 H:X=0x0D4B SP=0x0D4A PC=0x18E0 Z=true *)
+
+(* static unsigned char dati[3072]={...};
+
+   void swap(unsigned char *a, unsigned char *b)
+    { unsigned char tmp=*a; *a=*b; *b=tmp; return; } *)
+
+(* [0x18C8]    allineamento *) (compile m ? NOP maINH I) @
+
+(* argomenti: HX e [0x0D49-A], passaggio ibrido reg, stack *)
+(* [0x18C9] PSHX      *) (compile m ? PSHX maINH I) @
+(* [0x18CA] PSHH      *) (compile m ? PSHH maINH I) @
+(* [0x18CB] LDHX 5,SP *) (compile m ? LDHX (maSP1 〈x0,x5〉) I) @
+(* [0x18CE] LDA ,X    *) (compile m ? LDA maIX0 I) @
+(* [0x18CF] LDHX 1,SP *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x18D2] PSHA      *) (compile m ? PSHA maINH I) @
+(* [0x18D3] LDA ,X    *) (compile m ? LDA maIX0 I) @
+(* [0x18D4] LDHX 6,SP *) (compile m ? LDHX (maSP1 〈x0,x6〉) I) @
+(* [0x18D7] STA ,X    *) (compile m ? STA maIX0 I) @
+(* [0x18D8] LDHX 2,SP *) (compile m ? LDHX (maSP1 〈x0,x2〉) I) @
+(* [0x18DB] PULA      *) (compile m ? PULA maINH I) @
+(* [0x18DC] STA ,X    *) (compile m ? STA maIX0 I) @
+(* [0x18DD] AIS #2    *) (compile m ? AIS (maIMM1 〈x0,x2〉) I) @
+(* [0x18DF] RTS       *) (compile m ? RTS maINH I) @
+
+(* void main(void)
+   {
+   unsigned int pos=0,limit=0;
+   for(limit=3072;pos<(limit/2);pos++)
+    { swap(&dati[pos],&dati[limit-pos-1]); } *)
+
+(* [0x18E0] LDHX #elems     *) (compile m ? LDHX (maIMM2 elems) I) @
+(* [0x18E3] STHX 4,SP       *) (compile m ? STHX (maSP1 〈x0,x4〉) I) @
+(* [0x18E6] BRA *+52 ; 191A *) (compile m ? BRA (maIMM1 〈x3,x2〉) I) @
+(* [0x18E8] TSX             *) (compile m ? TSX maINH I) @
+(* [0x18E9] LDA 2,X         *) (compile m ? LDA (maIX1 〈x0,x2〉) I) @
+(* [0x18EB] ADD #0x00       *) (compile m ? ADD (maIMM1 〈x0,x0〉) I) @
+(* [0x18ED] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x18EE] LDA 1,X         *) (compile m ? LDA (maIX1 〈x0,x1〉) I) @
+(* [0x18F0] ADC #0x01       *) (compile m ? ADC (maIMM1 〈x0,x1〉) I) @
+(* [0x18F2] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x18F3] LDA 4,X         *) (compile m ? LDA (maIX1 〈x0,x4〉) I) @
+(* [0x18F5] SUB 2,X         *) (compile m ? SUB (maIX1 〈x0,x2〉) I) @
+(* [0x18F7] STA ,X          *) (compile m ? STA maIX0 I) @
+(* [0x18F8] LDA 3,X         *) (compile m ? LDA (maIX1 〈x0,x3〉) I) @
+(* [0x18FA] SBC 1,X         *) (compile m ? SBC (maIX1 〈x0,x1〉) I) @
+(* [0x18FC] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x18FD] LDX ,X          *) (compile m ? LDX maIX0 I) @
+(* [0x18FE] PULH            *) (compile m ? PULH maINH I) @
+(* [0x18FF] AIX #-1         *) (compile m ? AIX (maIMM1 〈xF,xF〉) I) @
+(* [0x1901] TXA             *) (compile m ? TXA maINH I) @
+(* [0x1902] ADD #0x00       *) (compile m ? ADD (maIMM1 〈x0,x0〉) I) @
+(* [0x1904] PSHH            *) (compile m ? PSHH maINH I) @
+(* [0x1905] TSX             *) (compile m ? TSX maINH I) @
+(* [0x1906] STA 3,X         *) (compile m ? STA (maIX1 〈x0,x3〉) I) @
+(* [0x1908] PULA            *) (compile m ? PULA maINH I) @
+(* [0x1909] ADC #0x01       *) (compile m ? ADC (maIMM1 〈x0,x1〉) I) @
+(* [0x190B] LDX 3,X         *) (compile m ? LDX (maIX1 〈x0,x3〉) I) @
+(* [0x190D] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x190E] PULH            *) (compile m ? PULH maINH I) @
+(* [0x190F] BSR *-70 ; 18C9 *) (compile m ? BSR (maIMM1 〈xB,x8〉) I) @
+(* [0x1911] AIS #2          *) (compile m ? AIS (maIMM1 〈x0,x2〉) I) @
+(* [0x1913] TSX             *) (compile m ? TSX maINH I) @
+(* [0x1914] INC 2,X         *) (compile m ? INC (maIX1 〈x0,x2〉) I) @
+(* [0x1916] BNE *+4 ; 191A  *) (compile m ? BNE (maIMM1 〈x0,x2〉) I) @
+(* [0x1918] INC 1,X         *) (compile m ? INC (maIX1 〈x0,x1〉) I) @
+(* [0x191A] TSX             *) (compile m ? TSX maINH I) @
+(* [0x191B] LDA 3,X         *) (compile m ? LDA (maIX1 〈x0,x3〉) I) @
+(* [0x191D] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x191E] PULH            *) (compile m ? PULH maINH I) @
+(* [0x191F] LSRA            *) (compile m ? LSR maINHA I) @
+(* [0x1920] TSX             *) (compile m ? TSX maINH I) @
+(* [0x1921] LDX 4,X         *) (compile m ? LDX (maIX1 〈x0,x4〉) I) @
+(* [0x1923] RORX            *) (compile m ? ROR maINHX I) @
+(* [0x1924] PSHA            *) (compile m ? PSHA maINH I) @
+(* [0x1925] PULH            *) (compile m ? PULH maINH I) @
+(* [0x1926] CPHX 2,SP       *) (compile m ? CPHX (maSP1 〈x0,x2〉) I) @
+(* [0x1929] BHI *-65 ; 18E8 *) (compile m ? BHI (maIMM1 〈xB,xD〉) I)
+
+(* [0x192B] !FINE!
+            attraverso simulazione in CodeWarrior si puo' enunciare che dopo
+            42+79*n+5*(n>>9) ci sara' il reverse di n byte (PARI) e
+            H:X=n/2 *)
+ ).
+
+(* creazione del processore+caricamento+impostazione registri *)
+ndefinition dTest_HCS08_sReverse_status ≝
+λt:memory_impl.
+λA_op:byte8.
+λHX_op:word16.
+λelems:word16.
+λdata:list byte8.
+ set_acc_8_low_reg HCS08 t (* A<-A_op *)
+ (set_z_flag HCS08 t (* Z<-true *)
+  (setweak_sp_reg HCS08 t (* SP<-0x0D4A *)
+   (setweak_indX_16_reg HCS08 t (* H:X<-HX_op *)
+    (set_pc_reg HCS08 t (* PC<-0x18E0 *)
+     (start_of_mcu_version_HCS08 MC9S08GB60 t
+      (load_from_source_at t (* carica data in RAM:dTest_HCS08_RAM *)
+       (load_from_source_at t (zero_memory t) (* carica source in ROM:dTest_HCS08_prog *)
+         (dTest_HCS08_sReverse_source elems) dTest_HCS08_prog)
+        data dTest_HCS08_RAM)
+      (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08GB60) t)
+      (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+      false false false false false false) (* non deterministici tutti a 0 *)
+     (mk_word16 (mk_byte8 x1 x8) (mk_byte8 xE x0)))
+    HX_op)
+   (mk_word16 (mk_byte8 x0 xD) (mk_byte8 x4 xA)))
+  true)
+ A_op.
+
+(* parametrizzazione dell'enunciato del teorema *)
+(* primo sbozzo: confronto esecuzione con hexdump... *)
+nlemma dTest_HCS08_sReverse_dump_aux ≝
+λt:memory_impl.λstring:list byte8.
+ (* 1) la stringa deve avere una lunghezza ∈ [0,3072] *)
+ (byte8_bounded_strlen string 〈〈x0,xC〉:〈x0,x0〉〉) ∧
+ (* 2) la stringa deve avere lunghezza pari *)
+ ((and_b8 (w16l (byte8_strlen string)) 〈x0,x1〉) = 〈x0,x0〉) ∧
+ (* 3) match di esecuzione su tempo in forma di tempo esatto *)
+ (match execute HCS08 t
+  (* parametri IN: t,H:X,strlen(string),string *)
+  (TickOK ? (dTest_HCS08_sReverse_status t 〈x0,x0〉 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen string) string))
+  (* tempo di esecuzione 42+79*n+5*(n>>9) *)
+  (42+(79*(len_list ? string))+(5*((len_list ? string)/512))) with
+   [ TickERR s _ ⇒ None ?
+   (* azzeramento tutta RAM tranne dati *)
+   | TickSUSP s _ ⇒ None ? 
+   | TickOK s ⇒ Some ? (byte8_hexdump t (mem_desc HCS08 t s) dTest_HCS08_RAM (len_list ? string))
+   ] =
+  Some ? (reverse_list ? string)).
+
+(* confronto esecuzione con hexdump... *)
+(*
+lemma dTest_HCS08_sReverse_dump :
+ dTest_HCS08_sReverse_dump_aux MEM_TREE dTest_random_32.
+ unfold dTest_HCS08_sReverse_dump_aux;
+ split;
+ [ split; [ normalize in ⊢ (%); autobatch ] reflexivity ]
+ reflexivity.
+qed.
+*)
+
+(* parametrizzazione dell'enunciato del teorema *)
+(* dimostrazione senza svolgimento degli stati *)
+nlemma dTest_HCS08_sReverse_aux ≝
+λt:memory_impl.λstring:list byte8.
+ (* 1) la stringa deve avere una lunghezza ∈ [0,3072] *)
+ (byte8_bounded_strlen string 〈〈x0,xC〉:〈x0,x0〉〉) ∧
+ (* 2) la stringa deve avere lunghezza pari *)
+ ((and_b8 (w16l (byte8_strlen string)) 〈x0,x1〉) = 〈x0,x0〉) ∧
+ (* 3) match di esecuzione su tempo in forma di tempo esatto *)
+ (match execute HCS08 t
+  (* parametri IN: t,H:X,strlen(string),string *)
+  (TickOK ? (dTest_HCS08_sReverse_status t 〈x0,x0〉 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen string) string))
+  (* tempo di esecuzione 42+79*n+5*(n>>9) *)
+  (42+(79*(len_list ? string))+(5*((len_list ? string)/512))) with
+   [ TickERR s _ ⇒ None ?
+   (* azzeramento tutta RAM tranne dati *)
+   | TickSUSP s _ ⇒ None ? 
+   | TickOK s ⇒ Some ? (set_mem_desc HCS08 t s (load_from_source_at t (mem_desc HCS08 t s) dTest_zeros 〈〈x0,xD〉:〈x0,x0〉〉))
+   ] =
+  Some ? (set_pc_reg HCS08 t
+   (dTest_HCS08_sReverse_status t (fst … (shr_b8 (w16h (byte8_strlen string)))) (fst … (shr_w16 (byte8_strlen string))) (byte8_strlen string) (reverse_list ? string)) 
+   (mk_word16 (mk_byte8 x1 x9) (mk_byte8 x2 xB)))).
+
+(*
+lemma dTest_HCS08_sReverse :
+ dTest_HCS08_sReverse_aux MEM_TREE dTest_random_32.
+ unfold dTest_HCS08_sReverse_aux;
+ split;
+ [ split; [ normalize in ⊢ (%); autobatch ] reflexivity ]
+
+ rewrite > (breakpoint HCS08 MEM_TREE (TickOK ? (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉   (byte8_strlen dTest_random_32) dTest_random_32)) 3 (39+79*byte8_strlen dTest_random_32+5*(byte8_strlen dTest_random_32/512))) in ⊢ (? ? match % in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?);
+ letin status0 ≝ (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen dTest_random_32) dTest_random_32);
+ change in ⊢ (? ? match ? ? ? (? ? ? % ?) ? in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?) with
+  (TickOK ? status0); 
+ rewrite > (execute_HCS08_LDHX_maIMM2 MEM_TREE status0 〈x0,x0〉 〈x2,x0〉) in ⊢ (? ? match ? ? ? % ? in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?);
+ [ 2,3,4,5: reflexivity; ]
+
+ letin status1 ≝ (set_pc_reg HCS08 MEM_TREE (setweak_v_flag HCS08 MEM_TREE (setweak_n_flag HCS08 MEM_TREE (set_z_flag HCS08 MEM_TREE (set_alu HCS08 MEM_TREE (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen dTest_random_32) dTest_random_32) (set_indX_16_reg_HC08 (alu HCS08 MEM_TREE (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen dTest_random_32) dTest_random_32)) 〈〈x0,x0〉:〈x2,x0〉〉)) (eq_w16 〈〈x0,x0〉:〈x2,x0〉〉 〈〈x0,x0〉:〈x0,x0〉〉)) (MSB_w16 〈〈x0,x0〉:〈x2,x0〉〉)) false) (filtered_plus_w16 HCS08 MEM_TREE (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen dTest_random_32) dTest_random_32) (get_pc_reg HCS08 MEM_TREE (dTest_HCS08_sReverse_status MEM_TREE 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen dTest_random_32) dTest_random_32)) 3));
+ change in ⊢ (? ? match ? ? ? % ? in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?) with (TickOK ? status1);
+
+ rewrite > (breakpoint HCS08 MEM_TREE (TickOK ? status1) 5 (34+79*byte8_strlen dTest_random_32+5*(byte8_strlen dTest_random_32/512))) in ⊢ (? ? match % in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?);
+ change in ⊢ (? ? match ? ? ? (? ? ? % ?) ? in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?) with (TickOK ? status1);
+ rewrite > (execute_HCS08_STHX_maSP1 status1 〈x0,x4〉)
+  in ⊢ (? ? match ? ? ? % ? in tick_result return ? with [TickERR⇒?|TickSUSP⇒?|TickOK⇒?] ?);
+ [ 2,3,4,5,6,7: reflexivity; ]
+
+ elim daemon.
+
+qed.
+*)
+
+ndefinition sReverseCalc ≝
+λstring:list byte8.
+ match execute HCS08 MEM_TREE
+  (TickOK ? (dTest_HCS08_sReverse_status MEM_TREE 〈x0,x0〉 〈〈x0,xD〉:〈x4,xB〉〉 (byte8_strlen string) string))
+  (42+(79*(len_list ? string))+(5*((len_list ? string)/512))) with
+   [ TickERR s _ ⇒ None ?
+   | TickSUSP s _ ⇒ None ? 
+   | TickOK s ⇒ Some ? (set_mem_desc HCS08 MEM_TREE s (load_from_source_at MEM_TREE (mem_desc HCS08 MEM_TREE s) dTest_zeros 〈〈x0,xD〉:〈x0,x0〉〉))
+   ]. 
+
+ndefinition sReverseNoCalc ≝
+λstring:list byte8.
+ Some ? (set_pc_reg HCS08 MEM_TREE
+   (dTest_HCS08_sReverse_status MEM_TREE (fst … (shr_b8 (w16h (byte8_strlen string))))
+                                         (fst … (shr_w16 (byte8_strlen string)))
+                                         (byte8_strlen string) (reverse_list ? string)) 
+   (mk_word16 (mk_byte8 x1 x9) (mk_byte8 x2 xB))).
+
+ndefinition sReverseCalc32   ≝ sReverseCalc dTest_random_32.
+ndefinition sReverseCalc64   ≝ sReverseCalc dTest_random_64.
+ndefinition sReverseCalc128  ≝ sReverseCalc dTest_random_128.
+ndefinition sReverseCalc256  ≝ sReverseCalc dTest_random_256.
+ndefinition sReverseCalc512  ≝ sReverseCalc dTest_random_512.
+ndefinition sReverseCalc1024 ≝ sReverseCalc dTest_random_1024.
+ndefinition sReverseCalc2048 ≝ sReverseCalc dTest_random_2048.
+ndefinition sReverseCalc3072 ≝ sReverseCalc dTest_random_3072.
+
+ndefinition sReverseNoCalc32   ≝ sReverseNoCalc dTest_random_32.
+ndefinition sReverseNoCalc64   ≝ sReverseNoCalc dTest_random_64.
+ndefinition sReverseNoCalc128  ≝ sReverseNoCalc dTest_random_128.
+ndefinition sReverseNoCalc256  ≝ sReverseNoCalc dTest_random_256.
+ndefinition sReverseNoCalc512  ≝ sReverseNoCalc dTest_random_512.
+ndefinition sReverseNoCalc1024 ≝ sReverseNoCalc dTest_random_1024.
+ndefinition sReverseNoCalc2048 ≝ sReverseNoCalc dTest_random_2048.
+ndefinition sReverseNoCalc3072 ≝ sReverseNoCalc dTest_random_3072.
+
+(* *********************** *)
+(* HCS08GB60 Counting Sort *)
+(* *********************** *)
+
+(* versione ridotta, in cui non si riazzerano gli elementi di counters *)
+ndefinition dTest_HCS08_cSort_source : word16 → (list byte8) ≝
+λelems:word16.
+let m ≝ HCS08 in source_to_byte8 m (
+(* BEFORE: A=0x00 H:X=0x0F4C SP=0x0F4B PC=0x18C8 Z=true *)
+
+(* /* IPOTESI: INIT VARIABILI+ARRAY GIA' ESEGUITO */
+   static unsigned int counters[256]={ campitura di 0 };
+   static unsigned char dati[3072]={ dati random };
+
+   void CountingSort(void)
+    {
+    unsigned int index=0,position=0; *)
+
+(* /* TESI: CODICE DA ESEGUIRE
+
+    /* calcolo del # ripetizioni degli elementi byte */
+    for(;index<3072;index++)
+     { counters[dati[index]]++; } *)
+
+(* [0x18C8] BRA *+31;18E7 *) (compile m ? BRA (maIMM1 〈x1,xD〉) I) @
+(* [0x18CA] LDHX 1,SP     *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x18CD] LDA 256,X     *) (compile m ? LDA (maIX2 〈〈x0,x1〉:〈x0,x0〉〉) I) @
+(* [0x18D0] LSLA          *) (compile m ? ASL maINHA I) @
+(* [0x18D1] CLRX          *) (compile m ? CLR maINHX I) @
+(* [0x18D2] ROLX          *) (compile m ? ROL maINHX I) @
+(* [0x18D3] ADD #0x00     *) (compile m ? ADD (maIMM1 〈x0,x0〉) I) @
+(* [0x18D5] PSHA          *) (compile m ? PSHA maINH I) @
+(* [0x18D6] TXA           *) (compile m ? TXA maINH I) @
+(* [0x18D7] ADC #0x0D     *) (compile m ? ADC (maIMM1 〈x0,xD〉) I) @
+(* [0x18D9] PSHA          *) (compile m ? PSHA maINH I) @
+(* [0x18DA] PULH          *) (compile m ? PULH maINH I) @
+(* [0x18DB] PULX          *) (compile m ? PULX maINH I) @
+(* [0x18DC] INC 1,X       *) (compile m ? INC (maIX1 〈x0,x1〉) I) @
+(* [0x18DE] BNE *+3       *) (compile m ? BNE (maIMM1 〈x0,x1〉) I) @
+(* [0x18E0] INC ,X        *) (compile m ? INC maIX0 I) @
+(* [0x18E1] TSX           *) (compile m ? TSX maINH I) @
+(* [0x18E2] INC 1,X       *) (compile m ? INC (maIX1 〈x0,x1〉) I) @
+(* [0x18E4] BNE *+3       *) (compile m ? BNE (maIMM1 〈x0,x1〉) I) @
+(* [0x18E6] INC ,X        *) (compile m ? INC maIX0 I) @
+(* [0x18E7] LDHX 1,SP     *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x18EA] CPHX #elems   *) (compile m ? CPHX (maIMM2 elems) I) @ (* dimensione dei dati al massimo 0x0C00 *)
+(* [0x18ED] BCS *-35;18CA *) (compile m ? BCS (maIMM1 〈xD,xB〉) I) @
+
+(* /* sovrascrittura di dati per produrre la versione ordinata */
+   for(index=0;index<256;index++)
+    {
+    while(counters[index]--)
+     { dati[position++]=index; }
+    } *)
+
+(* [0x18EF] TSX          *) (compile m ? TSX maINH I) @
+(* [0x18F0] CLR 1,X      *) (compile m ? CLR (maIX1 〈x0,x1〉) I) @
+(* [0x18F2] CLR ,X       *) (compile m ? CLR maIX0 I) @
+(* [0x18F3] BRA *+16     *) (compile m ? BRA (maIMM1 〈x0,xE〉) I) @
+(* [0x18F5] TSX          *) (compile m ? TSX maINH I) @
+(* [0x18F6] LDA 1,X      *) (compile m ? LDA (maIX1 〈x0,x1〉) I) @
+(* [0x18F8] LDHX 3,SP    *) (compile m ? LDHX (maSP1 〈x0,x3〉) I) @
+(* [0x18FB] STA 256,X    *) (compile m ? STA (maIX2 〈〈x0,x1〉:〈x0,x0〉〉) I) @
+(* [0x18FE] AIX #1       *) (compile m ? AIX (maIMM1 〈x0,x1〉) I) @
+(* [0x1900] STHX 3,SP    *) (compile m ? STHX (maSP1 〈x0,x3〉) I) @
+(* [0x1903] TSX          *) (compile m ? TSX maINH I) @
+(* [0x1904] LDX 1,X      *) (compile m ? LDX (maIX1 〈x0,x1〉) I) @
+(* [0x1906] LSLX         *) (compile m ? ASL maINHX I) @
+(* [0x1907] LDA 1,SP     *) (compile m ? LDA (maSP1 〈x0,x1〉) I) @
+(* [0x190A] ROLA         *) (compile m ? ROL maINHA I) @
+(* [0x190B] PSHA         *) (compile m ? PSHA maINH I) @
+(* [0x190C] PULH         *) (compile m ? PULH maINH I) @
+(* [0x190D] PSHX         *) (compile m ? PSHX maINH I) @
+(* [0x190E] LDHX 3328,X  *) (compile m ? LDHX (maIX2 〈〈x0,xD〉:〈x0,x0〉〉) I) @
+(* [0x1912] PSHX         *) (compile m ? PSHX maINH I) @
+(* [0x1913] PSHH         *) (compile m ? PSHH maINH I) @
+(* [0x1914] AIX #-1      *) (compile m ? AIX (maIMM1 〈xF,xF〉) I) @
+(* [0x1916] PSHH         *) (compile m ? PSHH maINH I) @
+(* [0x1917] PSHA         *) (compile m ? PSHA maINH I) @
+(* [0x1918] PULH         *) (compile m ? PULH maINH I) @
+(* [0x1919] PSHX         *) (compile m ? PSHX maINH I) @
+(* [0x191A] LDX 5,SP     *) (compile m ? LDX (maSP1 〈x0,x5〉) I) @
+(* [0x191D] PULA         *) (compile m ? PULA maINH I) @
+(* [0x191E] STA 3329,X   *) (compile m ? STA (maIX2 〈〈x0,xD〉:〈x0,x1〉〉) I) @
+(* [0x1921] PULA         *) (compile m ? PULA maINH I) @
+(* [0x1922] STA 3328,X   *) (compile m ? STA (maIX2 〈〈x0,xD〉:〈x0,x0〉〉) I) @
+(* [0x1925] PULH         *) (compile m ? PULH maINH I) @
+(* [0x1926] PULX         *) (compile m ? PULX maINH I) @
+(* [0x1927] CPHX #0x0000 *) (compile m ? CPHX (maIMM2 〈〈x0,x0〉:〈x0,x0〉〉) I) @
+(* [0x192A] PULH         *) (compile m ? PULH maINH I) @
+(* [0x192B] BNE *-54     *) (compile m ? BNE (maIMM1 〈xC,x8〉) I) @
+(* [0x192D] TSX          *) (compile m ? TSX maINH I) @
+(* [0x192E] INC 1,X      *) (compile m ? INC (maIX1 〈x0,x1〉) I) @
+(* [0x1930] BNE *+3      *) (compile m ? BNE (maIMM1 〈x0,x1〉) I) @
+(* [0x1932] INC ,X       *) (compile m ? INC maIX0 I) @
+(* [0x1933] LDHX 1,SP    *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x1936] CPHX #0x0100 *) (compile m ? CPHX (maIMM2 〈〈x0,x1〉:〈x0,x0〉〉) I) @
+(* [0x1939] BNE *-54     *) (compile m ? BNE (maIMM1 〈xC,x8〉) I) @
+(* [0x193B] STOP         *) (compile m ? STOP maINH I)
+
+(* [0x193C] !FINE!
+            attraverso simulazione in CodeWarrior si puo' enunciare che dopo
+            25700+150n si sara' entrati in stato STOP corrispondente con ordinamento
+            di n byte, A=0xFF H:X=0x0100 *)
+ ).
+
+(* creazione del processore+caricamento+impostazione registri *)
+ndefinition dTest_HCS08_cSort_status ≝
+λt:memory_impl.
+λI_op:bool.
+λA_op:byte8.
+λHX_op:word16.
+λelems:word16.
+λdata:list byte8.
+ setweak_i_flag HCS08 t (* I<-I_op *)
+  (set_acc_8_low_reg HCS08 t (* A<-A_op *)
+   (set_z_flag HCS08 t (* Z<-true *)
+    (setweak_sp_reg HCS08 t (* SP<-0x0F4B *)
+     (setweak_indX_16_reg HCS08 t (* H:X<-HX_op *)
+      (set_pc_reg HCS08 t (* PC<-dTest_HCS08_prog *)
+       (start_of_mcu_version_HCS08
+        MC9S08GB60 t
+        (load_from_source_at t (* carica data in RAM:dTest_HCS08_RAM *)
+         (load_from_source_at t (zero_memory t) (* carica source in ROM:dTest_HCS08_prog *)
+           (dTest_HCS08_cSort_source elems) dTest_HCS08_prog)
+          data dTest_HCS08_RAM)
+        (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08GB60) t)
+        (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+        false false false false false false) (* non deterministici tutti a 0 *)
+       dTest_HCS08_prog)
+      HX_op)
+     (mk_word16 (mk_byte8 x0 xF) (mk_byte8 x4 xB)))
+    true)
+   A_op)
+  I_op.
+
+(* parametrizzazione dell'enunciato del teorema parziale *)
+nlemma dTest_HCS08_cSort_aux ≝
+λt:memory_impl.λstring:list byte8.
+ (* 1) la stringa deve avere una lunghezza ∈ [0,3072] *)
+ (byte8_bounded_strlen string 〈〈x0,xC〉:〈x0,x0〉〉) ∧
+ (* 2) match di esecuzione su tempo in forma di upperbound *)
+ (match execute HCS08 t
+  (* parametri IN: t,A,H:X,strlen(string),string *)
+  (TickOK ? (dTest_HCS08_cSort_status t true 〈x0,x0〉 〈〈x0,xF〉:〈x4,xC〉〉 (byte8_strlen string) string))
+  (* tempo di esecuzione 25700+150*n *)
+  ((257*100)+(150*(len_list ? string))) with
+   [ TickERR s _ ⇒ None ?
+   (* azzeramento tutta RAM tranne dati *)
+   | TickSUSP s _ ⇒ Some ? (set_mem_desc HCS08 t s (load_from_source_at t (mem_desc HCS08 t s) dTest_zeros 〈〈x0,xD〉:〈x0,x0〉〉))
+   | TickOK s ⇒ None ?
+   ] =
+  Some ? (set_pc_reg HCS08 t
+   (dTest_HCS08_cSort_status t false 〈xF,xF〉 〈〈x0,x1〉:〈x0,x0〉〉 (byte8_strlen string) (byte8_list_ordering string)) 
+   (mk_word16 (mk_byte8 x1 x9) (mk_byte8 x3 xC)))).
+
+(* dimostrazione senza svolgimento degli stati *)
+(*
+lemma dTest_HCS08_cSort :
+ dTest_HCS08_cSort_aux MEM_TREE dTest_random_32.
+ unfold dTest_HCS08_cSort_aux;
+ split;
+ [ normalize in ⊢ (%); autobatch ]
+ reflexivity.
+qed.
+*)
+
+ndefinition cSortCalc ≝
+λstring:list byte8.
+ match execute HCS08 MEM_TREE
+  (TickOK ? (dTest_HCS08_cSort_status MEM_TREE true 〈x0,x0〉 〈〈x0,xF〉:〈x4,xC〉〉 (byte8_strlen string) string))
+  ((257*100)+(150*(len_list ? string))) with
+   [ TickERR s _ ⇒ None ?
+   | TickSUSP s _ ⇒ Some ? (set_mem_desc HCS08 MEM_TREE s (load_from_source_at MEM_TREE (mem_desc HCS08 MEM_TREE s) dTest_zeros 〈〈x0,xD〉:〈x0,x0〉〉))
+   | TickOK s ⇒ None ?
+   ].
+
+ndefinition cSortNoCalc ≝
+λstring:list byte8.
+ Some ? (set_pc_reg HCS08 MEM_TREE
+   (dTest_HCS08_cSort_status MEM_TREE false 〈xF,xF〉 〈〈x0,x1〉:〈x0,x0〉〉 (byte8_strlen string) (byte8_list_ordering string)) 
+   (mk_word16 (mk_byte8 x1 x9) (mk_byte8 x3 xC))).
+
+ndefinition cSortCalc32   ≝ cSortCalc dTest_random_32.
+ndefinition cSortCalc64   ≝ cSortCalc dTest_random_64.
+ndefinition cSortCalc128  ≝ cSortCalc dTest_random_128.
+ndefinition cSortCalc256  ≝ cSortCalc dTest_random_256.
+ndefinition cSortCalc512  ≝ cSortCalc dTest_random_512.
+ndefinition cSortCalc1024 ≝ cSortCalc dTest_random_1024.
+ndefinition cSortCalc2048 ≝ cSortCalc dTest_random_2048.
+ndefinition cSortCalc3072 ≝ cSortCalc dTest_random_3072.
+
+ndefinition cSortNoCalc32   ≝ cSortNoCalc dTest_random_32.
+ndefinition cSortNoCalc64   ≝ cSortNoCalc dTest_random_64.
+ndefinition cSortNoCalc128  ≝ cSortNoCalc dTest_random_128.
+ndefinition cSortNoCalc256  ≝ cSortNoCalc dTest_random_256.
+ndefinition cSortNoCalc512  ≝ cSortNoCalc dTest_random_512.
+ndefinition cSortNoCalc1024 ≝ cSortNoCalc dTest_random_1024.
+ndefinition cSortNoCalc2048 ≝ cSortNoCalc dTest_random_2048.
+ndefinition cSortNoCalc3072 ≝ cSortNoCalc dTest_random_3072.
+
+(* ********************** *)
+(* HCS08GB60 numeri aurei *)
+(* ********************** *)
+
+(* versione ridotta, in cui non si riazzerano gli elementi di counters *)
+ndefinition dTest_HCS08_gNum_source : word16 → (list byte8) ≝
+λelems:word16.
+let m ≝ HCS08 in source_to_byte8 m (
+(* BEFORE: A=0x00 HX=0x1A00 PC=0x18BE SP=0x016F Z=1 (I=1) *)
+
+(*
+static unsigned int result[16]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+word result[16] = 0x0100
+
+void goldenNumbers(void)
+{
+unsigned int res_pos=0,tested_num=0,divisor=0;
+unsigned long int acc=0;
+*)
+
+(* [0x18BE] AIS #-10   *) (compile m ? AIS (maIMM1 〈xF,x6〉) I) @
+(* [0x18C0] TSX        *) (compile m ? TSX maINH I) @
+(* [0x18C1] CLR 9,x    *) (compile m ? CLR (maIX1 〈x0,x9〉) I) @
+(* [0x18C3] CLR 8,X    *) (compile m ? CLR (maIX1 〈x0,x8〉) I) @
+(* [0x18C5] CLR 1,X    *) (compile m ? CLR (maIX1 〈x0,x1〉) I) @
+(* [0x18C7] CLR ,X     *) (compile m ? CLR maIX0 I) @
+(* [0x18C8] CLR 3,X    *) (compile m ? CLR (maIX1 〈x0,x3〉) I) @
+(* [0x18CA] CLR 2,X    *) (compile m ? CLR (maIX1 〈x0,x2〉) I) @
+(* [0x18CC] JSR 0x1951 *) (compile m ? JSR (maIMM2 〈〈x1,x9〉:〈x5,x1〉〉) I) @
+
+(*
+for(tested_num=1;tested_num<2;tested_num++)
+ {
+*)
+
+(* [0x18CF] STHX 1,SP          *) (compile m ? STHX (maSP1 〈x0,x1〉) I) @
+(* [0x18D2] BRA *+116 ; 0x1946 *) (compile m ? BRA (maIMM1 〈x7,x2〉) I) @
+(* [0x18D4] BSR *+125 ; 0x1951 *) (compile m ? BSR (maIMM1 〈x7,xB〉) I) @
+(* [0x18D6] STHX 3,SP          *) (compile m ? STHX (maSP1 〈x0,x3〉) I) @
+
+(*
+ for(acc=0,divisor=1;divisor<tested_num;divisor++)
+  {
+  if(!(tested_num%divisor))
+   { acc+=divisor; }
+  }
+*)
+
+(* [0x18D9] BRA *+61 ; 0x1916 *) (compile m ? BRA (maIMM1 〈x3,xB〉) I) @
+(* [0x18DB] LDHX 1,SP         *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x18DE] PSHX              *) (compile m ? PSHX maINH I) @
+(* [0x18DF] PSHH              *) (compile m ? PSHH maINH I) @
+(* [0x18E0] LDHX 5,SP         *) (compile m ? LDHX (maSP1 〈x0,x5〉) I) @
+(* [0x18E3] JSR 0x1A1A        *) (compile m ? JSR (maIMM2 〈〈x1,xA〉:〈x1,xA〉〉) I) @
+(* [0x18E6] AIS #2            *) (compile m ? AIS (maIMM1 〈x0,x2〉) I) @
+(* [0x18E8] CPHX #0x0000      *) (compile m ? CPHX (maIMM2 〈〈x0,x0〉:〈x0,x0〉〉) I) @
+(* [0x18EB] BNE *+33 ; 0x190C *) (compile m ? BNE (maIMM1 〈x1,xF〉) I) @
+(* [0x18ED] TSX               *) (compile m ? TSX maINH I) @
+(* [0x18EE] LDA 3,X           *) (compile m ? LDA (maIX1 〈x0,x3〉) I) @
+(* [0x18F0] LDX 2,X           *) (compile m ? LDX (maIX1 〈x0,x2〉) I) @
+(* [0x18F2] PSHA              *) (compile m ? PSHA maINH I) @
+(* [0x18F3] PSHX              *) (compile m ? PSHX maINH I) @
+(* [0x18F4] CLRA              *) (compile m ? CLR maINHA I) @
+(* [0x18F5] PSHA              *) (compile m ? PSHA maINH I) @
+(* [0x18F6] PSHA              *) (compile m ? PSHA maINH I) @
+(* [0x18F7] TSX               *) (compile m ? TSX maINH I) @
+(* [0x18F8] PSHX              *) (compile m ? PSHX maINH I) @
+(* [0x19F9] PSHH              *) (compile m ? PSHH maINH I) @
+(* [0x18FA] AIX #8            *) (compile m ? AIX (maIMM1 〈x0,x8〉) I) @
+(* [0x18FC] PSHX              *) (compile m ? PSHX maINH I) @
+(* [0x18FD] PSHH              *) (compile m ? PSHH maINH I) @
+(* [0x18FE] LDHX 3,SP         *) (compile m ? LDHX (maSP1 〈x0,x3〉) I) @
+(* [0x1901] JSR 0x1A2A        *) (compile m ? JSR (maIMM2 〈〈x1,xA〉:〈x2,xA〉〉) I) @
+(* [0x1904] TSX               *) (compile m ? TSX maINH I) @
+(* [0x1905] AIX #14           *) (compile m ? AIX (maIMM1 〈x0,xE〉) I) @
+(* [0x1907] JSR 0x1A30        *) (compile m ? JSR (maIMM2 〈〈x1,xA〉:〈x3,x0〉〉) I) @
+(* [0x190A] AIS #6            *) (compile m ? AIS (maIMM1 〈x0,x6〉) I) @
+(* [0x190C] STA 0x1800  !COP! *) (compile m ? STA (maDIR2 〈〈x0,xC〉:〈x0,x0〉〉) I) @
+(* [0x190F] TSX               *) (compile m ? TSX maINH I) @
+(* [0x1910] INC 3,X           *) (compile m ? INC (maIX1 〈x0,x3〉) I) @
+(* [0x1912] BNE *+4 ; 0x1916  *) (compile m ? BNE (maIMM1 〈x0,x2〉) I) @
+(* [0x1914] INC 2,X           *) (compile m ? INC (maIX1 〈x0,x2〉) I) @
+(* [0x1916] LDHX 1,SP         *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x1919] CPHX 3,SP         *) (compile m ? CPHX (maSP1 〈x0,x3〉) I) @
+(* [0x191C] BHI *-65 ; 0x18DB *) (compile m ? BHI (maIMM1 〈xB,xD〉) I) @
+
+(*
+ if(acc==tested_num)
+  { result[res_pos++]=tested_num; }
+ }
+}
+*)
+
+(* [0x191E] CPHX 7,SP          *) (compile m ? CPHX (maSP1 〈x0,x7〉) I) @
+(* [0x1921] BNE *+31 ; 0x1940  *) (compile m ? BNE (maIMM1 〈x1,xD〉) I) @
+(* [0x1923] LDHX 5,SP          *) (compile m ? LDHX (maSP1 〈x0,x5〉) I) @
+(* [0x1926] BNE *+26 ; 0x1940  *) (compile m ? BNE (maIMM1 〈x1,x8〉) I) @
+(* [0x1928] LDHX 9,SP          *) (compile m ? LDHX (maSP1 〈x0,x9〉) I) @
+(* [0x192B] PSHX               *) (compile m ? PSHX maINH I) @
+(* [0x192C] AIX #1             *) (compile m ? AIX (maIMM1 〈x0,x1〉) I) @
+(* [0x192E] STHX 10,SP         *) (compile m ? STHX (maSP1 〈x0,xA〉) I) @
+(* [0x1931] PULX               *) (compile m ? PULX maINH I) @
+(* [0x1932] LSLX               *) (compile m ? ASL maINHX I) @
+(* [0x1933] LDA 2,SP           *) (compile m ? LDA (maSP1 〈x0,x2〉) I) @
+(* [0x1936] CLRH               *) (compile m ? CLR maINHH I) @
+(* [0x1937] STA 257,X          *) (compile m ? STA (maIX2 〈〈x0,x1〉:〈x0,x1〉〉) I) @
+(* [0x193A] LDA 1,SP           *) (compile m ? LDA (maSP1 〈x0,x1〉) I) @
+(* [0x193D] STA 256,X          *) (compile m ? STA (maIX2 〈〈x0,x1〉:〈x0,x0〉〉) I) @
+(* [0x1940] TSX                *) (compile m ? TSX maINH I) @
+(* [0x1941] INC 1,X            *) (compile m ? INC (maIX1 〈x0,x1〉) I) @
+(* [0x1943] BNE *+3 ; 0x1946   *) (compile m ? BNE (maIMM1 〈x0,x1〉) I) @
+(* [0x1945] INC ,X             *) (compile m ? INC maIX0 I) @
+(* [0x1946] LDHX 1,SP          *) (compile m ? LDHX (maSP1 〈x0,x1〉) I) @
+(* [0x1949] CPHX #elems        *) (compile m ? CPHX (maIMM2 elems) I) @
+(* [0x194C] BCS *-120 ; 0x18D4 *) (compile m ? BCS (maIMM1 〈x8,x6〉) I) @
+(* [0x194E] AIS #10            *) (compile m ? AIS (maIMM1 〈x0,xA〉) I) @
+(* [0x1950] STOP ->1951 !FINE! *) (compile m ? STOP maINH I) @
+(* [0x1951] CLRX               *) (compile m ? CLR maINHX I) @
+(* [0x1952] CLRH               *) (compile m ? CLR maINHH I) @
+(* [0x1953] STHX 9,SP          *) (compile m ? STHX (maSP1 〈x0,x9〉) I) @
+(* [0x1956] CLRH               *) (compile m ? CLR maINHH I) @
+(* [0x1957] STHX 7,SP          *) (compile m ? STHX (maSP1 〈x0,x7〉) I) @
+(* [0x195A] INCX               *) (compile m ? INC maINHX I) @
+(* [0x195B] RTS                *) (compile m ? RTS maINH I) @
+
+(*
+static void _PUSH_ARGS_L(void) { ... }
+*)
+
+(* [0x195C] LDA 3,X    *) (compile m ? LDA (maIX1 〈x0,x3〉) I) @
+(* [0x195E] PSHA       *) (compile m ? PSHA maINH I) @
+(* [0x195F] LDA 2,X    *) (compile m ? LDA (maIX1 〈x0,x2〉) I) @
+(* [0x1961] PSHA       *) (compile m ? PSHA maINH I) @
+(* [0x1962] LDHX ,X    *) (compile m ? LDHX maIX0 I) @
+(* [0x1964] PSHX       *) (compile m ? PSHX maINH I) @
+(* [0x1965] PSHH       *) (compile m ? PSHH maINH I) @
+(* [0x1966] LDHX 7,SP  *) (compile m ? LDHX (maSP1 〈x0,x7〉) I) @
+(* [0x1969] LDA 3,X    *) (compile m ? LDA (maIX1 〈x0,x3〉) I) @
+(* [0x196B] STA 17,SP  *) (compile m ? STA (maSP1 〈x1,x1〉) I) @
+(* [0x196E] LDA 2,X    *) (compile m ? LDA (maIX1 〈x0,x2〉) I) @
+(* [0x1970] STA 16,SP  *) (compile m ? STA (maSP1 〈x1,x0〉) I) @
+(* [0x1973] LDHX ,X    *) (compile m ? LDHX maIX0 I) @
+(* [0x1975] STHX 14,SP *) (compile m ? STHX (maSP1 〈x0,xE〉) I) @
+(* [0x1978] LDHX 5,SP  *) (compile m ? LDHX (maSP1 〈x0,x5〉) I) @
+(* [0x197B] JMP ,X     *) (compile m ? JMP maINHX0ADD I) @
+
+(*
+static void _ENTER_BINARY_L(void) { ... }
+*)
+
+(* [0x197C] PSHA       *) (compile m ? PSHA maINH I) @
+(* [0x197D] PSHX       *) (compile m ? PSHX maINH I) @
+(* [0x197E] PSHH       *) (compile m ? PSHH maINH I) @
+(* [0x197F] PSHX       *) (compile m ? PSHX maINH I) @
+(* [0x1980] PSHH       *) (compile m ? PSHH maINH I) @
+(* [0x1981] LDHX 6,SP  *) (compile m ? LDHX (maSP1 〈x0,x6〉) I) @
+(* [0x1984] PSHX       *) (compile m ? PSHX maINH I) @
+(* [0x1985] PSHH       *) (compile m ? PSHH maINH I) @
+(* [0x1986] LDHX 10,SP *) (compile m ? LDHX (maSP1 〈x0,xA〉) I) @
+(* [0x1989] STHX 8,SP  *) (compile m ? STHX (maSP1 〈x0,x8〉) I) @
+(* [0x198C] LDHX 12,SP *) (compile m ? LDHX (maSP1 〈x0,xC〉) I) @
+(* [0x198F] JMP 0x195C *) (compile m ? JMP (maIMM2 〈〈x1,x9〉:〈x5,xC〉〉) I) @
+
+(*
+static void _IDIVMOD (char dummy_sgn, int j, int dummy, int i, ...) { ... }
+*)
+
+(* [0x1992] TST 4,SP            *) (compile m ? TST (maSP1 〈x0,x4〉) I) @
+(* [0x1995] BNE *+28 ; 0x19B1   *) (compile m ? BNE (maIMM1 〈x1,xA〉) I) @
+(* [0x1997] TSX                 *) (compile m ? TSX maINH I) @
+(* [0x1998] LDA 7,X             *) (compile m ? LDA (maIX1 〈x0,x7〉) I) @
+(* [0x199A] LDX 4,X             *) (compile m ? LDX (maIX1 〈x0,x4〉) I) @
+(* [0x199C] CLRH                *) (compile m ? CLR maINHH I) @
+(* [0x199D] DIV                 *) (compile m ? DIV maINH I) @
+(* [0x199E] STA 4,SP            *) (compile m ? STA (maSP1 〈x0,x4〉) I) @
+(* [0x19A1] LDA 9,SP            *) (compile m ? LDA (maSP1 〈x0,x9〉) I) @
+(* [0x19A4] DIV                 *) (compile m ? DIV maINH I) @
+(* [0x19A5] STA 5,SP            *) (compile m ? STA (maSP1 〈x0,x5〉) I) @
+(* [0x19A8] CLR 8,SP            *) (compile m ? CLR (maSP1 〈x0,x8〉) I) @
+(* [0x19AB] PSHH                *) (compile m ? PSHH maINH I) @
+(* [0x19AC] PULA                *) (compile m ? PULA maINH I) @
+(* [0x19AD] STA 9,SP            *) (compile m ? STA (maSP1 〈x0,x9〉) I) @
+(* [0x19B0] RTS                 *) (compile m ? RTS maINH I) @
+(* [0x19B1] CLRA                *) (compile m ? CLR maINHA I) @
+(* [0x19B2] PSHA                *) (compile m ? PSHA maINH I) @
+(* [0x19B3] LDX #0x08           *) (compile m ? LDX (maIMM1 〈x0,x8〉) I) @
+(* [0x19B5] CLC                 *) (compile m ? CLC maINH I) @
+(* [0x19B6] ROL 10,SP           *) (compile m ? ROL (maSP1 〈x0,xA〉) I) @
+(* [0x19B9] ROL 9,SP            *) (compile m ? ROL (maSP1 〈x0,x9〉) I) @
+(* [0x19BC] ROL 1,SP            *) (compile m ? ROL (maSP1 〈x0,x1〉) I) @
+(* [0x19BF] LDA 5,SP            *) (compile m ? LDA (maSP1 〈x0,x5〉) I) @
+(* [0x19C2] CMP 1,SP            *) (compile m ? CMP (maSP1 〈x0,x1〉) I) @
+(* [0x19C5] BHI *+31 ; 0x19E4   *) (compile m ? BHI (maIMM1 〈x1,xD〉) I) @
+(* [0x19C7] BNE *+10 ; 0x19D1   *) (compile m ? BNE (maIMM1 〈x0,x8〉) I) @
+(* [0x19C9] LDA 6,SP            *) (compile m ? LDA (maSP1 〈x0,x6〉) I) @
+(* [0x19CC] CMP 9,SP            *) (compile m ? CMP (maSP1 〈x0,x9〉) I) @
+(* [0x19CF] BHI *+21 ; 0x19E4   *) (compile m ? BHI (maIMM1 〈x1,x3〉) I) @
+(* [0x19D1] LDA 9,SP            *) (compile m ? LDA (maSP1 〈x0,x9〉) I) @
+(* [0x19D4] SUB 6,SP            *) (compile m ? SUB (maSP1 〈x0,x6〉) I) @
+(* [0x19D7] STA 9,SP            *) (compile m ? STA (maSP1 〈x0,x9〉) I) @
+(* [0x19DA] LDA 1,SP            *) (compile m ? LDA (maSP1 〈x0,x1〉) I) @
+(* [0x19DD] SBC 5,SP            *) (compile m ? SBC (maSP1 〈x0,x5〉) I) @
+(* [0x19E0] STA 1,SP            *) (compile m ? STA (maSP1 〈x0,x1〉) I) @
+(* [0x19E3] SEC                 *) (compile m ? SEC maINH I) @
+(* [0x19E4] DBNZX *-46 ; 0x19B6 *) (compile m ? DBNZ (maINHX_and_IMM1 〈xD,x0〉) I) @
+(* [0x19E6] LDA 10,SP           *) (compile m ? LDA (maSP1 〈x0,xA〉) I) @
+(* [0x19E9] ROLA                *) (compile m ? ROL maINHA I) @
+(* [0x19EA] STA 6,SP            *) (compile m ? STA (maSP1 〈x0,x6〉) I) @
+(* [0x19ED] LDA 9,SP            *) (compile m ? LDA (maSP1 〈x0,x9〉) I) @
+(* [0x19F0] STA 10,SP           *) (compile m ? STA (maSP1 〈x0,xA〉) I) @
+(* [0x19F3] PULA                *) (compile m ? PULA maINH I) @
+(* [0x19F4] STA 8,SP            *) (compile m ? STA (maSP1 〈x0,x8〉) I) @
+(* [0x19F7] CLR 4,SP            *) (compile m ? CLR (maSP1 〈x0,x4〉) I) @
+(* [0x19FA] RTS                 *) (compile m ? RTS maINH I) @
+
+(*
+static void _LADD_k_is_k_plus_j(_PARAM_BINARY_L) { ... }
+*)
+
+(* [0x19FB] TSX      *) (compile m ? TSX maINH I) @
+(* [0x19FC] LDA 18,X *) (compile m ? LDA (maIX1 〈x1,x2〉) I) @
+(* [0x19FE] ADD 5,X  *) (compile m ? ADD (maIX1 〈x0,x5〉) I) @
+(* [0x1A00] STA 18,X *) (compile m ? STA (maIX1 〈x1,x2〉) I) @
+(* [0x1A02] LDA 17,X *) (compile m ? LDA (maIX1 〈x1,x1〉) I) @
+(* [0x1A04] ADC 4,X  *) (compile m ? ADC (maIX1 〈x0,x4〉) I) @
+(* [0x1A06] STA 17,X *) (compile m ? STA (maIX1 〈x1,x1〉) I) @
+(* [0x1A08] LDA 16,X *) (compile m ? LDA (maIX1 〈x1,x0〉) I) @
+(* [0x1A0A] ADC 3,X  *) (compile m ? ADC (maIX1 〈x0,x3〉) I) @
+(* [0x1A0C] STA 16,X *) (compile m ? STA (maIX1 〈x1,x0〉) I) @
+(* [0x1A0E] LDA 15,X *) (compile m ? LDA (maIX1 〈x0,xF〉) I) @
+(* [0x1A10] ADC 2,X  *) (compile m ? ADC (maIX1 〈x0,x2〉) I) @
+(* [0x1A12] STA 15,X *) (compile m ? STA (maIX1 〈x0,xF〉) I) @
+(* [0x1A14] AIS #10  *) (compile m ? AIS (maIMM1 〈x0,xA〉) I) @
+(* [0x1A16] PULH     *) (compile m ? PULH maINH I) @
+(* [0x1A17] PULX     *) (compile m ? PULX maINH I) @
+(* [0x1A18] PULA     *) (compile m ? PULA maINH I) @
+(* [0x1A19] RTS      *) (compile m ? RTS maINH I) @
+
+(*
+void _IMODU_STAR08(int i, ...) { ... }
+*)
+
+(* [0x1A1A] AIS #-2    *) (compile m ? AIS (maIMM1 〈xF,xE〉) I) @
+(* [0x1A1C] STHX 1,SP  *) (compile m ? STHX (maSP1 〈x0,x1〉) I) @
+(* [0x1A1F] PSHA       *) (compile m ? PSHA maINH I) @
+(* [0x1A20] JSR 0x1992 *) (compile m ? JSR (maIMM2 〈〈x1,x9〉:〈x9,x2〉〉) I) @
+(* [0x1A23] PULA       *) (compile m ? PULA maINH I) @
+(* [0x1A24] AIS #2     *) (compile m ? AIS (maIMM1 〈x0,x2〉) I) @
+(* [0x1A26] LDHX 3,SP  *) (compile m ? LDHX (maSP1 〈x0,x3〉) I) @
+(* [0x1A29] RTS        *) (compile m ? RTS maINH I) @
+
+(*
+void _LADD(void) { ... }
+*)
+
+(* [0x1A2A] JSR 0x197C *) (compile m ? JSR (maIMM2 〈〈x1,x9〉:〈x7,xC〉〉) I) @
+(* [0x1A2D] JSR 0x19FB *) (compile m ? JSR (maIMM2 〈〈x1,x9〉:〈xF,xB〉〉) I) @
+
+(*
+void _POP32(void) { ... }
+*)
+
+(* [0x1A30] PSHA     *) (compile m ? PSHA maINH I) @
+(* [0x1A31] LDA 4,SP *) (compile m ? LDA (maSP1 〈x0,x4〉) I) @
+(* [0x1A34] STA ,X   *) (compile m ? STA maIX0 I) @
+(* [0x1A35] LDA 5,SP *) (compile m ? LDA (maSP1 〈x0,x5〉) I) @
+(* [0x1A38] STA 1,X  *) (compile m ? STA (maIX1 〈x0,x1〉) I) @
+(* [0x1A3A] LDA 6,SP *) (compile m ? LDA (maSP1 〈x0,x6〉) I) @
+(* [0x1A3D] STA 2,X  *) (compile m ? STA (maIX1 〈x0,x2〉) I) @
+(* [0x1A3F] LDA 7,SP *) (compile m ? LDA (maSP1 〈x0,x7〉) I) @
+(* [0x1A42] STA 3,X  *) (compile m ? STA (maIX1 〈x0,x3〉) I) @
+(* [0x1A44] PULA     *) (compile m ? PULA maINH I) @
+(* [0x1A45] PULH     *) (compile m ? PULH maINH I) @
+(* [0x1A46] PULX     *) (compile m ? PULX maINH I) @
+(* [0x1A47] AIS #4   *) (compile m ? AIS (maIMM1 〈x0,x4〉) I) @
+(* [0x1A49] JMP ,X   *) (compile m ? JMP maINHX0ADD I)
+
+(* attraverso simulazione in CodeWarrior si puo' enunciare che dopo
+   80+(65*n*(n+1)*(n+2))/6 si sara' entrati in stato STOP corrispondente
+   AFTER: HX=num PC=0x1951 I=0 *)
+ ).
+
+(* creazione del processore+caricamento+impostazione registri *)
+ndefinition dTest_HCS08_gNum_status ≝
+λt:memory_impl.
+λI_op:bool.
+λA_op:byte8.
+λHX_op:word16.
+λPC_op:word16.
+λaddr:word16.
+λelems:word16.
+λdata:list byte8.
+ setweak_i_flag HCS08 t (* I<-I_op *)
+  (set_acc_8_low_reg HCS08 t (* A<-A_op *)
+   (set_z_flag HCS08 t (* Z<-true *)
+    (setweak_sp_reg HCS08 t (* SP<-0x016F *)
+     (setweak_indX_16_reg HCS08 t (* H:X<-HX_op *)
+      (set_pc_reg HCS08 t (* PC<-PC_op *)
+       (start_of_mcu_version_HCS08
+        MC9S08GB60 t
+        (load_from_source_at t (* carica data in RAM:dTest_HCS08_RAM *)
+         (load_from_source_at t (zero_memory t) (* carica source in ROM:addr *)
+           (dTest_HCS08_cSort_source elems) addr)
+          data dTest_HCS08_RAM)
+        (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08GB60) t)
+        (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+        false false false false false false) (* non deterministici tutti a 0 *)
+       PC_op)
+      HX_op)
+     (mk_word16 (mk_byte8 x0 x1) (mk_byte8 x6 xF)))
+    true)
+   A_op)
+  I_op.
+
+(* NUMERI AUREI: Somma divisori(x)=x, fino a 0xFFFF sono 6/28/496/8128 *)
+ndefinition dTest_HCS08_gNum_aurei ≝
+λnum:word16.match gt_w16 num 〈〈x1,xF〉:〈xC,x0〉〉 with
+ [ true ⇒ [ 〈x0,x0〉 ; 〈x0,x6〉 ; 〈x0,x0〉 ; 〈x1,xC〉 ; 〈x0,x1〉 ; 〈xF,x0〉 ; 〈x1,xF〉 ; 〈xC,x0〉 ]
+ | false ⇒ match gt_w16 num 〈〈x0,x1〉:〈xF,x0〉〉 with
+  [ true ⇒ [ 〈x0,x0〉 ; 〈x0,x6〉 ; 〈x0,x0〉 ; 〈x1,xC〉 ; 〈x0,x1〉 ; 〈xF,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ]
+  | false ⇒ match gt_w16 num 〈〈x0,x0〉:〈x1,xC〉〉 with
+   [ true ⇒ [ 〈x0,x0〉 ; 〈x0,x6〉 ; 〈x0,x0〉 ; 〈x1,xC〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ]
+   | false ⇒ match gt_w16 num 〈〈x0,x0〉:〈x0,x6〉〉 with
+    [ true ⇒ [ 〈x0,x0〉 ; 〈x0,x6〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ]
+    | false ⇒ [ 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ]
+    ]
+   ]
+  ]
+ ] @ [ 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉
+     ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉
+     ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ; 〈x0,x0〉 ].
+
+(* esecuzione execute k*(n+2) *)
+nlet rec dTest_HCS08_gNum_execute1 (m:mcu_type) (t:memory_impl) (s:tick_result (any_status m t)) (n,ntot:nat) on n ≝
+ match s with
+  [ TickERR s' error ⇒ TickERR ? s' error
+  | TickSUSP s' susp ⇒ TickSUSP ? s' susp
+  | TickOK s' ⇒ match n with
+   [ O ⇒ TickOK ? s'
+   | S n' ⇒ dTest_HCS08_gNum_execute1 m t (execute m t (TickOK ? s') (ntot+2)) n' ntot ]
+  ].
+
+(* esecuzione execute k*(n+1)*(n+2) *)
+nlet rec dTest_HCS08_gNum_execute2 (m:mcu_type) (t:memory_impl) (s:tick_result (any_status m t)) (n,ntot:nat) on n ≝
+ match s with
+  [ TickERR s' error ⇒ TickERR ? s' error
+  | TickSUSP s' susp ⇒ TickSUSP ? s' susp
+  | TickOK s' ⇒ match n with
+   [ O ⇒ TickOK ? s'
+   | S n' ⇒ dTest_HCS08_gNum_execute2 m t (dTest_HCS08_gNum_execute1 m t (TickOK ? s') (ntot+1) ntot) n' ntot ]
+  ].
+
+(* esecuzione execute k*n*(n+1)*(n+2) *)
+nlet rec dTest_HCS08_gNum_execute3 (m:mcu_type) (t:memory_impl) (s:tick_result (any_status m t)) (n,ntot:nat) on n ≝
+ match s with
+  [ TickERR s' error ⇒ TickERR ? s' error
+  | TickSUSP s' susp ⇒ TickSUSP ? s' susp
+  | TickOK s' ⇒ match n with
+   [ O ⇒ TickOK ? s'
+   | S n' ⇒ dTest_HCS08_gNum_execute3 m t (dTest_HCS08_gNum_execute2 m t (TickOK ? s') ntot ntot) n' ntot ]
+  ].
+
+(* esecuzione execute 80+11*n*(n+1)*(n+2) *)
+ndefinition dTest_HCS08_gNum_execute4 ≝
+λm:mcu_type.λt:memory_impl.λs:tick_result (any_status m t).λntot:nat.
+ match s with
+  [ TickERR s' error ⇒ TickERR ? s' error
+  | TickSUSP s' susp ⇒ TickSUSP ? s' susp
+  | TickOK s' ⇒ execute m t (dTest_HCS08_gNum_execute3 m t (TickOK ? s') 11 ntot) 80
+  ].
+
+(* parametrizzazione dell'enunciato del teorema parziale *)
+nlemma dTest_HCS08_gNum_aux ≝
+λt:memory_impl.λnum:word16.
+ (* 2) match di esecuzione su tempo in forma di upperbound *)
+ match dTest_HCS08_gNum_execute4 HCS08 t
+  (TickOK ? (dTest_HCS08_gNum_status t true 〈x0,x0〉 〈〈x1,xA〉:〈x0,x0〉〉 〈〈x1,x8〉:〈xB,xE〉〉 〈〈x1,x8〉:〈xB,xE〉〉 num dTest_zeros))
+  (* tempo di esecuzione 80+11*n*(n+1)*(n+2) *)
+  (nat_of_w16 num) with
+   [ TickERR s _ ⇒ None ?
+   (* azzeramento tutta RAM tranne dati *)
+   | TickSUSP s _ ⇒ Some ? (set_mem_desc HCS08 t s (load_from_source_at t (mem_desc HCS08 t s) dTest_zeros3K 〈〈x0,x1〉:〈x2,x0〉〉))
+   | TickOK s ⇒ None ?
+   ] =
+  Some ? (dTest_HCS08_gNum_status t false 〈x0,x0〉 num 〈〈x1,x9〉:〈x5,x1〉〉 〈〈x1,x8〉:〈xB,xE〉〉 num (dTest_HCS08_gNum_aurei num)).
+
+ndefinition gNumCalc ≝
+λnum:word16.
+ match dTest_HCS08_gNum_execute4 HCS08 MEM_TREE
+  (TickOK ? (dTest_HCS08_gNum_status MEM_TREE true 〈x0,x0〉 〈〈x1,xA〉:〈x0,x0〉〉 〈〈x1,x8〉:〈xB,xE〉〉 〈〈x1,x8〉:〈xB,xE〉〉 num dTest_zeros))
+  (nat_of_w16 num) with
+   [ TickERR s _ ⇒ None ?
+   | TickSUSP s _ ⇒ Some ? (set_mem_desc HCS08 MEM_TREE s (load_from_source_at MEM_TREE (mem_desc HCS08 MEM_TREE s) dTest_zeros3K 〈〈x0,x1〉:〈x2,x0〉〉))
+   | TickOK s ⇒ None ?
+   ].
+
+ndefinition gNumNoCalc ≝
+λnum:word16.
+ Some ? (dTest_HCS08_gNum_status MEM_TREE false 〈x0,x0〉 num 〈〈x1,x9〉:〈x5,x1〉〉 〈〈x1,x8〉:〈xB,xE〉〉 num (dTest_HCS08_gNum_aurei num)).
+
+ndefinition gNumCalc1    ≝ gNumCalc 〈〈x0,x0〉:〈x0,x1〉〉.
+ndefinition gNumCalc2    ≝ gNumCalc 〈〈x0,x0〉:〈x0,x2〉〉.
+ndefinition gNumCalc5    ≝ gNumCalc 〈〈x0,x0〉:〈x0,x5〉〉.
+ndefinition gNumCalc10   ≝ gNumCalc 〈〈x0,x0〉:〈x0,xA〉〉.
+ndefinition gNumCalc20   ≝ gNumCalc 〈〈x0,x0〉:〈x1,x4〉〉.
+ndefinition gNumCalc50   ≝ gNumCalc 〈〈x0,x0〉:〈x3,x2〉〉.
+ndefinition gNumCalc100  ≝ gNumCalc 〈〈x0,x0〉:〈x6,x4〉〉.
+ndefinition gNumCalc250  ≝ gNumCalc 〈〈x0,x0〉:〈xF,xA〉〉.
+ndefinition gNumCalc500  ≝ gNumCalc 〈〈x0,x1〉:〈xF,x4〉〉.
+ndefinition gNumCalc1000 ≝ gNumCalc 〈〈x0,x3〉:〈xE,x8〉〉.
+
+ndefinition gNumNoCalc1    ≝ gNumNoCalc 〈〈x0,x0〉:〈x0,x1〉〉.
+ndefinition gNumNoCalc2    ≝ gNumNoCalc 〈〈x0,x0〉:〈x0,x2〉〉.
+ndefinition gNumNoCalc5    ≝ gNumNoCalc 〈〈x0,x0〉:〈x0,x5〉〉.
+ndefinition gNumNoCalc10   ≝ gNumNoCalc 〈〈x0,x0〉:〈x0,xA〉〉.
+ndefinition gNumNoCalc20   ≝ gNumNoCalc 〈〈x0,x0〉:〈x1,x4〉〉.
+ndefinition gNumNoCalc50   ≝ gNumNoCalc 〈〈x0,x0〉:〈x3,x2〉〉.
+ndefinition gNumNoCalc100  ≝ gNumNoCalc 〈〈x0,x0〉:〈x6,x4〉〉.
+ndefinition gNumNoCalc250  ≝ gNumNoCalc 〈〈x0,x0〉:〈xF,xA〉〉.
+ndefinition gNumNoCalc500  ≝ gNumNoCalc 〈〈x0,x1〉:〈xF,x4〉〉.
+ndefinition gNumNoCalc1000 ≝ gNumNoCalc 〈〈x0,x3〉:〈xE,x8〉〉.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests_tools.ma b/helm/software/matita/contribs/ng_assembly/freescale_tests/medium_tests_tools.ma
new file mode 100755 (executable)
index 0000000..6319dc6
--- /dev/null
@@ -0,0 +1,592 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                   *)
+(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "freescale/multivm.ma".
+
+(* ********* *)
+(* INDIRIZZI *)
+(* ********* *)
+
+(* specifico per MC9S08GB60 in modo da caricare codice compilato da CodeWarrior *)
+(* l'obbiettivo e' dimostrare una routine scritta in C *)
+(* passo 1 e' formalizzare l'uso di 3Kb dei 4Kb di RAM [0x0100-0x0CFF] *)
+ndefinition dTest_HCS08_RAM ≝ 〈〈x0,x1〉:〈x0,x0〉〉.
+ndefinition dTest_HCS08_prog ≝ 〈〈x1,x8〉:〈xC,x8〉〉.
+
+(* ***** *)
+(* TOOLS *)
+(* ***** *)
+
+(* visita di un albero da 256B di elementi: ln16(256)=2 passaggi *)
+ndefinition dTest_visit ≝
+λdata:Array16T (Array16T (list byte8)).λaddr:byte8.
+ getn_array16T (b8l addr) ?
+  (getn_array16T (b8h addr) ? data).
+
+(* scrittura di un elemento in un albero da 256B *)
+ndefinition dTest_update ≝
+λdata:Array16T (Array16T (list byte8)).λaddr:byte8.λv:list byte8.
+ let lev2 ≝ getn_array16T (b8h addr) ? data in
+ setn_array16T (b8h addr) ? data
+  (setn_array16T (b8l addr) ? lev2 v) .
+
+(* array a 0 *)
+ndefinition dTest_zero_array ≝
+let elem ≝ nil byte8 in
+let lev2 ≝ array_16T ? 
+           elem elem elem elem elem elem elem elem
+           elem elem elem elem elem elem elem elem
+           in
+let lev1 ≝ array_16T ?
+           lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
+           lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
+           in
+lev1.
+
+(* incrementa n-simo elemento *)
+ndefinition dTest_inc ≝
+λdata:Array16T (Array16T (list byte8)).λaddr:byte8.
+ dTest_update data addr ((dTest_visit data addr)@[ addr ]).
+
+(* costruisce una lista a partire dai conteggi per elemento *)
+ndefinition dTest_build_list_from_count ≝
+λdata:Array16T (Array16T (list byte8)).
+ let aux1 ≝ λparam1:Array16T (list byte8).
+  match param1 with
+   [ array_16T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15 ⇒
+    e00@e01@e02@e03@e04@e05@e06@e07@e08@e09@e10@e11@e12@e13@e14@e15 ] in
+ let aux2 ≝ λparam2:Array16T (Array16T (list byte8)).
+  match param2 with
+   [ array_16T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15 ⇒
+    (aux1 e00)@(aux1 e01)@(aux1 e02)@(aux1 e03)@(aux1 e04)@(aux1 e05)@(aux1 e06)@(aux1 e07)@
+    (aux1 e08)@(aux1 e09)@(aux1 e10)@(aux1 e11)@(aux1 e12)@(aux1 e13)@(aux1 e14)@(aux1 e15) ] in
+ aux2 data.
+
+(* ci sono ora tutti gli elementi per definire l'ordinamento *)
+(* di una lista di byte8 secondo il counting sort *)
+nlet rec byte8_list_ordering_aux (source:list byte8) (count:Array16T (Array16T (list byte8))) on source ≝
+ match source with
+  [ nil ⇒ dTest_build_list_from_count count
+  | cons hd tl ⇒ byte8_list_ordering_aux tl (dTest_inc count hd)
+  ].
+
+ndefinition byte8_list_ordering ≝
+λsource:list byte8.byte8_list_ordering_aux source dTest_zero_array.
+
+(* strlen esadecimale limitato, considerando overflow! *)
+nlet rec byte8_bounded_strlen_aux (source:list byte8) (count,limit:word16) on source ≝
+ match source with
+  [ nil ⇒ True
+  | cons _ tl ⇒ match eq_w16 count 〈〈xF,xF〉:〈xF,xF〉〉 with
+   [ true ⇒ False
+   | false ⇒ match le_w16 (succ_w16 count) limit with
+    [ true ⇒ byte8_bounded_strlen_aux tl (succ_w16 count) limit
+    | false ⇒ False
+    ]
+   ]
+  ].
+
+ndefinition byte8_bounded_strlen ≝
+λsource:list byte8.λlimit:word16.
+ byte8_bounded_strlen_aux source 〈〈x0,x0〉:〈x0,x0〉〉 limit.
+
+(* strlen esadecimale normale *)
+nlet rec byte8_strlen_aux (source:list byte8) (count:word16) on source ≝
+ match source with
+  [ nil ⇒ count
+  | cons _ tl ⇒ byte8_strlen_aux tl (succ_w16 count)
+  ].
+
+ndefinition byte8_strlen ≝
+λsource:list byte8.
+ byte8_strlen_aux source 〈〈x0,x0〉:〈x0,x0〉〉.
+
+(* hex dump: memory -> list byte8 *)
+nlet rec byte8_hexdump_aux (t:memory_impl) (mem:aux_mem_type t) (inf:word16) (count:nat) (out:list byte8) on count ≝
+ match count with
+  [ O ⇒ out
+  | S n ⇒ byte8_hexdump_aux t mem (succ_w16 inf) n (out@[ mem_read_abs t mem inf ])
+  ].
+
+ndefinition byte8_hexdump ≝
+λt:memory_impl.λmem:aux_mem_type t.λinf:word16.λcount:nat.
+ byte8_hexdump_aux t mem inf count [].
+
+(* ************* *)
+(* TEST PATTERNS *)
+(* ************* *)
+
+(* lista di 3072 numeri random generati da Mathematica, in blocchi da 32 *)
+ndefinition dTest_random_ex00 ≝
+[〈x8,x1〉;〈x5,xE〉;〈x7,x6〉;〈xD,x1〉;〈x7,x5〉;〈x1,x0〉;〈x8,x5〉;〈x9,x0〉;〈x1,xF〉;〈x1,x2〉;〈xE,x2〉;〈x3,xC〉;〈x1,xD〉;〈x0,x6〉;〈x3,xC〉;〈xD,x1〉
+;〈x8,x3〉;〈xE,xB〉;〈x7,x2〉;〈x1,xF〉;〈x9,x0〉;〈xF,x0〉;〈x4,x7〉;〈xA,x3〉;〈xD,x0〉;〈x4,x6〉;〈xC,x5〉;〈x3,x2〉;〈xC,x9〉;〈x0,xB〉;〈x1,xB〉;〈x7,x3〉 ].
+
+ndefinition dTest_random_ex01 ≝
+[〈x1,x1〉;〈xA,xF〉;〈xD,x2〉;〈xB,xF〉;〈x0,xB〉;〈xB,xC〉;〈x0,x8〉;〈xE,x5〉;〈xF,xE〉;〈xA,xC〉;〈xF,xC〉;〈x9,x4〉;〈x3,x4〉;〈x8,x8〉;〈x2,x8〉;〈xD,xB〉
+;〈xD,x3〉;〈x3,xD〉;〈x3,x8〉;〈x6,xA〉;〈x4,xD〉;〈x7,x4〉;〈x4,x9〉;〈x7,xE〉;〈x6,xF〉;〈x4,xD〉;〈x3,xD〉;〈x3,xA〉;〈xC,x2〉;〈xD,x3〉;〈x3,x6〉;〈x7,x0〉 ].
+
+ndefinition dTest_random_ex02 ≝
+[〈x8,x0〉;〈xC,x9〉;〈x3,xB〉;〈x5,x2〉;〈x8,xF〉;〈x1,xE〉;〈x8,x4〉;〈x5,x2〉;〈x2,xD〉;〈xA,xF〉;〈x1,xB〉;〈x0,x1〉;〈x3,x5〉;〈x7,x2〉;〈x1,x0〉;〈x0,x7〉
+;〈x5,xD〉;〈xA,xB〉;〈xE,x0〉;〈x7,x6〉;〈xB,xD〉;〈x3,xC〉;〈x0,xD〉;〈xC,xE〉;〈xB,x7〉;〈x9,xD〉;〈xA,x9〉;〈xF,x3〉;〈xC,x1〉;〈x9,x3〉;〈x8,xC〉;〈x4,xE〉 ].
+
+ndefinition dTest_random_ex03 ≝
+[〈xF,x8〉;〈xC,x3〉;〈x1,x3〉;〈x3,xA〉;〈xA,x2〉;〈xB,xD〉;〈x1,x0〉;〈x9,xB〉;〈x5,xC〉;〈xC,x8〉;〈xE,x5〉;〈xC,x8〉;〈xA,x6〉;〈xF,xB〉;〈x1,x3〉;〈xC,x8〉
+;〈x6,x4〉;〈x0,x9〉;〈xD,x6〉;〈xD,x7〉;〈x3,x9〉;〈xF,x9〉;〈xE,x4〉;〈x0,x3〉;〈x4,x9〉;〈xC,xE〉;〈x7,x1〉;〈x5,x7〉;〈x3,x4〉;〈x2,xE〉;〈xA,x3〉;〈x5,x3〉 ].
+
+ndefinition dTest_random_ex04 ≝
+[〈xF,x9〉;〈x2,xA〉;〈xF,x0〉;〈xE,x1〉;〈x6,x6〉;〈x8,x9〉;〈x2,xE〉;〈x8,x6〉;〈xC,x7〉;〈x2,xD〉;〈x1,x2〉;〈xD,x5〉;〈x4,xA〉;〈x7,x9〉;〈x6,xD〉;〈x1,xB〉
+;〈x4,x1〉;〈x9,x4〉;〈x6,xC〉;〈x6,xD〉;〈xF,x4〉;〈x5,xD〉;〈x8,xB〉;〈xB,xE〉;〈xC,x8〉;〈xE,x5〉;〈xA,x4〉;〈xB,xA〉;〈xB,x1〉;〈x2,x1〉;〈x5,x0〉;〈x6,xB〉 ].
+
+ndefinition dTest_random_ex05 ≝
+[〈x9,x5〉;〈x0,x6〉;〈x4,x5〉;〈xE,x0〉;〈x0,xF〉;〈x5,xA〉;〈xC,xE〉;〈xC,x8〉;〈x8,x2〉;〈x4,xF〉;〈xC,x2〉;〈xF,x5〉;〈xF,x8〉;〈x1,x3〉;〈xD,xA〉;〈x2,xB〉
+;〈x7,x9〉;〈xB,xF〉;〈xA,x4〉;〈x5,xA〉;〈xD,x2〉;〈x7,x6〉;〈x8,xD〉;〈x1,xF〉;〈x1,x5〉;〈x5,xA〉;〈xD,xE〉;〈x2,x3〉;〈x9,xD〉;〈x7,xE〉;〈x6,x7〉;〈x6,x3〉 ].
+
+ndefinition dTest_random_ex06 ≝
+[〈x1,x1〉;〈xF,x5〉;〈x2,x4〉;〈xD,x6〉;〈x6,xA〉;〈x0,xC〉;〈x7,xF〉;〈x1,x2〉;〈xD,x6〉;〈xE,xE〉;〈xB,xA〉;〈x4,x4〉;〈x3,x9〉;〈x9,x2〉;〈x6,x6〉;〈xE,xA〉
+;〈x2,x3〉;〈x4,x4〉;〈xC,xF〉;〈x7,x4〉;〈x6,xB〉;〈x8,x3〉;〈x7,x7〉;〈x0,x4〉;〈x6,x4〉;〈xB,x3〉;〈x3,xC〉;〈x2,x6〉;〈xF,xC〉;〈xD,x5〉;〈x4,x1〉;〈xB,x7〉 ].
+
+ndefinition dTest_random_ex07 ≝
+[〈x2,x4〉;〈xE,x0〉;〈xB,x4〉;〈x1,x3〉;〈x3,x2〉;〈x4,x5〉;〈x1,x8〉;〈xD,xB〉;〈x0,x0〉;〈xB,x6〉;〈x5,xF〉;〈x3,xA〉;〈xB,x7〉;〈x4,xF〉;〈xB,x4〉;〈xD,xF〉
+;〈xF,x4〉;〈x1,xA〉;〈x1,x0〉;〈xE,x9〉;〈xC,x5〉;〈x2,xC〉;〈xB,xC〉;〈x5,xB〉;〈x0,x5〉;〈x4,xA〉;〈x5,x2〉;〈xC,x0〉;〈x1,xF〉;〈x5,x9〉;〈xF,x2〉;〈xE,x5〉 ].
+
+ndefinition dTest_random_ex08 ≝
+[〈x9,x7〉;〈x5,x1〉;〈xF,x7〉;〈x3,xC〉;〈x7,x7〉;〈x8,x1〉;〈x7,xC〉;〈xB,x0〉;〈x1,xD〉;〈x1,xA〉;〈x7,xB〉;〈x4,x7〉;〈x7,x9〉;〈xC,x2〉;〈x3,xF〉;〈xD,x3〉
+;〈xB,x6〉;〈xD,x7〉;〈xC,x9〉;〈x9,x2〉;〈x0,xD〉;〈x7,xF〉;〈x0,xB〉;〈x7,x5〉;〈x0,xE〉;〈x5,x1〉;〈x9,xF〉;〈x4,xC〉;〈xE,x5〉;〈xD,x0〉;〈xC,x1〉;〈x3,x9〉 ].
+
+ndefinition dTest_random_ex09 ≝
+[〈x7,xF〉;〈xE,xA〉;〈x4,x1〉;〈x0,x5〉;〈x0,x8〉;〈x7,xE〉;〈x7,x6〉;〈x2,xF〉;〈x6,x2〉;〈x7,x1〉;〈xF,x8〉;〈x3,x8〉;〈xB,x6〉;〈x7,x0〉;〈xD,xD〉;〈xD,x0〉
+;〈xA,xD〉;〈x7,x8〉;〈x3,xD〉;〈x7,xB〉;〈xC,xC〉;〈x6,xD〉;〈x3,xF〉;〈xA,xC〉;〈xC,x7〉;〈x6,xE〉;〈xF,xF〉;〈x4,x5〉;〈xC,x1〉;〈x7,x4〉;〈xB,xF〉;〈x2,x9〉 ].
+
+ndefinition dTest_random_ex0A ≝
+[〈x4,x9〉;〈xC,x5〉;〈x7,xC〉;〈x2,xD〉;〈xF,x2〉;〈xC,xC〉;〈xF,xA〉;〈x5,x8〉;〈xA,xC〉;〈x5,x8〉;〈x5,x1〉;〈x0,xE〉;〈x4,x8〉;〈x7,x0〉;〈x4,x1〉;〈xE,xD〉
+;〈x9,x5〉;〈xB,x4〉;〈x4,x7〉;〈xF,x1〉;〈x8,x1〉;〈xE,x4〉;〈x4,x0〉;〈x5,x4〉;〈x7,xB〉;〈xA,x1〉;〈xD,x2〉;〈x0,x2〉;〈xC,x5〉;〈x7,xD〉;〈x7,xA〉;〈xF,x1〉 ].
+
+ndefinition dTest_random_ex0B ≝
+[〈x0,x0〉;〈x8,xD〉;〈x6,x6〉;〈xB,x0〉;〈xA,x9〉;〈x7,xA〉;〈x2,xB〉;〈x2,xC〉;〈x6,xF〉;〈x5,xF〉;〈x6,xF〉;〈x4,xE〉;〈x2,xB〉;〈x1,x1〉;〈xF,xF〉;〈x4,x7〉
+;〈x7,xF〉;〈xC,xF〉;〈xD,x3〉;〈x8,x5〉;〈xB,x8〉;〈x4,xD〉;〈x9,x9〉;〈x8,x3〉;〈x7,x6〉;〈xE,x8〉;〈x3,x0〉;〈xF,x8〉;〈xD,x0〉;〈x5,x9〉;〈xB,x8〉;〈x7,x1〉 ].
+
+ndefinition dTest_random_ex0C ≝
+[〈x5,x7〉;〈xA,xF〉;〈xB,x5〉;〈xD,x5〉;〈xF,xC〉;〈x8,x2〉;〈x1,x6〉;〈x1,x0〉;〈xB,x3〉;〈xC,x1〉;〈x1,xA〉;〈x0,x1〉;〈x1,x1〉;〈xF,xF〉;〈x5,x9〉;〈x2,x4〉
+;〈xC,x5〉;〈x7,x2〉;〈xD,x8〉;〈xD,x0〉;〈xA,xD〉;〈xF,xE〉;〈xD,x7〉;〈x1,x1〉;〈xC,xE〉;〈xF,x9〉;〈xB,x8〉;〈x7,x7〉;〈x3,xA〉;〈x1,xF〉;〈x6,x1〉;〈x1,xB〉 ].
+
+ndefinition dTest_random_ex0D ≝
+[〈xB,xB〉;〈x5,x5〉;〈x8,x0〉;〈x7,xC〉;〈x2,x5〉;〈x3,x4〉;〈x8,x9〉;〈xF,x2〉;〈xC,x9〉;〈xD,xF〉;〈x3,x5〉;〈xC,x5〉;〈x1,x2〉;〈xF,x0〉;〈x0,x5〉;〈xD,xE〉
+;〈x2,x6〉;〈x4,x9〉;〈xB,x7〉;〈x3,x9〉;〈x0,x5〉;〈xC,x2〉;〈xD,xB〉;〈xF,xC〉;〈x9,xF〉;〈xA,x9〉;〈x6,x6〉;〈xA,xD〉;〈x4,xA〉;〈x3,xF〉;〈xB,xF〉;〈x6,xD〉 ].
+
+ndefinition dTest_random_ex0E ≝
+[〈x8,x7〉;〈x6,xA〉;〈xB,x1〉;〈x3,xE〉;〈xB,x6〉;〈x0,xE〉;〈x7,xA〉;〈x3,xB〉;〈x4,x5〉;〈xE,x9〉;〈xC,xE〉;〈x6,xA〉;〈x6,xA〉;〈x7,x0〉;〈x6,x0〉;〈x6,xA〉
+;〈x2,xC〉;〈xD,x2〉;〈xB,x8〉;〈x3,x6〉;〈x2,x1〉;〈x0,x0〉;〈x5,x4〉;〈x3,x1〉;〈x6,x0〉;〈x1,xB〉;〈x4,xC〉;〈xC,xA〉;〈xB,xE〉;〈x5,xF〉;〈x8,x1〉;〈xB,x7〉 ].
+
+ndefinition dTest_random_ex0F ≝
+[〈x9,xB〉;〈x2,x6〉;〈x9,x4〉;〈x2,xB〉;〈x4,x1〉;〈x2,xB〉;〈x9,x8〉;〈x6,x3〉;〈x6,x6〉;〈x6,x5〉;〈x4,x6〉;〈x2,x3〉;〈xE,x5〉;〈x0,x7〉;〈x9,xE〉;〈x1,xC〉
+;〈x3,x8〉;〈x5,xC〉;〈x9,x7〉;〈x6,x3〉;〈x5,x3〉;〈x6,x6〉;〈x0,x8〉;〈x5,xD〉;〈x0,x8〉;〈xD,xB〉;〈x6,xE〉;〈x5,x6〉;〈x7,x0〉;〈x3,x2〉;〈x4,x5〉;〈x0,x2〉 ].
+
+ndefinition dTest_random_ex10 ≝
+[〈x6,x3〉;〈x7,x2〉;〈x9,xC〉;〈xD,x9〉;〈x5,x0〉;〈x0,x6〉;〈x5,x9〉;〈x1,x7〉;〈x6,x8〉;〈xD,x2〉;〈xD,x7〉;〈x8,xE〉;〈x6,x9〉;〈x5,xF〉;〈x8,x1〉;〈x8,x4〉
+;〈x8,x7〉;〈xD,xC〉;〈x9,x8〉;〈xE,x5〉;〈xB,x5〉;〈xC,x3〉;〈x2,x5〉;〈x6,xC〉;〈x9,x2〉;〈xD,xD〉;〈x2,xA〉;〈xD,x1〉;〈x1,x4〉;〈x7,xE〉;〈x1,x7〉;〈xB,x2〉 ].
+
+ndefinition dTest_random_ex11 ≝
+[〈x9,x8〉;〈x5,x5〉;〈xF,xC〉;〈x3,xD〉;〈x8,xD〉;〈xE,xF〉;〈x8,x1〉;〈xB,x8〉;〈xB,xB〉;〈x5,x1〉;〈x0,x0〉;〈xB,x4〉;〈x2,xE〉;〈x3,x0〉;〈x6,x0〉;〈x7,xE〉
+;〈x9,x0〉;〈xE,x3〉;〈xF,x4〉;〈x7,x2〉;〈x1,xC〉;〈xB,x3〉;〈x7,x8〉;〈x1,xB〉;〈x9,xF〉;〈x1,xB〉;〈x0,x3〉;〈xA,x3〉;〈x0,x5〉;〈xD,xE〉;〈x3,x8〉;〈xB,xA〉 ].
+
+ndefinition dTest_random_ex12 ≝
+[〈x0,xE〉;〈xE,xD〉;〈xE,xC〉;〈x1,xF〉;〈x3,x8〉;〈xE,x3〉;〈xF,x7〉;〈xA,xA〉;〈xE,x9〉;〈x3,xD〉;〈xF,xF〉;〈xF,x3〉;〈x1,x4〉;〈x2,xC〉;〈x8,x8〉;〈x6,x1〉
+;〈x3,x0〉;〈xA,xB〉;〈x1,x8〉;〈xD,xC〉;〈xF,xE〉;〈x6,xA〉;〈x2,x9〉;〈xF,x1〉;〈xC,xB〉;〈x9,x0〉;〈x7,x8〉;〈x9,x9〉;〈x1,xF〉;〈x2,x8〉;〈xF,x9〉;〈xC,xB〉 ].
+
+ndefinition dTest_random_ex13 ≝
+[〈x1,x4〉;〈x8,x4〉;〈xF,x3〉;〈xD,x6〉;〈x7,xE〉;〈xE,xC〉;〈x5,x6〉;〈xC,xE〉;〈xD,xA〉;〈x5,xE〉;〈x6,x1〉;〈xF,x1〉;〈x6,x6〉;〈x6,x9〉;〈x9,x3〉;〈x5,x9〉
+;〈x3,xC〉;〈x1,xD〉;〈x6,xB〉;〈xF,x4〉;〈x5,x9〉;〈x4,xD〉;〈x3,x8〉;〈xA,x9〉;〈x3,xB〉;〈x7,xF〉;〈xB,x2〉;〈xE,xC〉;〈xA,xE〉;〈xF,x6〉;〈xB,x2〉;〈x2,x2〉 ].
+
+ndefinition dTest_random_ex14 ≝
+[〈x6,x4〉;〈x2,x7〉;〈x6,xC〉;〈x2,x0〉;〈xE,xE〉;〈x5,x1〉;〈x3,xE〉;〈x8,x8〉;〈xD,xD〉;〈xC,x1〉;〈xD,xC〉;〈xC,x1〉;〈x6,x6〉;〈x6,x1〉;〈x4,x2〉;〈x7,x7〉
+;〈x3,x6〉;〈x0,x8〉;〈x2,x9〉;〈x6,x0〉;〈xA,x9〉;〈xF,xC〉;〈x7,xC〉;〈xA,x7〉;〈xB,x4〉;〈xF,xC〉;〈x8,x7〉;〈x1,xD〉;〈x6,xC〉;〈xA,x2〉;〈x3,xF〉;〈x1,xD〉 ].
+
+ndefinition dTest_random_ex15 ≝
+[〈x1,x7〉;〈x0,xF〉;〈x0,x2〉;〈x2,x6〉;〈xA,x2〉;〈x6,xA〉;〈x5,xC〉;〈xE,xD〉;〈x2,x7〉;〈xC,x5〉;〈x7,xB〉;〈xF,x5〉;〈x9,xC〉;〈x8,x5〉;〈x6,x3〉;〈x5,x6〉
+;〈xC,x3〉;〈x4,xB〉;〈x1,xB〉;〈xA,x0〉;〈x1,xB〉;〈x8,x9〉;〈x3,x5〉;〈xD,x6〉;〈xD,x9〉;〈xD,xD〉;〈x2,xE〉;〈x6,x2〉;〈x7,x5〉;〈xE,x7〉;〈x1,x8〉;〈x4,xD〉 ].
+
+ndefinition dTest_random_ex16 ≝
+[〈xD,x7〉;〈x5,x8〉;〈xA,x7〉;〈x5,xF〉;〈x9,x4〉;〈x8,x7〉;〈xA,x8〉;〈xE,x7〉;〈x2,xB〉;〈xF,x2〉;〈xE,x7〉;〈xB,x9〉;〈x0,x6〉;〈xA,xF〉;〈xD,xA〉;〈xD,xC〉
+;〈xC,x6〉;〈x3,xF〉;〈x8,xD〉;〈x7,x9〉;〈x9,x5〉;〈xD,xA〉;〈x5,xB〉;〈x9,x2〉;〈xE,xE〉;〈x3,xC〉;〈xF,xE〉;〈x4,x9〉;〈x5,xA〉;〈x1,x0〉;〈x4,xD〉;〈x8,x9〉 ].
+
+ndefinition dTest_random_ex17 ≝
+[〈x8,x3〉;〈x2,x6〉;〈xE,xC〉;〈x8,xD〉;〈xC,x9〉;〈x7,x7〉;〈xE,xE〉;〈xF,x1〉;〈x4,x0〉;〈x6,xD〉;〈x4,x9〉;〈x5,x7〉;〈x9,xB〉;〈xC,x4〉;〈x1,xF〉;〈x8,x0〉
+;〈x9,x5〉;〈xB,xC〉;〈xE,x8〉;〈xF,x9〉;〈xD,x7〉;〈x1,x4〉;〈x3,xE〉;〈xC,x3〉;〈x6,xF〉;〈x8,xF〉;〈x7,x2〉;〈xD,x5〉;〈xB,xE〉;〈x8,xA〉;〈xA,x3〉;〈xF,x7〉 ].
+
+ndefinition dTest_random_ex18 ≝
+[〈x6,x0〉;〈x3,xA〉;〈x7,x4〉;〈xF,xB〉;〈xB,xD〉;〈x7,x4〉;〈x8,x3〉;〈xE,x3〉;〈x9,xD〉;〈xD,x9〉;〈xB,x8〉;〈x1,x3〉;〈x5,x0〉;〈x4,x0〉;〈x8,xA〉;〈x9,x6〉
+;〈x3,xA〉;〈xA,x6〉;〈xE,xC〉;〈x7,xC〉;〈x1,x5〉;〈x8,x7〉;〈x4,xD〉;〈x6,xA〉;〈xA,xA〉;〈xE,x0〉;〈xB,xA〉;〈xF,xF〉;〈x3,xB〉;〈xE,x2〉;〈x5,x1〉;〈x2,x2〉 ].
+
+ndefinition dTest_random_ex19 ≝
+[〈x2,x2〉;〈x1,xF〉;〈xA,x1〉;〈x2,x1〉;〈xA,xF〉;〈x3,x7〉;〈x8,xA〉;〈xD,xF〉;〈xE,x3〉;〈x6,x9〉;〈xE,xE〉;〈xC,x4〉;〈xE,x7〉;〈x7,x1〉;〈x9,x6〉;〈x1,x1〉
+;〈xE,x4〉;〈x3,x9〉;〈xE,x5〉;〈xA,xF〉;〈xF,x5〉;〈x5,x7〉;〈xE,xB〉;〈x5,x5〉;〈x6,x5〉;〈x8,xB〉;〈x3,xE〉;〈x8,xD〉;〈x4,x6〉;〈x5,x3〉;〈xB,x2〉;〈x1,x9〉 ].
+
+ndefinition dTest_random_ex1A ≝
+[〈x3,x4〉;〈xE,x9〉;〈x4,xA〉;〈x4,xB〉;〈x5,x2〉;〈x3,x0〉;〈x3,xF〉;〈xA,x7〉;〈x4,xF〉;〈x1,xA〉;〈xB,x8〉;〈x6,x4〉;〈x5,xB〉;〈xD,x9〉;〈x6,xD〉;〈x6,x1〉
+;〈xA,x5〉;〈xC,xF〉;〈x8,xC〉;〈xD,xD〉;〈xE,x6〉;〈xD,x5〉;〈x3,x6〉;〈x0,xC〉;〈x8,xD〉;〈xF,x7〉;〈x4,xE〉;〈x9,xC〉;〈xB,xF〉;〈x2,xB〉;〈x4,x4〉;〈xD,x1〉 ].
+
+ndefinition dTest_random_ex1B ≝
+[〈xC,x0〉;〈x8,x0〉;〈x0,x8〉;〈xA,xD〉;〈xC,xE〉;〈xB,xD〉;〈x4,xC〉;〈x5,x3〉;〈x6,x5〉;〈xB,x6〉;〈x4,x8〉;〈xF,x6〉;〈x6,x4〉;〈x7,xC〉;〈x9,x8〉;〈x1,x0〉
+;〈x9,xD〉;〈xF,xD〉;〈x4,x9〉;〈xC,x4〉;〈xD,xD〉;〈x1,x4〉;〈xB,x6〉;〈x6,xF〉;〈x3,xB〉;〈x4,x6〉;〈xD,x7〉;〈x1,xA〉;〈x4,x4〉;〈xA,x4〉;〈x8,x1〉;〈x3,x1〉 ].
+
+ndefinition dTest_random_ex1C ≝
+[〈xA,x2〉;〈x4,x0〉;〈x7,x0〉;〈x3,x9〉;〈x9,xA〉;〈x4,xC〉;〈x4,xF〉;〈x9,x3〉;〈x9,xD〉;〈xD,x4〉;〈x9,x7〉;〈x3,x9〉;〈xA,x8〉;〈xA,x8〉;〈xF,x9〉;〈xB,x3〉
+;〈xE,x7〉;〈xD,x8〉;〈x4,xD〉;〈x6,xD〉;〈x8,x8〉;〈x6,xB〉;〈x5,x4〉;〈x5,x5〉;〈x9,x2〉;〈x1,x9〉;〈xE,x4〉;〈xB,x1〉;〈xE,x3〉;〈x4,x6〉;〈xD,x5〉;〈x6,xC〉 ].
+
+ndefinition dTest_random_ex1D ≝
+[〈xF,x9〉;〈x3,x3〉;〈xE,x5〉;〈xD,x2〉;〈x7,x7〉;〈x1,x8〉;〈x8,x6〉;〈x1,x4〉;〈x7,xE〉;〈x1,xE〉;〈xC,x8〉;〈xB,x4〉;〈xC,xE〉;〈xC,x7〉;〈x5,x7〉;〈x2,xD〉
+;〈x5,x2〉;〈xE,x7〉;〈x5,x7〉;〈x9,xB〉;〈x1,xA〉;〈x4,x9〉;〈x0,x9〉;〈x4,xB〉;〈xF,x6〉;〈xB,x5〉;〈x0,xA〉;〈x2,xC〉;〈xB,xA〉;〈x1,xF〉;〈x2,x6〉;〈x3,x8〉 ].
+
+ndefinition dTest_random_ex1E ≝
+[〈x6,x0〉;〈x3,x4〉;〈xC,x4〉;〈x8,x9〉;〈xB,xF〉;〈x0,x4〉;〈x5,xF〉;〈xF,x4〉;〈x1,x1〉;〈xF,x3〉;〈x4,xA〉;〈xE,x2〉;〈xD,x8〉;〈x3,x6〉;〈xF,xA〉;〈x4,x3〉
+;〈x0,xC〉;〈x6,x0〉;〈x5,x1〉;〈x2,xD〉;〈x0,x3〉;〈xF,xC〉;〈x9,x2〉;〈x2,x1〉;〈xC,xA〉;〈x7,x5〉;〈x6,x6〉;〈xD,xC〉;〈x8,x4〉;〈xC,x4〉;〈x6,xF〉;〈xF,x0〉 ].
+
+ndefinition dTest_random_ex1F ≝
+[〈x0,x4〉;〈x5,x2〉;〈xA,xB〉;〈x9,xA〉;〈xC,xE〉;〈xA,xA〉;〈x2,xF〉;〈x3,x6〉;〈xF,x3〉;〈xA,x7〉;〈x4,x2〉;〈x0,x7〉;〈x5,xE〉;〈xB,x6〉;〈x5,xB〉;〈x9,x8〉
+;〈x7,x9〉;〈x4,x3〉;〈x8,x8〉;〈x9,xA〉;〈x0,xA〉;〈x5,x5〉;〈xE,x3〉;〈x9,x8〉;〈x7,x5〉;〈xA,x2〉;〈xE,xA〉;〈xB,x9〉;〈x3,x2〉;〈x4,x1〉;〈x0,x7〉;〈x3,x8〉 ].
+
+ndefinition dTest_random_ex20 ≝
+[〈xB,x1〉;〈x0,x3〉;〈x4,xE〉;〈x6,xF〉;〈x9,x7〉;〈x3,xC〉;〈x5,x4〉;〈xB,xB〉;〈xB,xC〉;〈x0,xB〉;〈x0,xC〉;〈xA,xB〉;〈x3,xB〉;〈x2,x8〉;〈xA,xA〉;〈x0,x4〉
+;〈x5,x0〉;〈xA,x3〉;〈x6,xB〉;〈xF,xA〉;〈xF,x0〉;〈xE,x6〉;〈x1,x8〉;〈xD,x8〉;〈x7,xA〉;〈x5,xF〉;〈x0,x3〉;〈x8,x2〉;〈x9,x6〉;〈x9,xA〉;〈xB,xF〉;〈x1,x5〉 ].
+
+ndefinition dTest_random_ex21 ≝
+[〈x8,x5〉;〈xE,xF〉;〈xB,x3〉;〈x7,xB〉;〈xE,xE〉;〈xE,xF〉;〈x1,x0〉;〈x6,x9〉;〈xC,x2〉;〈xF,x9〉;〈x2,xD〉;〈x8,x1〉;〈xF,x3〉;〈x0,xE〉;〈xC,x3〉;〈x7,xF〉
+;〈xD,xD〉;〈x2,xE〉;〈x2,xA〉;〈xB,xD〉;〈xE,xA〉;〈x9,x2〉;〈xF,xF〉;〈xF,xA〉;〈x7,xB〉;〈xD,x3〉;〈x3,x0〉;〈x7,x5〉;〈x6,x7〉;〈xA,x8〉;〈x0,xF〉;〈x2,x1〉 ].
+
+ndefinition dTest_random_ex22 ≝
+[〈xD,xC〉;〈xE,x5〉;〈xE,x2〉;〈x8,x9〉;〈x2,x9〉;〈xC,x5〉;〈xA,x3〉;〈xA,x2〉;〈x4,x2〉;〈x3,xF〉;〈xA,x3〉;〈x5,x8〉;〈xE,x0〉;〈x7,xC〉;〈x0,x3〉;〈xF,xF〉
+;〈x2,x8〉;〈x8,xB〉;〈x8,xB〉;〈x1,x2〉;〈xD,x8〉;〈xA,x8〉;〈x7,x6〉;〈xB,x9〉;〈xE,x2〉;〈xF,xE〉;〈x2,x1〉;〈x3,xF〉;〈xA,xC〉;〈x4,x6〉;〈xB,xC〉;〈xF,x8〉 ].
+
+ndefinition dTest_random_ex23 ≝
+[〈xD,x3〉;〈xE,xB〉;〈xF,xC〉;〈x9,xF〉;〈xE,x7〉;〈x6,x1〉;〈xC,xB〉;〈xB,xF〉;〈x4,xE〉;〈xC,x4〉;〈x9,x7〉;〈x1,xE〉;〈x0,xD〉;〈x7,x9〉;〈x8,x3〉;〈xA,xB〉
+;〈x4,xC〉;〈x2,x6〉;〈x6,x3〉;〈x6,xF〉;〈xE,xE〉;〈x5,x9〉;〈x8,x1〉;〈x0,x2〉;〈x2,xC〉;〈xE,xD〉;〈x6,xF〉;〈x0,x4〉;〈x1,x0〉;〈xE,x0〉;〈xD,xA〉;〈xB,xE〉 ].
+
+ndefinition dTest_random_ex24 ≝
+[〈xE,xE〉;〈x5,x7〉;〈xB,x0〉;〈x3,x1〉;〈x4,x1〉;〈xD,xC〉;〈x3,xC〉;〈xC,xC〉;〈x5,x8〉;〈x2,x8〉;〈x2,xC〉;〈x1,xB〉;〈x8,x6〉;〈xD,x6〉;〈xF,x9〉;〈xD,x5〉
+;〈x4,xA〉;〈xE,xA〉;〈x0,xB〉;〈x2,x0〉;〈x2,xC〉;〈x4,x2〉;〈xC,xE〉;〈x4,x5〉;〈x2,xB〉;〈x0,x1〉;〈xA,xA〉;〈xB,x1〉;〈x6,xE〉;〈xB,x7〉;〈xB,x7〉;〈x2,x8〉 ].
+
+ndefinition dTest_random_ex25 ≝
+[〈x9,x5〉;〈x1,x9〉;〈xA,x7〉;〈x5,xC〉;〈x4,xE〉;〈x7,xB〉;〈x3,xE〉;〈xD,x3〉;〈x9,x0〉;〈x8,x6〉;〈x7,x1〉;〈x1,x4〉;〈xD,x2〉;〈xD,x4〉;〈xB,x4〉;〈xF,x2〉
+;〈x3,x1〉;〈x2,x8〉;〈x4,x5〉;〈xF,xD〉;〈x7,x8〉;〈x5,xD〉;〈xF,xA〉;〈xF,x3〉;〈x9,x5〉;〈x4,xD〉;〈x3,x1〉;〈xB,x8〉;〈xC,xC〉;〈x2,x1〉;〈x1,x9〉;〈x4,x2〉 ].
+
+ndefinition dTest_random_ex26 ≝
+[〈x2,xA〉;〈xF,x2〉;〈xB,xA〉;〈x0,x4〉;〈x9,xF〉;〈x4,x3〉;〈x4,x5〉;〈x1,xC〉;〈x7,x4〉;〈xB,xB〉;〈x7,x0〉;〈x5,xE〉;〈x0,x1〉;〈xA,xC〉;〈x6,xD〉;〈xD,x7〉
+;〈x9,xC〉;〈x9,xD〉;〈x1,xA〉;〈x9,x8〉;〈xB,x1〉;〈xF,xC〉;〈x6,x1〉;〈xA,x3〉;〈x4,x1〉;〈x4,x1〉;〈xA,xF〉;〈x1,xD〉;〈xE,x1〉;〈x3,x2〉;〈x1,x9〉;〈x6,x0〉 ].
+
+ndefinition dTest_random_ex27 ≝
+[〈x2,x9〉;〈x9,x7〉;〈x8,x5〉;〈x5,x3〉;〈x5,x3〉;〈x9,x1〉;〈xB,x3〉;〈x9,x4〉;〈xD,x5〉;〈x9,xD〉;〈x4,xC〉;〈x3,x6〉;〈x0,xE〉;〈x8,x4〉;〈xA,x1〉;〈x4,x6〉
+;〈x6,xA〉;〈x1,xF〉;〈xF,x3〉;〈x6,xB〉;〈xB,xE〉;〈x4,xA〉;〈x1,x9〉;〈x7,x5〉;〈xF,xC〉;〈xC,x6〉;〈xE,xA〉;〈x7,xE〉;〈xD,x1〉;〈x3,x3〉;〈x6,x7〉;〈xB,x7〉 ].
+
+ndefinition dTest_random_ex28 ≝
+[〈xE,xE〉;〈x5,x9〉;〈xE,x2〉;〈xD,xD〉;〈x2,x2〉;〈x8,xC〉;〈x9,xB〉;〈x3,xE〉;〈x9,x8〉;〈xF,xC〉;〈x1,x3〉;〈xE,x2〉;〈x0,xC〉;〈x4,xE〉;〈x3,x1〉;〈x8,x7〉
+;〈x6,x7〉;〈x6,xA〉;〈x4,xC〉;〈x4,xC〉;〈x7,x2〉;〈x0,x0〉;〈x0,x5〉;〈x1,xF〉;〈xF,x6〉;〈x3,x0〉;〈xE,xE〉;〈xD,xE〉;〈xB,x1〉;〈x4,xC〉;〈xF,x7〉;〈xE,xC〉 ].
+
+ndefinition dTest_random_ex29 ≝
+[〈x2,xC〉;〈x4,x0〉;〈x6,xB〉;〈x6,x8〉;〈x9,x0〉;〈x8,x8〉;〈x6,xF〉;〈xB,x3〉;〈x4,x7〉;〈x6,x2〉;〈x9,x2〉;〈x9,xB〉;〈x2,xB〉;〈x3,x2〉;〈x4,x0〉;〈xA,x7〉
+;〈x8,x9〉;〈x4,x0〉;〈x2,x3〉;〈x5,xC〉;〈xF,x9〉;〈x2,x9〉;〈x6,x2〉;〈xA,xE〉;〈x5,xB〉;〈xC,x9〉;〈x2,xC〉;〈x9,x2〉;〈x6,xF〉;〈xF,x5〉;〈xA,x0〉;〈x0,xE〉 ].
+
+ndefinition dTest_random_ex2A ≝
+[〈xD,xE〉;〈xF,x9〉;〈x0,x9〉;〈x1,x0〉;〈x3,x9〉;〈x4,x6〉;〈xC,x5〉;〈xE,x2〉;〈x8,x3〉;〈xD,x5〉;〈x8,xE〉;〈x4,x6〉;〈x4,xC〉;〈xA,xC〉;〈x7,xF〉;〈x4,xF〉
+;〈xC,x1〉;〈x4,xF〉;〈x1,xA〉;〈x6,x1〉;〈x9,x6〉;〈x0,xB〉;〈x0,x0〉;〈x6,xF〉;〈x2,x6〉;〈x8,xC〉;〈xE,xE〉;〈x9,x3〉;〈x1,xB〉;〈x9,xE〉;〈xA,x5〉;〈x9,x6〉 ].
+
+ndefinition dTest_random_ex2B ≝
+[〈x2,xA〉;〈xE,xB〉;〈x4,x6〉;〈x5,xF〉;〈x3,xC〉;〈xD,x6〉;〈x2,xD〉;〈x9,x4〉;〈x6,xB〉;〈xF,x4〉;〈xD,xA〉;〈x6,x9〉;〈x5,x9〉;〈xA,xC〉;〈xB,xD〉;〈x9,xE〉
+;〈x4,x8〉;〈x0,x2〉;〈xD,xC〉;〈x5,xC〉;〈x6,x0〉;〈x2,xA〉;〈x6,xE〉;〈xC,xA〉;〈x6,xE〉;〈x1,xF〉;〈xD,x4〉;〈x3,xA〉;〈xB,x0〉;〈x9,xE〉;〈x8,xF〉;〈xA,xB〉 ].
+
+ndefinition dTest_random_ex2C ≝
+[〈xB,x2〉;〈x0,x2〉;〈x4,x7〉;〈x7,xD〉;〈xA,xB〉;〈xD,xB〉;〈xB,x5〉;〈x6,xD〉;〈xE,x2〉;〈x8,x9〉;〈x4,xD〉;〈x0,x4〉;〈xB,xE〉;〈xF,xA〉;〈x2,x2〉;〈x1,x4〉
+;〈x7,x1〉;〈x1,x2〉;〈x1,xB〉;〈x0,xD〉;〈xB,xA〉;〈x5,xA〉;〈x6,xC〉;〈x1,xE〉;〈x3,xA〉;〈x0,xF〉;〈x6,xE〉;〈x4,x4〉;〈xC,x8〉;〈xB,x5〉;〈x8,xC〉;〈x0,x3〉 ].
+
+ndefinition dTest_random_ex2D ≝
+[〈x0,x6〉;〈x6,x4〉;〈x8,x5〉;〈x2,x8〉;〈x6,x4〉;〈x2,x2〉;〈x8,x1〉;〈x7,x6〉;〈xF,xE〉;〈xF,xA〉;〈x6,x2〉;〈x9,x1〉;〈xB,xE〉;〈xB,xC〉;〈x6,x1〉;〈x4,xB〉
+;〈x7,xE〉;〈x5,x0〉;〈xB,xC〉;〈xE,xE〉;〈x6,x3〉;〈xC,xF〉;〈x1,xD〉;〈xF,xD〉;〈x6,x2〉;〈x5,xC〉;〈x8,x5〉;〈x9,xE〉;〈xA,x5〉;〈x2,x6〉;〈xE,x7〉;〈x4,x6〉 ].
+
+ndefinition dTest_random_ex2E ≝
+[〈x3,xB〉;〈xE,xA〉;〈xB,xE〉;〈x0,x4〉;〈x8,x8〉;〈xF,x2〉;〈x9,x2〉;〈x0,xB〉;〈xD,x9〉;〈xE,x9〉;〈x2,x9〉;〈x3,x8〉;〈x8,x8〉;〈x8,xA〉;〈x6,x9〉;〈x1,x7〉
+;〈x4,xB〉;〈xB,xF〉;〈x0,xC〉;〈xF,x2〉;〈xF,xD〉;〈x7,x3〉;〈x5,x9〉;〈xB,xE〉;〈x5,x4〉;〈x1,xC〉;〈xD,x3〉;〈x3,x1〉;〈x6,x2〉;〈x1,xB〉;〈xB,x7〉;〈x3,x2〉 ].
+
+ndefinition dTest_random_ex2F ≝
+[〈xA,x4〉;〈xF,x1〉;〈x7,x0〉;〈x9,xA〉;〈x4,x6〉;〈xA,x1〉;〈x1,xC〉;〈x0,x4〉;〈x6,xC〉;〈xF,x2〉;〈xE,x6〉;〈xC,x1〉;〈xA,x4〉;〈xF,x2〉;〈x2,xA〉;〈x4,xB〉
+;〈x3,x5〉;〈x9,xB〉;〈x9,x9〉;〈xF,xF〉;〈x0,x1〉;〈x1,x3〉;〈xF,x9〉;〈x5,xC〉;〈x3,xC〉;〈x5,x1〉;〈x8,xA〉;〈xA,x5〉;〈x5,xF〉;〈x9,xE〉;〈x5,xE〉;〈xC,x6〉 ].
+
+ndefinition dTest_random_ex30 ≝
+[〈x2,x1〉;〈x3,x7〉;〈xD,x2〉;〈xB,x9〉;〈x9,x8〉;〈xA,x1〉;〈x6,x0〉;〈xE,x9〉;〈x4,x5〉;〈xC,xA〉;〈xD,x7〉;〈xB,xD〉;〈xC,xF〉;〈x0,xF〉;〈x2,x4〉;〈xE,x5〉
+;〈x7,x9〉;〈x4,xB〉;〈x1,xC〉;〈x5,x7〉;〈x3,xA〉;〈x2,x4〉;〈x2,x2〉;〈x0,x8〉;〈x3,x3〉;〈xE,x2〉;〈xA,x2〉;〈x5,x8〉;〈x2,x5〉;〈x5,x4〉;〈x7,x1〉;〈x2,xB〉 ].
+
+ndefinition dTest_random_ex31 ≝
+[〈xF,xF〉;〈xE,xD〉;〈x4,x8〉;〈xF,x6〉;〈x2,x3〉;〈x3,x1〉;〈xB,xA〉;〈x5,x1〉;〈x9,xF〉;〈xA,xA〉;〈xC,xC〉;〈x0,x3〉;〈x1,x5〉;〈xC,x7〉;〈x2,xD〉;〈xD,x3〉
+;〈xE,xB〉;〈x8,xF〉;〈x8,x4〉;〈x4,x0〉;〈x5,x3〉;〈xA,xD〉;〈x6,x7〉;〈xE,xC〉;〈xA,xF〉;〈xD,xC〉;〈x1,xC〉;〈x7,x4〉;〈x6,xB〉;〈xA,xD〉;〈xC,xD〉;〈xA,x7〉 ].
+
+ndefinition dTest_random_ex32 ≝
+[〈x1,x1〉;〈x1,x0〉;〈xC,xF〉;〈xB,xE〉;〈xA,x1〉;〈x0,x1〉;〈x3,xF〉;〈xC,x0〉;〈x8,x5〉;〈x2,x8〉;〈x6,xB〉;〈xC,x3〉;〈x6,xD〉;〈xD,x8〉;〈x7,x5〉;〈x5,xA〉
+;〈xF,x0〉;〈x2,x2〉;〈x4,xB〉;〈x9,xC〉;〈x3,x1〉;〈xE,x4〉;〈xE,x7〉;〈xC,x6〉;〈xF,xC〉;〈x3,x0〉;〈xD,x5〉;〈xF,x9〉;〈x1,xA〉;〈x4,x0〉;〈x1,xF〉;〈x6,xD〉 ].
+
+ndefinition dTest_random_ex33 ≝
+[〈xD,x5〉;〈x7,x8〉;〈xB,x5〉;〈x7,x6〉;〈xC,x9〉;〈xE,x1〉;〈xD,xF〉;〈x1,x2〉;〈x6,x1〉;〈xD,xF〉;〈x9,xF〉;〈x5,x7〉;〈x7,xD〉;〈x0,xB〉;〈xA,xD〉;〈x5,xA〉
+;〈xA,x1〉;〈x8,x4〉;〈xE,x5〉;〈xF,x7〉;〈xB,xC〉;〈xD,x3〉;〈xA,x5〉;〈xB,x4〉;〈x8,x5〉;〈x6,x7〉;〈x3,x6〉;〈xF,xC〉;〈xB,x1〉;〈xB,x3〉;〈xC,xB〉;〈x1,xE〉 ].
+
+ndefinition dTest_random_ex34 ≝
+[〈xE,xC〉;〈x6,xE〉;〈xE,x1〉;〈x1,xC〉;〈xA,x5〉;〈x5,x3〉;〈x9,x8〉;〈xF,x6〉;〈xD,xF〉;〈x4,x1〉;〈x1,x3〉;〈x2,xE〉;〈x7,xF〉;〈x0,xE〉;〈x3,x8〉;〈x3,xC〉
+;〈xD,x4〉;〈x8,xC〉;〈x2,xA〉;〈x2,x8〉;〈x4,xE〉;〈x7,xE〉;〈x0,xE〉;〈xF,x7〉;〈xC,xA〉;〈x3,xE〉;〈xE,x4〉;〈xB,x4〉;〈x0,x5〉;〈x5,x8〉;〈xD,xC〉;〈x7,x8〉 ].
+
+ndefinition dTest_random_ex35 ≝
+[〈xD,x9〉;〈xF,x9〉;〈x7,x9〉;〈x8,x4〉;〈x0,x2〉;〈x3,xF〉;〈xC,xF〉;〈x3,x8〉;〈xD,x7〉;〈x2,x6〉;〈x1,xD〉;〈x1,x8〉;〈x4,xD〉;〈xE,xA〉;〈x7,xA〉;〈xD,x4〉
+;〈x2,x4〉;〈x0,xD〉;〈x4,xD〉;〈x9,x0〉;〈x1,x7〉;〈x1,xE〉;〈x6,xE〉;〈xB,x6〉;〈xC,xC〉;〈xC,x0〉;〈xB,x0〉;〈x5,xE〉;〈x9,x9〉;〈x6,xD〉;〈xC,xF〉;〈xE,xE〉 ].
+
+ndefinition dTest_random_ex36 ≝
+[〈x2,x9〉;〈xC,xF〉;〈xA,x2〉;〈x0,xC〉;〈xA,xB〉;〈x7,x4〉;〈x2,x9〉;〈x4,xE〉;〈x8,x2〉;〈x9,x3〉;〈x6,x9〉;〈x7,xB〉;〈xE,xC〉;〈xC,x7〉;〈x8,x9〉;〈xC,xA〉
+;〈xD,xD〉;〈xA,xC〉;〈x6,x5〉;〈x8,x0〉;〈x1,x4〉;〈x0,x9〉;〈x5,x5〉;〈x0,xE〉;〈x8,x4〉;〈x5,xE〉;〈x6,xF〉;〈x3,x4〉;〈x1,x8〉;〈xC,x9〉;〈x8,xB〉;〈xE,x4〉 ].
+
+ndefinition dTest_random_ex37 ≝
+[〈x3,xE〉;〈xC,x4〉;〈x1,x6〉;〈xA,x4〉;〈x1,x9〉;〈x3,x4〉;〈x0,xE〉;〈x5,xE〉;〈xF,x9〉;〈x0,x3〉;〈x1,x3〉;〈x7,x2〉;〈x2,x7〉;〈x2,x8〉;〈xA,x7〉;〈x6,xD〉
+;〈xC,x1〉;〈x1,xD〉;〈xF,x0〉;〈x2,x8〉;〈xF,xB〉;〈xF,x6〉;〈x3,x8〉;〈x0,x1〉;〈xF,x9〉;〈xB,xC〉;〈x6,x6〉;〈xF,x8〉;〈x6,xE〉;〈xD,x1〉;〈xB,x5〉;〈x3,x8〉 ].
+
+ndefinition dTest_random_ex38 ≝
+[〈x4,x3〉;〈xB,x6〉;〈x6,x8〉;〈xA,xC〉;〈x0,x9〉;〈xF,xD〉;〈x0,x9〉;〈x6,x8〉;〈xE,x0〉;〈x2,x2〉;〈xA,xF〉;〈x4,x0〉;〈x2,x6〉;〈x0,xC〉;〈x5,x2〉;〈xA,x7〉
+;〈xA,xD〉;〈xC,x3〉;〈x8,x2〉;〈xD,xC〉;〈x3,xC〉;〈x6,x5〉;〈xF,x2〉;〈xE,x8〉;〈xC,x0〉;〈x0,x6〉;〈x6,x4〉;〈xB,x1〉;〈x2,x0〉;〈x9,x5〉;〈x2,x2〉;〈xD,xD〉 ].
+
+ndefinition dTest_random_ex39 ≝
+[〈xA,xD〉;〈xF,xF〉;〈x1,xB〉;〈x8,xB〉;〈xB,x6〉;〈x4,xA〉;〈xB,xB〉;〈x9,x8〉;〈x1,xA〉;〈xE,xC〉;〈x7,xB〉;〈xA,x6〉;〈x2,xC〉;〈xE,x1〉;〈xC,x7〉;〈xD,xC〉
+;〈x1,x9〉;〈x0,x6〉;〈x0,xA〉;〈x9,xF〉;〈x5,x2〉;〈x2,xB〉;〈xC,xA〉;〈x2,xF〉;〈x4,x0〉;〈xF,x8〉;〈xE,xA〉;〈x8,x7〉;〈x8,x9〉;〈xF,xD〉;〈x5,xD〉;〈x0,x0〉 ].
+
+ndefinition dTest_random_ex3A ≝
+[〈x6,xE〉;〈x0,x0〉;〈x0,xD〉;〈x3,x0〉;〈x4,x3〉;〈x5,xA〉;〈x8,xF〉;〈x8,xA〉;〈xA,x4〉;〈x5,x0〉;〈x8,xF〉;〈x0,xC〉;〈x7,x7〉;〈xF,x2〉;〈x6,x5〉;〈xE,x4〉
+;〈x2,xD〉;〈xE,x5〉;〈xA,x8〉;〈x7,xF〉;〈x7,x8〉;〈xE,x3〉;〈x9,x5〉;〈xD,xA〉;〈x0,x7〉;〈x2,x9〉;〈x5,x1〉;〈x9,x4〉;〈xE,x4〉;〈x0,x1〉;〈xB,xF〉;〈x6,xE〉 ].
+
+ndefinition dTest_random_ex3B ≝
+[〈x9,x8〉;〈x9,xC〉;〈x9,x0〉;〈xA,x8〉;〈x0,xA〉;〈x3,xD〉;〈x3,xC〉;〈x5,x0〉;〈xE,xB〉;〈x1,x2〉;〈xC,x4〉;〈x5,xF〉;〈x4,x7〉;〈x7,xB〉;〈x2,xC〉;〈xD,xF〉
+;〈x7,x8〉;〈x1,x3〉;〈x7,x4〉;〈xE,x0〉;〈x7,xB〉;〈x7,x1〉;〈x4,x7〉;〈x4,x8〉;〈x1,xB〉;〈xE,x3〉;〈x6,xB〉;〈x0,xB〉;〈x4,xB〉;〈x5,x9〉;〈x9,x3〉;〈xD,xF〉 ].
+
+ndefinition dTest_random_ex3C ≝
+[〈xE,x1〉;〈x1,xB〉;〈xD,x0〉;〈xE,xD〉;〈x4,x7〉;〈x4,xD〉;〈xC,x2〉;〈xD,xE〉;〈x5,xC〉;〈xD,xA〉;〈x9,x5〉;〈xC,x8〉;〈x1,x0〉;〈x7,x7〉;〈x7,xF〉;〈xC,x0〉
+;〈xA,x7〉;〈xD,x3〉;〈xD,x3〉;〈xD,x8〉;〈x3,x4〉;〈xA,x1〉;〈x1,x5〉;〈xE,x0〉;〈x0,x4〉;〈x1,xE〉;〈x8,x2〉;〈xC,xA〉;〈xD,x9〉;〈x1,x1〉;〈xB,x1〉;〈xC,x9〉 ].
+
+ndefinition dTest_random_ex3D ≝
+[〈x4,xC〉;〈x4,xB〉;〈x0,x9〉;〈x4,x8〉;〈xF,xC〉;〈xD,xD〉;〈x6,xE〉;〈xC,xA〉;〈x7,x6〉;〈xA,xE〉;〈x8,xE〉;〈x3,xB〉;〈xF,xB〉;〈x6,x5〉;〈x8,x3〉;〈x1,xD〉
+;〈xD,xB〉;〈xA,xE〉;〈x4,xF〉;〈xC,x6〉;〈x1,xE〉;〈xC,x5〉;〈xC,xC〉;〈x7,xC〉;〈x2,x8〉;〈xF,x9〉;〈xD,x2〉;〈x8,x6〉;〈x1,x5〉;〈xF,xA〉;〈x4,x1〉;〈x4,x5〉 ].
+
+ndefinition dTest_random_ex3E ≝
+[〈x2,xE〉;〈x9,x5〉;〈xB,xF〉;〈x0,xD〉;〈x8,xB〉;〈x8,xD〉;〈x1,x1〉;〈x9,xC〉;〈xB,x8〉;〈xF,xB〉;〈x2,x6〉;〈xD,x6〉;〈x9,x1〉;〈x0,xD〉;〈xC,xD〉;〈x0,x7〉
+;〈x5,x0〉;〈xF,xA〉;〈x2,x9〉;〈x3,xF〉;〈x0,xC〉;〈x2,xB〉;〈xF,xE〉;〈x9,x7〉;〈x5,x5〉;〈x5,xA〉;〈x6,xD〉;〈x9,x6〉;〈x0,x5〉;〈x0,x9〉;〈x4,x5〉;〈xE,xF〉 ].
+
+ndefinition dTest_random_ex3F ≝
+[〈x0,xF〉;〈x7,x4〉;〈x9,x3〉;〈x6,xC〉;〈x8,x2〉;〈x3,x7〉;〈xE,xB〉;〈x5,x0〉;〈xF,x5〉;〈xC,x4〉;〈x0,xB〉;〈x3,x8〉;〈x2,xD〉;〈x8,xA〉;〈x9,x3〉;〈x6,xD〉
+;〈x1,xD〉;〈xE,x5〉;〈xF,x7〉;〈xE,x7〉;〈xD,x7〉;〈x5,xC〉;〈xB,x4〉;〈x5,x0〉;〈x7,x5〉;〈x0,xD〉;〈xF,x3〉;〈xC,xE〉;〈x3,x1〉;〈xF,x1〉;〈x8,xE〉;〈x8,xF〉 ].
+
+ndefinition dTest_random_ex40 ≝
+[〈xD,xB〉;〈x1,x4〉;〈xF,x6〉;〈x0,x3〉;〈xA,xB〉;〈xA,xE〉;〈xB,xC〉;〈xE,xB〉;〈xC,x8〉;〈x6,x7〉;〈xC,xC〉;〈xF,xF〉;〈x4,xF〉;〈xC,x6〉;〈x2,x9〉;〈x9,x5〉
+;〈xB,xC〉;〈x6,x5〉;〈x5,x2〉;〈xF,x2〉;〈x3,x5〉;〈xC,x4〉;〈xF,x4〉;〈x9,xB〉;〈x4,x5〉;〈x1,xC〉;〈xD,xB〉;〈x6,x1〉;〈xF,xE〉;〈x3,xF〉;〈xB,x9〉;〈xD,x8〉 ].
+
+ndefinition dTest_random_ex41 ≝
+[〈xF,x1〉;〈xA,xC〉;〈x0,x7〉;〈xA,x4〉;〈xB,x8〉;〈x8,x8〉;〈x9,x5〉;〈xB,x8〉;〈x5,x6〉;〈x3,x2〉;〈x5,xA〉;〈x3,xE〉;〈x2,x2〉;〈x0,xB〉;〈x9,x6〉;〈xE,xE〉
+;〈x6,xF〉;〈x1,xE〉;〈x3,x2〉;〈x4,x9〉;〈x4,xF〉;〈xC,xC〉;〈xD,xB〉;〈x5,x1〉;〈x4,xD〉;〈xD,x1〉;〈x4,xF〉;〈x0,x9〉;〈x5,xA〉;〈xA,xC〉;〈xE,x7〉;〈x8,x6〉 ].
+
+ndefinition dTest_random_ex42 ≝
+[〈x5,x8〉;〈xA,x5〉;〈xA,x7〉;〈x5,xE〉;〈x3,x6〉;〈x1,x1〉;〈x3,xA〉;〈x8,x9〉;〈x8,x2〉;〈xD,xC〉;〈x6,x2〉;〈x0,xE〉;〈xA,xB〉;〈x2,xB〉;〈x2,x5〉;〈xF,x9〉
+;〈x7,x7〉;〈x8,x6〉;〈x1,xD〉;〈x7,x9〉;〈x5,x1〉;〈xB,xD〉;〈x9,x8〉;〈xB,x7〉;〈xB,xB〉;〈xF,x6〉;〈xD,x9〉;〈x6,x6〉;〈x0,x1〉;〈x1,x2〉;〈xE,xB〉;〈x0,xA〉 ].
+
+ndefinition dTest_random_ex43 ≝
+[〈xC,xD〉;〈x1,xA〉;〈xA,xA〉;〈xC,xC〉;〈x6,x5〉;〈x4,x2〉;〈x8,xF〉;〈x2,xA〉;〈x4,x8〉;〈xC,x6〉;〈xB,xA〉;〈xD,x8〉;〈x2,xD〉;〈x2,x9〉;〈xE,x8〉;〈x5,x7〉
+;〈x7,x7〉;〈x7,xA〉;〈xB,x4〉;〈x4,x9〉;〈x6,x5〉;〈x4,x3〉;〈x5,x7〉;〈xF,xE〉;〈xC,x6〉;〈xC,x7〉;〈x6,x2〉;〈x6,x7〉;〈x5,x8〉;〈xD,x6〉;〈x9,xA〉;〈xC,x8〉 ].
+
+ndefinition dTest_random_ex44 ≝
+[〈xE,x8〉;〈x3,x0〉;〈x6,x0〉;〈x7,x3〉;〈x8,x9〉;〈x2,x3〉;〈x0,x8〉;〈x7,xA〉;〈xA,xC〉;〈x5,xD〉;〈x6,xD〉;〈xC,xE〉;〈x0,xC〉;〈x1,xB〉;〈x1,x7〉;〈xC,x1〉
+;〈x4,x2〉;〈x5,x3〉;〈x1,x5〉;〈x7,xC〉;〈x7,x4〉;〈x2,xB〉;〈x2,x5〉;〈x5,x6〉;〈x6,x1〉;〈xE,xC〉;〈x0,xB〉;〈x4,x2〉;〈x0,x4〉;〈xC,xA〉;〈x0,x9〉;〈xA,xB〉 ].
+
+ndefinition dTest_random_ex45 ≝
+[〈x1,xB〉;〈xD,x0〉;〈x9,xF〉;〈x6,xA〉;〈x7,xF〉;〈x4,x1〉;〈xF,x8〉;〈xE,xA〉;〈x8,x2〉;〈x8,x1〉;〈x4,x1〉;〈xC,xE〉;〈xC,xE〉;〈x0,xD〉;〈x2,xB〉;〈x3,x3〉
+;〈xA,x3〉;〈x6,x4〉;〈xF,xA〉;〈xA,x6〉;〈x3,x9〉;〈x7,xF〉;〈xF,x6〉;〈xB,x2〉;〈x5,x5〉;〈x6,xB〉;〈xA,xC〉;〈x3,x3〉;〈x9,x3〉;〈xE,x7〉;〈xB,xE〉;〈x3,x4〉 ].
+
+ndefinition dTest_random_ex46 ≝
+[〈xC,xF〉;〈xE,xF〉;〈xA,x2〉;〈xE,xE〉;〈xE,xD〉;〈xC,xB〉;〈xB,x0〉;〈x8,x9〉;〈xD,xA〉;〈x3,xB〉;〈xB,xE〉;〈x3,xE〉;〈x3,x3〉;〈x5,x1〉;〈xA,x5〉;〈x3,xC〉
+;〈xC,xC〉;〈xA,x0〉;〈xF,xD〉;〈x3,x9〉;〈xC,xB〉;〈xF,xC〉;〈x1,xF〉;〈x8,xD〉;〈x6,x8〉;〈xD,x4〉;〈x8,xC〉;〈xA,xA〉;〈x8,xE〉;〈x3,xA〉;〈x9,x7〉;〈x2,x6〉 ].
+
+ndefinition dTest_random_ex47 ≝
+[〈x6,xB〉;〈xA,xC〉;〈x8,xA〉;〈x4,xB〉;〈x7,x4〉;〈x3,xF〉;〈xB,x7〉;〈xB,xF〉;〈x0,xC〉;〈xE,x6〉;〈xC,xD〉;〈x4,x2〉;〈xF,xA〉;〈xE,xE〉;〈xF,x9〉;〈x0,xC〉
+;〈x2,xC〉;〈x7,x9〉;〈x7,xE〉;〈xD,x8〉;〈x4,x0〉;〈x7,xC〉;〈x3,x8〉;〈x4,x9〉;〈x7,x1〉;〈x7,x5〉;〈xB,x7〉;〈x3,x6〉;〈x0,x7〉;〈x1,xA〉;〈x2,xC〉;〈x1,xE〉 ].
+
+ndefinition dTest_random_ex48 ≝
+[〈x3,xC〉;〈x7,xA〉;〈x3,x8〉;〈x4,xA〉;〈x3,x4〉;〈x2,x0〉;〈x9,x5〉;〈x6,x0〉;〈xF,x7〉;〈xC,x3〉;〈xB,x1〉;〈x6,xE〉;〈xB,x1〉;〈x7,x0〉;〈x7,x4〉;〈x3,xB〉
+;〈x0,xD〉;〈x6,xD〉;〈xF,xB〉;〈xE,x5〉;〈xE,x2〉;〈x6,x6〉;〈x6,x8〉;〈x0,x8〉;〈xF,xB〉;〈x3,xC〉;〈x8,xC〉;〈xD,xD〉;〈x0,x2〉;〈x2,xE〉;〈x6,xE〉;〈xF,x1〉 ].
+
+ndefinition dTest_random_ex49 ≝
+[〈xA,xF〉;〈x7,x9〉;〈x6,x7〉;〈xE,x2〉;〈x4,xC〉;〈xA,x5〉;〈x7,x9〉;〈xC,x6〉;〈xB,x5〉;〈xA,xF〉;〈x1,x5〉;〈xF,xE〉;〈xE,x2〉;〈x2,xB〉;〈xC,xA〉;〈xE,x6〉
+;〈x3,xE〉;〈x2,xC〉;〈x5,x8〉;〈x7,x2〉;〈xC,xE〉;〈x7,x1〉;〈x8,xC〉;〈xB,xE〉;〈x2,x0〉;〈x6,x6〉;〈x0,x7〉;〈x6,xF〉;〈xD,x1〉;〈x8,x2〉;〈x3,x1〉;〈xF,x3〉 ].
+
+ndefinition dTest_random_ex4A ≝
+[〈x9,x5〉;〈x9,x1〉;〈x1,x2〉;〈xF,x3〉;〈x4,xF〉;〈x6,xC〉;〈xA,x6〉;〈x8,xE〉;〈xB,x2〉;〈x7,x8〉;〈xD,xE〉;〈x7,x9〉;〈xC,x5〉;〈x2,x2〉;〈xF,x3〉;〈x0,x7〉
+;〈xE,x7〉;〈x9,xE〉;〈x9,x2〉;〈x7,x3〉;〈x3,xC〉;〈xA,x1〉;〈xD,xA〉;〈x2,x1〉;〈x2,x3〉;〈x4,x5〉;〈xE,x5〉;〈x7,x4〉;〈x8,x4〉;〈xC,x2〉;〈x6,x8〉;〈x3,x5〉 ].
+
+ndefinition dTest_random_ex4B ≝
+[〈x9,xA〉;〈xC,x8〉;〈x2,xE〉;〈x1,xD〉;〈xD,x1〉;〈xA,x6〉;〈xD,xF〉;〈x0,x6〉;〈x7,xF〉;〈x8,xC〉;〈x2,x8〉;〈xF,x6〉;〈xC,x3〉;〈xF,x8〉;〈x6,x2〉;〈xF,x9〉
+;〈x5,x7〉;〈x2,x7〉;〈xD,x1〉;〈xD,x3〉;〈x0,xB〉;〈xA,x3〉;〈x8,x7〉;〈x8,x3〉;〈xC,x9〉;〈x1,x4〉;〈xB,x4〉;〈xC,x5〉;〈xE,xD〉;〈x5,x4〉;〈xE,x1〉;〈xB,x9〉 ].
+
+ndefinition dTest_random_ex4C ≝
+[〈x2,x9〉;〈x6,xF〉;〈xE,x3〉;〈x0,xD〉;〈xC,xC〉;〈xF,x6〉;〈x0,xD〉;〈x2,x4〉;〈x4,x5〉;〈x6,xE〉;〈xE,x4〉;〈xD,xB〉;〈xF,x9〉;〈xC,x1〉;〈xD,x4〉;〈xB,x4〉
+;〈xB,x5〉;〈x6,x6〉;〈x1,xC〉;〈x6,xE〉;〈xA,xF〉;〈x4,x0〉;〈xE,x6〉;〈x4,x9〉;〈x7,xE〉;〈x4,x1〉;〈x1,x8〉;〈x8,x7〉;〈xD,xF〉;〈xB,xB〉;〈x6,x0〉;〈x0,x5〉 ].
+
+ndefinition dTest_random_ex4D ≝
+[〈xF,x4〉;〈x5,xD〉;〈xA,x1〉;〈xD,x6〉;〈x6,x7〉;〈x2,xA〉;〈xC,x8〉;〈x7,x7〉;〈xF,x9〉;〈x8,xA〉;〈xF,x9〉;〈x2,x6〉;〈xE,xF〉;〈x7,x4〉;〈x5,x8〉;〈x6,xA〉
+;〈xC,x8〉;〈x3,x5〉;〈x1,x0〉;〈xC,x5〉;〈x1,xE〉;〈x0,xB〉;〈x8,x3〉;〈x6,xA〉;〈x4,x4〉;〈x8,xD〉;〈x5,xC〉;〈xF,xB〉;〈xF,xE〉;〈x9,x2〉;〈x0,x3〉;〈x4,x3〉 ].
+
+ndefinition dTest_random_ex4E ≝
+[〈x0,x5〉;〈xA,xF〉;〈xC,x0〉;〈xF,x3〉;〈x0,x4〉;〈x2,x8〉;〈x9,xD〉;〈x0,x9〉;〈x3,x5〉;〈xE,x3〉;〈x5,xF〉;〈x4,x5〉;〈xA,xB〉;〈xC,xD〉;〈x8,xC〉;〈xF,xD〉
+;〈x2,xC〉;〈x9,xD〉;〈xA,xF〉;〈x6,x4〉;〈x4,x3〉;〈x8,x0〉;〈x8,x2〉;〈xE,x5〉;〈x8,xE〉;〈x3,xD〉;〈x2,xD〉;〈xD,xB〉;〈xD,xF〉;〈xA,xB〉;〈x0,x8〉;〈x1,x6〉 ].
+
+ndefinition dTest_random_ex4F ≝
+[〈xE,xC〉;〈x7,xE〉;〈xA,x7〉;〈xC,xB〉;〈xD,x8〉;〈x5,xC〉;〈x2,xC〉;〈x8,x8〉;〈x9,x8〉;〈xC,x2〉;〈xA,xD〉;〈x1,xD〉;〈xB,x0〉;〈xB,x1〉;〈xC,xE〉;〈x9,x3〉
+;〈xE,x2〉;〈xF,x4〉;〈xD,xB〉;〈xA,x5〉;〈xB,x6〉;〈x4,x9〉;〈x8,x7〉;〈x1,xD〉;〈xA,x2〉;〈x7,x9〉;〈x3,x5〉;〈xB,xE〉;〈x5,x5〉;〈xC,xD〉;〈x6,x3〉;〈x2,xC〉 ].
+
+ndefinition dTest_random_ex50 ≝
+[〈x1,x0〉;〈x1,xF〉;〈xE,xC〉;〈x3,xB〉;〈x8,xA〉;〈x3,xF〉;〈x3,x8〉;〈x8,x0〉;〈x1,xC〉;〈x2,xD〉;〈x9,x2〉;〈x5,xF〉;〈xE,x1〉;〈xB,x5〉;〈xB,xC〉;〈x8,x3〉
+;〈xB,x6〉;〈x1,xB〉;〈xE,xD〉;〈x4,xF〉;〈x3,xA〉;〈xC,x4〉;〈xF,xE〉;〈xF,xF〉;〈xC,xB〉;〈x8,x1〉;〈x6,x7〉;〈xC,x2〉;〈x5,x9〉;〈xD,xA〉;〈x0,xA〉;〈x9,xC〉 ].
+
+ndefinition dTest_random_ex51 ≝
+[〈x2,x2〉;〈xE,xB〉;〈x9,x3〉;〈xE,x2〉;〈x7,xF〉;〈xA,xC〉;〈x4,xA〉;〈x8,x2〉;〈x8,x1〉;〈x3,xF〉;〈xE,xB〉;〈x8,xB〉;〈x0,xF〉;〈x9,xC〉;〈x4,x1〉;〈x8,x2〉
+;〈x9,xB〉;〈x7,xC〉;〈x5,x1〉;〈xA,x7〉;〈xA,xB〉;〈xA,xD〉;〈x9,x2〉;〈x1,x9〉;〈xF,x0〉;〈xF,xD〉;〈x9,x3〉;〈xF,x6〉;〈xA,xD〉;〈x2,x4〉;〈xC,xB〉;〈xD,xE〉 ].
+
+ndefinition dTest_random_ex52 ≝
+[〈xB,x5〉;〈xA,xB〉;〈x8,x1〉;〈x5,x4〉;〈xA,xE〉;〈x2,x4〉;〈x6,x4〉;〈xD,x2〉;〈xD,x0〉;〈xF,xE〉;〈x3,x3〉;〈x2,xA〉;〈x7,x5〉;〈x0,x7〉;〈x8,xF〉;〈x3,xA〉
+;〈x1,x2〉;〈x9,xF〉;〈xB,xE〉;〈x1,xB〉;〈x1,xB〉;〈x1,xF〉;〈xC,x7〉;〈xF,x1〉;〈x7,xC〉;〈x9,x1〉;〈x5,xD〉;〈x3,x2〉;〈xD,x9〉;〈xD,x6〉;〈xE,xA〉;〈x0,x6〉 ].
+
+ndefinition dTest_random_ex53 ≝
+[〈x5,xB〉;〈x6,x9〉;〈x6,xB〉;〈xA,xC〉;〈x0,x9〉;〈x1,x6〉;〈xA,x3〉;〈xC,xA〉;〈x8,xE〉;〈x8,x3〉;〈x3,x4〉;〈xB,x7〉;〈x4,x1〉;〈x2,x7〉;〈xB,x3〉;〈x0,x1〉
+;〈xE,x6〉;〈x0,x6〉;〈x8,xC〉;〈x0,x4〉;〈x3,xD〉;〈xB,xE〉;〈x2,xC〉;〈x6,x6〉;〈xB,x5〉;〈x8,x6〉;〈x1,x1〉;〈x1,x3〉;〈x6,xD〉;〈xD,x0〉;〈xB,xE〉;〈x8,xD〉 ].
+
+ndefinition dTest_random_ex54 ≝
+[〈xC,x7〉;〈x5,x5〉;〈x0,x2〉;〈xC,x1〉;〈x7,x6〉;〈x5,xF〉;〈x2,x0〉;〈x5,xE〉;〈xE,x4〉;〈x3,xE〉;〈x7,x7〉;〈xE,x1〉;〈x3,xF〉;〈xE,x8〉;〈x6,xC〉;〈x4,xA〉
+;〈xA,x0〉;〈xF,xE〉;〈xC,xE〉;〈x3,xF〉;〈x6,x7〉;〈x9,x4〉;〈x3,xF〉;〈xE,xF〉;〈xE,xF〉;〈x8,x6〉;〈xD,x9〉;〈x4,xA〉;〈x0,x8〉;〈x8,xB〉;〈xC,x8〉;〈x1,xC〉 ].
+
+ndefinition dTest_random_ex55 ≝
+[〈xA,xD〉;〈x2,x0〉;〈xA,x7〉;〈x8,xC〉;〈x0,x6〉;〈x6,x7〉;〈xA,xF〉;〈x7,x3〉;〈xC,xD〉;〈x1,x6〉;〈x8,x4〉;〈x3,x2〉;〈xD,x0〉;〈xF,x3〉;〈xD,xC〉;〈xD,xB〉
+;〈xB,x7〉;〈x2,x4〉;〈x6,xA〉;〈x6,x3〉;〈x1,xC〉;〈xA,x1〉;〈xD,xE〉;〈xB,xC〉;〈x9,x2〉;〈xF,x1〉;〈x5,xC〉;〈xE,x7〉;〈xE,x0〉;〈xD,x5〉;〈xA,x4〉;〈x4,xA〉 ].
+
+ndefinition dTest_random_ex56 ≝
+[〈x0,x0〉;〈xD,x6〉;〈x2,x2〉;〈x9,xC〉;〈x5,x2〉;〈x8,xF〉;〈xE,x8〉;〈x2,x2〉;〈xA,x2〉;〈xF,x0〉;〈x9,x8〉;〈x3,x8〉;〈x0,xD〉;〈xF,x6〉;〈x4,x3〉;〈x7,x9〉
+;〈x8,x2〉;〈xA,xF〉;〈xD,x5〉;〈xC,x1〉;〈x8,x2〉;〈x5,x2〉;〈xD,xB〉;〈x8,xF〉;〈x7,xE〉;〈xD,x1〉;〈x9,xD〉;〈xA,x6〉;〈x8,xE〉;〈x9,xE〉;〈xA,x9〉;〈x8,xE〉 ].
+
+ndefinition dTest_random_ex57 ≝
+[〈xD,x1〉;〈xF,x6〉;〈xB,x0〉;〈xE,xA〉;〈x8,x3〉;〈xE,x9〉;〈xF,x7〉;〈x3,xB〉;〈x4,xA〉;〈x0,x9〉;〈x1,xE〉;〈x3,x2〉;〈xD,x2〉;〈x5,xD〉;〈xD,x7〉;〈xA,xB〉
+;〈x4,xD〉;〈x6,xF〉;〈x5,x9〉;〈xF,xC〉;〈x4,x3〉;〈x4,x1〉;〈x0,x0〉;〈x3,xC〉;〈x9,x4〉;〈x5,x2〉;〈x5,x9〉;〈x6,xC〉;〈x6,xE〉;〈xE,x8〉;〈x6,x6〉;〈xF,x5〉 ].
+
+ndefinition dTest_random_ex58 ≝
+[〈x9,xC〉;〈x5,x7〉;〈x6,xC〉;〈xE,x2〉;〈x3,xB〉;〈xA,x2〉;〈x2,x1〉;〈xE,xE〉;〈xF,x6〉;〈x4,xF〉;〈xF,x3〉;〈x6,x2〉;〈xD,xB〉;〈x8,xF〉;〈x6,x4〉;〈xD,x3〉
+;〈x8,x0〉;〈x6,x9〉;〈x9,x7〉;〈x4,x7〉;〈x8,xB〉;〈xB,x6〉;〈x3,x8〉;〈x4,x5〉;〈xB,xE〉;〈x0,xD〉;〈x6,x1〉;〈xC,xF〉;〈x7,x8〉;〈xC,xF〉;〈x4,x1〉;〈x7,xF〉 ].
+
+ndefinition dTest_random_ex59 ≝
+[〈xF,x4〉;〈x5,xA〉;〈x8,xB〉;〈x7,x2〉;〈xE,x6〉;〈x7,xD〉;〈x4,xC〉;〈x1,x8〉;〈xE,xE〉;〈x3,xA〉;〈x1,x2〉;〈x9,x4〉;〈x3,x4〉;〈x3,x0〉;〈x3,x9〉;〈x0,x0〉
+;〈x9,x5〉;〈x6,x0〉;〈xF,xA〉;〈x7,xF〉;〈xA,x6〉;〈xC,x7〉;〈xB,x1〉;〈x7,xE〉;〈x0,xD〉;〈x2,x4〉;〈xF,xF〉;〈x4,x3〉;〈x7,x8〉;〈x8,x8〉;〈x6,xC〉;〈x0,x7〉 ].
+
+ndefinition dTest_random_ex5A ≝
+[〈x7,x3〉;〈x9,x2〉;〈xC,x8〉;〈x0,xB〉;〈x5,x0〉;〈x9,x7〉;〈xF,x4〉;〈x1,xB〉;〈xD,xB〉;〈x4,x5〉;〈x6,x2〉;〈x9,x1〉;〈x8,x7〉;〈x5,xD〉;〈xF,x5〉;〈x6,x1〉
+;〈x3,x8〉;〈xF,x3〉;〈x8,xA〉;〈x4,xF〉;〈xD,xB〉;〈x3,xD〉;〈x4,x3〉;〈x2,xF〉;〈xB,xA〉;〈xA,x9〉;〈xB,x4〉;〈xA,x9〉;〈x2,x6〉;〈x7,xE〉;〈x8,xC〉;〈x1,x6〉 ].
+
+ndefinition dTest_random_ex5B ≝
+[〈xF,xC〉;〈x1,xC〉;〈xA,x7〉;〈x9,xD〉;〈x7,xC〉;〈x8,x5〉;〈xA,x7〉;〈x3,x5〉;〈x8,x6〉;〈x4,xF〉;〈xC,x8〉;〈x9,xA〉;〈x0,xD〉;〈x2,x4〉;〈x0,x4〉;〈x5,x8〉
+;〈x4,x2〉;〈x3,x0〉;〈x7,x5〉;〈x8,xD〉;〈xB,xC〉;〈x7,x2〉;〈x3,x4〉;〈xF,x9〉;〈x4,x6〉;〈x5,xE〉;〈xF,x4〉;〈x5,xC〉;〈x6,x7〉;〈x0,x4〉;〈x8,x8〉;〈x2,x8〉 ].
+
+ndefinition dTest_random_ex5C ≝
+[〈xA,x9〉;〈xE,xC〉;〈xE,xC〉;〈x7,xC〉;〈x4,x6〉;〈x6,xE〉;〈x1,xC〉;〈xD,x9〉;〈xC,x0〉;〈x6,x1〉;〈x5,x8〉;〈x5,xE〉;〈x3,x7〉;〈xB,x0〉;〈x9,x9〉;〈x9,x7〉
+;〈xA,x0〉;〈x9,xB〉;〈x7,x7〉;〈x4,xA〉;〈xD,x0〉;〈xB,x5〉;〈x1,xD〉;〈xA,x6〉;〈x4,xA〉;〈xC,x5〉;〈x3,xA〉;〈x9,x4〉;〈xB,x4〉;〈x5,x0〉;〈x0,x6〉;〈xC,x0〉 ].
+
+ndefinition dTest_random_ex5D ≝
+[〈xA,x8〉;〈x0,x2〉;〈x5,xF〉;〈x0,xE〉;〈x2,x1〉;〈x0,x3〉;〈xB,x1〉;〈x9,x6〉;〈x0,x2〉;〈x9,x7〉;〈x8,x0〉;〈x1,xA〉;〈x0,xB〉;〈x3,xD〉;〈x2,x1〉;〈x7,xF〉
+;〈x0,x3〉;〈x2,x9〉;〈x3,x2〉;〈x6,x6〉;〈xB,xF〉;〈x3,xB〉;〈x5,x7〉;〈x5,x3〉;〈xE,x7〉;〈xD,x5〉;〈xE,x5〉;〈x4,x5〉;〈xA,x3〉;〈x1,xA〉;〈x1,xB〉;〈xF,x8〉 ].
+
+ndefinition dTest_random_ex5E ≝
+[〈xC,xF〉;〈xB,x3〉;〈x9,x5〉;〈x5,x9〉;〈x4,xE〉;〈x6,x4〉;〈x4,x3〉;〈xF,x4〉;〈x2,x5〉;〈xC,xC〉;〈x6,x1〉;〈x3,x5〉;〈xD,xF〉;〈x3,x6〉;〈x5,x5〉;〈xC,xF〉
+;〈x9,xA〉;〈x1,x1〉;〈xF,x6〉;〈xD,x4〉;〈x4,xF〉;〈x9,xB〉;〈xA,xF〉;〈xF,x2〉;〈x0,x3〉;〈x1,x9〉;〈x9,xB〉;〈xA,xB〉;〈xC,x4〉;〈x1,x9〉;〈xA,x1〉;〈xE,xA〉 ].
+
+ndefinition dTest_random_ex5F ≝
+[〈x1,xB〉;〈x2,x5〉;〈xA,xD〉;〈xA,xA〉;〈x0,x0〉;〈x5,xB〉;〈x9,xD〉;〈x6,xF〉;〈x8,x8〉;〈x6,xF〉;〈x3,x0〉;〈x8,x5〉;〈xC,x6〉;〈x1,x7〉;〈x5,x7〉;〈x1,x1〉
+;〈xA,xB〉;〈x0,x2〉;〈xD,xD〉;〈x9,x2〉;〈x4,xD〉;〈x8,x2〉;〈x0,x2〉;〈x3,x5〉;〈xC,xB〉;〈x4,x4〉;〈xA,x4〉;〈x4,x1〉;〈xD,x5〉;〈x1,x2〉;〈xE,x7〉;〈x4,xD〉 ].
+
+ndefinition dTest_random_32 ≝ 
+ dTest_random_ex00.
+
+ndefinition dTest_random_64 ≝ 
+ dTest_random_32@dTest_random_ex01.
+
+ndefinition dTest_random_128 ≝ 
+ dTest_random_64@dTest_random_ex02@dTest_random_ex03.
+
+ndefinition dTest_random_256 ≝ 
+ dTest_random_128@
+ dTest_random_ex04@dTest_random_ex05@dTest_random_ex06@dTest_random_ex07.
+
+ndefinition dTest_random_512 ≝ 
+ dTest_random_256@
+ dTest_random_ex08@dTest_random_ex09@dTest_random_ex0A@dTest_random_ex0B@
+ dTest_random_ex0C@dTest_random_ex0D@dTest_random_ex0E@dTest_random_ex0F.
+
+ndefinition dTest_random_1024 ≝ 
+ dTest_random_512@
+ dTest_random_ex10@dTest_random_ex11@dTest_random_ex12@dTest_random_ex13@
+ dTest_random_ex14@dTest_random_ex15@dTest_random_ex16@dTest_random_ex17@
+ dTest_random_ex18@dTest_random_ex19@dTest_random_ex1A@dTest_random_ex1B@
+ dTest_random_ex1C@dTest_random_ex1D@dTest_random_ex1E@dTest_random_ex1F.
+
+ndefinition dTest_random_2048 ≝ 
+ dTest_random_1024@
+ dTest_random_ex20@dTest_random_ex21@dTest_random_ex22@dTest_random_ex23@
+ dTest_random_ex24@dTest_random_ex25@dTest_random_ex26@dTest_random_ex27@
+ dTest_random_ex28@dTest_random_ex29@dTest_random_ex2A@dTest_random_ex2B@
+ dTest_random_ex2C@dTest_random_ex2D@dTest_random_ex2E@dTest_random_ex2F@
+ dTest_random_ex30@dTest_random_ex31@dTest_random_ex32@dTest_random_ex33@
+ dTest_random_ex34@dTest_random_ex35@dTest_random_ex36@dTest_random_ex37@
+ dTest_random_ex38@dTest_random_ex39@dTest_random_ex3A@dTest_random_ex3B@
+ dTest_random_ex3C@dTest_random_ex3D@dTest_random_ex3E@dTest_random_ex3F.
+
+ndefinition dTest_random_3072 ≝ 
+ dTest_random_2048@
+ dTest_random_ex40@dTest_random_ex41@dTest_random_ex42@dTest_random_ex43@
+ dTest_random_ex44@dTest_random_ex45@dTest_random_ex46@dTest_random_ex47@
+ dTest_random_ex48@dTest_random_ex49@dTest_random_ex4A@dTest_random_ex4B@
+ dTest_random_ex4C@dTest_random_ex4D@dTest_random_ex4E@dTest_random_ex4F@
+ dTest_random_ex50@dTest_random_ex51@dTest_random_ex52@dTest_random_ex53@
+ dTest_random_ex54@dTest_random_ex55@dTest_random_ex56@dTest_random_ex57@
+ dTest_random_ex58@dTest_random_ex59@dTest_random_ex5A@dTest_random_ex5B@
+ dTest_random_ex5C@dTest_random_ex5D@dTest_random_ex5E@dTest_random_ex5F.
+
+(* campitura di 128 0x00 *)
+ndefinition dTest_bytes_aux : list byte8 ≝
+[
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;
+〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉;〈x0,x0〉
+].
+
+(* blocco di 0x00 lungo 0x0380 da caricare dopo dati per azzerare
+   counters, index, position, e stack di esecuzione *)
+ndefinition dTest_zeros : list byte8 ≝
+ dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux.
+
+ndefinition dTest_zeros3K : list byte8 ≝
+  dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@
+  dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@
+  dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@
+  dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux@dTest_bytes_aux.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale_tests/micro_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale_tests/micro_tests.ma
new file mode 100755 (executable)
index 0000000..0f75a3f
--- /dev/null
@@ -0,0 +1,787 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                   *)
+(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "freescale/multivm.ma".
+include "freescale/status_lemmas.ma".
+
+(* ****************************************** *)
+(* MICRO TEST DI CORRETTEZZA DELLE ISTRUZIONI *)
+(* ****************************************** *)
+
+(* tabella 0x00 - 0xFF utile da caricare in RAM/ROM *)
+ndefinition mTest_bytes : list byte8 ≝
+ [   〈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,x0〉 ; 〈x6,x1〉 ; 〈x6,x2〉 ; 〈x6,x3〉 ; 〈x6,x4〉 ; 〈x6,x5〉 ; 〈x6,x6〉 ; 〈x6,x7〉
+ ; 〈x6,x8〉 ; 〈x6,x9〉 ; 〈x6,xA〉 ; 〈x6,xB〉 ; 〈x6,xC〉 ; 〈x6,xD〉 ; 〈x6,xE〉 ; 〈x6,xF〉 ]
+@[   〈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,x0〉 ; 〈xD,x1〉 ; 〈xD,x2〉 ; 〈xD,x3〉 ; 〈xD,x4〉 ; 〈xD,x5〉 ; 〈xD,x6〉 ; 〈xD,x7〉
+ ; 〈xD,x8〉 ; 〈xD,x9〉 ; 〈xD,xA〉 ; 〈xD,xB〉 ; 〈xD,xC〉 ; 〈xD,xD〉 ; 〈xD,xE〉 ; 〈xD,xF〉 ]
+@[   〈xE,x0〉 ; 〈xE,x1〉 ; 〈xE,x2〉 ; 〈xE,x3〉 ; 〈xE,x4〉 ; 〈xE,x5〉 ; 〈xE,x6〉 ; 〈xE,x7〉
+ ; 〈xE,x8〉 ; 〈xE,x9〉 ; 〈xE,xA〉 ; 〈xE,xB〉 ; 〈xE,xC〉 ; 〈xE,xD〉 ; 〈xE,xE〉 ; 〈xE,xF〉 ]
+@[   〈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〉
+ ].
+
+(*
+   1) mTest_x_RAM : inizio della RAM
+       (start point per caricamento mTest_bytes in RAM) 
+   2) mTest_x_prog: inizio della ROM
+       (start point per caricamento programma in ROM)
+   3) mTest_x_data: ultimi 256b della ROM
+       (start point per caricamento mTest_bytes in ROM)
+*)
+ndefinition mTest_HCS08_RAM ≝ 〈〈x0,x0〉:〈x7,x0〉〉.
+ndefinition mTest_HCS08_prog ≝ 〈〈x1,x8〉:〈x6,x0〉〉.
+ndefinition mTest_HCS08_data ≝ 〈〈xF,xF〉:〈x0,x0〉〉.
+
+ndefinition mTest_RS08_RAM ≝ 〈〈x0,x0〉:〈x2,x0〉〉.
+ndefinition mTest_RS08_prog ≝ 〈〈x3,x8〉:〈x0,x0〉〉.
+ndefinition mTest_RS08_data ≝ 〈〈x3,xF〉:〈x0,x0〉〉.
+
+ndefinition mTest_HCS08_ADC_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di ADC e le modalita' IMM1,DIR1/2,IX0/1/2,SP1/2 *)
+(* BEFORE: A=0x00 H:X=0xFF50 PC=0x1860 SP=0x0110 C=true *)
+(* [0x1860] 2clk *) (compile m ? ADC (maIMM1 〈xA,xA〉) I) @           (* AFTER1: imm1=0xAA quindi 0x00+imm1+true=A:0xAB C:false *)
+(* [0x1862] 3clk *) (compile m ? ADC (maDIR1 〈xF,xF〉) I) @           (* AFTER2: dir1=[0x00FF]=0x8F quindi 0xAB+dir1+false=A:0x3A C:true *)
+(* [0x1864] 4clk *) (compile m ? ADC (maDIR2 〈〈xF,xF〉:〈x1,x1〉〉) I) @ (* AFTER3: dir2=[0xFF11]=0x11 quindi 0x3A+dir2+true=A:0x4C C:false *)
+(* [0x1867] 4clk *) (compile m ? ADC (maIX2 〈〈xF,xF〉:〈xF,x0〉〉) I) @  (* AFTER4: ix2=[X+0xFFF0]=[0xFF40]=0x40 quindi 0x4C+ix2+false=A:0x8C C:false *)
+(* [0x186A] 3clk *) (compile m ? ADC (maIX1 〈x2,x4〉) I) @            (* AFTER5: ix1=[X+0x0024]=[0xFF74]=0x74 quindi 0x8C+ix1+false=A:0x00 C:true *)
+(* [0x186C] 3clk *) (compile m ? ADC maIX0 I) @                      (* AFTER6: ix0=[X]=[0xFF50]=0x50 quindi 0x00+ix0+true=A:0x51 C:false *)
+(* [0x186D] 5clk *) (compile m ? ADC (maSP2 〈〈xF,xF〉:〈x6,x1〉〉) I) @  (* AFTER7: sp2=[SP+0xFF61]=[0x0071]=0x01 quindi 0x51+sp2+false=A:0x52 C:false *)
+(* [0x1871] 4clk *) (compile m ? ADC (maSP1 〈x2,x4〉) I)              (* AFTER8: sp1=[SP+0x0024]=[0x0134]=0xC4 quindi 0x52+sp1+false=A:0x16 C:true *)
+(* [0x1874] si puo' quindi enunciare che dopo 2+3+4+4+3+3+5+4=28 clk *)
+(*          A<-0x16 PC<-0x1874 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+ndefinition mTest_HCS08_ADC_status ≝
+λt:memory_impl.
+ set_c_flag HCS08 t (* C<-true *)
+  (setweak_sp_reg HCS08 t (* SP<-0x0110 *)
+   (setweak_indX_16_reg HCS08 t (* H:X<-0xFF50 *)
+    (set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+     (start_of_mcu_version_HCS08
+      MC9S08AW60 t
+      (load_from_source_at t (* carica mTest_bytes in ROM:mTest_HCS08_data *)
+       (load_from_source_at t (* carica mTest_bytes in RAM:mTest_HCS08_RAM *)
+        (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_HCS08_prog *)
+          mTest_HCS08_ADC_source mTest_HCS08_prog)
+         mTest_bytes mTest_HCS08_RAM)
+        mTest_bytes mTest_HCS08_data)
+      (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+      (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+      false false false false false false) (* non deterministici tutti a 0 *)
+     mTest_HCS08_prog)
+    (mk_word16 〈xF,xF〉 〈x5,x0〉))
+   (mk_word16 〈x0,x1〉 〈x1,x0〉))
+  true.
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+nlemma ok_mTest_HCS08_ADC_full :
+ ∀t:memory_impl.
+ execute HCS08 t (TickOK ? (mTest_HCS08_ADC_status t)) 28 =
+ (* NB: V,N,Z sono tornati false C e' tornato true *)
+ TickOK ? (set_pc_reg HCS08 t (* nuovo PC *)
+           (set_acc_8_low_reg HCS08 t (mTest_HCS08_ADC_status t) 〈x1,x6〉) (* nuovo A *)
+            (mk_word16 〈x1,x8〉 〈x7,x4〉)).
+ #t; nelim t;
+ (* esempio per svoglimento degli stati manualmente
+ [ 1:
+  letin BEFORE ≝ (get_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC));
+  normalize in BEFORE:(%);
+
+ letin AFTER_ALU1 ≝ (match execute HCS08 MEM_FUNC (TickOK ? (mTest_HCS08_ADC_status MEM_FUNC)) 2 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU1:(%);
+
+ letin AFTER_ALU2 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU1)) 3 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU2:(%);
+
+  letin AFTER_ALU3 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU2)) 4 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU3:(%);  
+
+ letin AFTER_ALU4 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU3)) 4 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU4:(%); 
+
+ letin AFTER_ALU5 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU4)) 3 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU5:(%); 
+
+ letin AFTER_ALU6 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU5)) 3 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU6:(%); 
+
+ letin AFTER_ALU7 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU6)) 5 with
+  [ TickERR _ _ ⇒ BEFORE 
+  | TickSUSP _ _ ⇒ BEFORE 
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU7:(%); 
+
+ letin AFTER_ALU8 ≝ (match execute HCS08 MEM_FUNC (TickOK ? 
+                     (set_alu HCS08 MEM_FUNC (mTest_HCS08_ADC_status MEM_FUNC) AFTER_ALU7)) 4 with
+  [ TickERR _ _ ⇒ BEFORE
+  | TickSUSP _ _ ⇒ BEFORE
+  | TickOK s ⇒ get_alu HCS08 MEM_FUNC s ]);
+ normalize in AFTER_ALU8:(%); *) 
+
+ napply refl_eq.
+nqed.
+
+(* ********* *)
+(* HCS08 MOV *)
+(* ********* *)
+
+(*
+definition mTest_HCS08_MOV_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di MOV e le modalita' xxx_to_xxx *)
+(* BEFORE: H:X=0x0071 PC=0x1860 *)
+(* [0x1860] 4clk *) (compile m ? MOV (maIMM1_to_DIR1 〈x3,xA〉 〈x7,x0〉) I) @ (* 0x3A in [0x0070] *)
+(* [0x1863] 5clk *) (compile m ? MOV (maDIR1_to_DIR1 〈x7,x0〉 〈x7,x1〉) I) @ (* [0x0070] in [0x0071] *)
+(* [0x1866] 5clk *) (compile m ? MOV (maIX0p_to_DIR1 〈x7,x2〉) I) @         (* [X++=0x0071] in [0x0072] *)
+(* [0x1868] 5clk *) (compile m ? MOV (maDIR1_to_IX0p 〈x7,x2〉) I)           (* [0x0072] in [X++=0x0072] *)
+(* [0x186A] si puo' quindi enunciare che dopo 4+5+5+5=19 clk *)
+(*          PC<-0x186A X<-0x0073 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_HCS08_MOV_status ≝
+λt:memory_impl.
+λb1,b2,b3:byte8.
+ setweak_indX_16_reg HCS08 t (* H:X<-0x0071 *)
+  (set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+   (start_of_mcu_version_HCS08
+    MC9S08AW60 t
+    (load_from_source_at t (* carica b1-3 in RAM:mTest_HCS08_RAM *)
+     (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_HCS08_prog *)
+       mTest_HCS08_MOV_source mTest_HCS08_prog)
+     [ b1 ; b2 ; b3 ] mTest_HCS08_RAM)
+    (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+    (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+    false false false false false false) (* non deterministici tutti a 0 *)
+   mTest_HCS08_prog)
+  (mk_word16 〈x0,x0〉 〈x7,x1〉).
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+(* NB: la memoria e' cambiata e bisogna applicare eq_status *)
+lemma ok_mTest_HCS08_MOV_full :
+∀t:memory_impl.
+ eq_status HCS08 t
+  (match execute HCS08 t (TickOK ? (mTest_HCS08_MOV_status t 〈x0,x0〉 〈x0,x0〉 〈x0,x0〉)) 19
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+  (setweak_indX_16_reg HCS08 t (* H:X *) 
+   (set_pc_reg HCS08 t (mTest_HCS08_MOV_status t 〈x3,xA〉 〈x3,xA〉 〈x3,xA〉) (* PC *)
+    (mk_word16 〈x1,x8〉 〈x6,xA〉))
+     (mk_word16 〈x0,x0〉 〈x7,x3〉))
+  [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] = true.
+ intro; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] HCS08 t
+        (match execute HCS08 t (TickOK ? (mTest_HCS08_MOV_status t 〈x0,x0〉 〈x0,x0〉 〈x0,x0〉)) 19
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+        (setweak_indX_16_reg HCS08 t (* H:X *) 
+         (set_pc_reg HCS08 t (mTest_HCS08_MOV_status t 〈x3,xA〉 〈x3,xA〉 〈x3,xA〉) (* PC *)
+          (mk_word16 〈x1,x8〉 〈x6,xA〉))
+           (mk_word16 〈x0,x0〉 〈x7,x3〉)));
+ elim t;
+ [ 1,2,3: normalize in ⊢ (? ? ? %); reflexivity
+ | 4,5,6: normalize in ⊢ (? ? ? %); reflexivity
+ | 7,8,9: normalize; reflexivity
+ ].
+qed.
+
+(* ************* *)
+(* HCS08 ROL/ROR *)
+(* ************* *)
+
+definition mTest_HCS08_ROL_ROR_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di ROL/ROR e le modalita' IMM2,INHx *)
+(* BEFORE: A=0x00 H:X=0x0000 PC=0x1860 Z=true *)
+(* [0x1860] 3clk *) (compile m ? LDHX (maIMM2 〈〈x1,x2〉:〈x3,x4〉〉) I) @
+(* [0x1863] 2clk *) (compile m ? LDA (maIMM1 〈x5,x6〉) I) @
+(* [0x1865] 1clk *) (compile m ? ROL maINHA I) @
+(* [0x1866] 1clk *) (compile m ? ROL maINHX I) @
+(* [0x1867] 1clk *) (compile m ? ROR maINHA I) @
+(* [0x1868] 1clk *) (compile m ? ROR maINHX I) @
+(* [0x1869] 1clk *) (compile m ? CLR maINHA I) @
+(* [0x186A] 1clk *) (compile m ? CLR maINHX I) @
+(* [0x186B] 1clk *) (compile m ? CLR maINHH I)
+(* [0x186C] si puo' quindi enunciare che dopo 3+2+1+1+1+1+1+1+1=12 clk *)
+(*          PC<-0x186C *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_HCS08_ROL_ROR_status ≝
+λt:memory_impl.
+ set_z_flag HCS08 t (* Z<-true *)
+  (setweak_indX_16_reg HCS08 t (* H:X<-0x0000 *)
+   (set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+    (start_of_mcu_version_HCS08
+     MC9S08AW60 t
+     (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_HCS08_prog *)
+      mTest_HCS08_ROL_ROR_source mTest_HCS08_prog)
+     (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+     (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+     false false false false false false) (* non deterministici tutti a 0 *)
+    mTest_HCS08_prog)
+   (mk_word16 (mk_byte8 x0 x0) (mk_byte8 x0 x0)))
+  true.
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+lemma ok_mTest_HCS08_ROL_ROR_full :
+ ∀t:memory_impl.
+ execute HCS08 t (TickOK ? (mTest_HCS08_ROL_ROR_status t)) 12 =
+ TickOK ? (set_pc_reg HCS08 t (* nuovo PC *)
+           (mTest_HCS08_ROL_ROR_status t) (mk_word16 〈x1,x8〉 〈x6,xC〉)).
+ intro;
+ elim t;
+ reflexivity.
+qed.
+
+(* **************** *)
+(* HCS08 CBEQx/DBNZ *)
+(* **************** *)
+
+definition mTest_HCS08_CBEQ_DBNZ_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di CBEQx/DBNZ e le modalita' xxx_and_IMM1 *)
+(* BEFORE: H:X=0x006F SP=0x006F PC=0x1860 *)
+(* [0x1860] 5clk *) (compile m ? CBEQA (maDIR1_and_IMM1 〈x7,x1〉 〈x0,x1〉) I) @
+(* [0x1863] 1clk *) (compile m ? NOP maINH I) @                               (* eseguito: A≠[0x0071]=0x01 *)
+(* [0x1864] 4clk *) (compile m ? CBEQA (maIMM1_and_IMM1 〈x0,x0〉 〈x0,x1〉) I) @
+(* [0x1867] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: A=0x00 *)
+(* [0x1868] 4clk *) (compile m ? CBEQX (maIMM1_and_IMM1 〈x6,xF〉 〈x0,x1〉) I) @
+(* [0x186B] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: X=0x6F *)
+(* [0x186C] 5clk *) (compile m ? CBEQA (maIX1p_and_IMM1 〈x0,x1〉 〈x0,x1〉) I) @ (* H:X++ *)
+(* [0x186F] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: A=[X+0x01]=[0x0070]=0x00 *)
+(* [0x1870] 5clk *) (compile m ? CBEQA (maIX0p_and_IMM1 〈x0,x1〉) I) @         (* H:X++ *)
+(* [0x1872] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: A=[X]=[0x0070]=0x00 *)
+(* [0x1873] 6clk *) (compile m ? CBEQA (maSP1_and_IMM1 〈x0,x2〉 〈x0,x1〉) I) @
+(* [0x1877] 1clk *) (compile m ? NOP maINH I) @                               (* eseguito: A≠[SP+0x02]=[0x0071]=0x01 *)
+
+(* [0x1878] 7clk *) (compile m ? DBNZ (maDIR1_and_IMM1 〈x7,x2〉 〈x0,x1〉) I) @
+(* [0x187B] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: --[0x0072]=0x01≠0 *)
+(* [0x187C] 4clk *) (compile m ? DBNZ (maINHA_and_IMM1 〈x0,x1〉) I) @
+(* [0x187E] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: --A=0xFF≠0 *)
+(* [0x187F] 4clk *) (compile m ? DBNZ (maINHX_and_IMM1 〈x0,x1〉) I) @
+(* [0x1881] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: --X=0x70≠0 *)
+(* [0x1882] 7clk *) (compile m ? DBNZ (maIX1_and_IMM1 〈x0,x2〉 〈x0,x1〉) I) @
+(* [0x1885] 1clk *) (compile m ? NOP maINH I) @                               (* eseguito: --[X+0x02]=[0x0072]=0x00=0 *)
+(* [0x1886] 6clk *) (compile m ? DBNZ (maIX0_and_IMM1 〈x0,x1〉) I) @
+(* [0x1888] 1clk *) (compile m ? NOP maINH I) @                               (* non eseguito: --[X]=[0x0070]=0xFF≠0 *)
+(* [0x1889] 8clk *) (compile m ? DBNZ (maSP1_and_IMM1 〈x0,x1〉 〈x0,x1〉) I) @ 
+(* [0x188D] 1clk *) (compile m ? NOP maINH I)                                 (* non eseguito: --[SP+0x01]=[0x0070]=0xFE≠0 *)
+(* [0x188E] si puo' quindi enunciare che dopo 5+1+4+4+5+5+6+1 (31)
+                                              7+4+4+7+1+6+8   (37) =68 clk *)
+(*          A<-0xFF PC<-0x188E H:X<-0070 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_HCS08_CBEQ_DBNZ_status ≝
+λt:memory_impl.
+λb1,b2,b3:byte8.
+ setweak_sp_reg HCS08 t (* SP<-0x006F *)
+  (setweak_indX_16_reg HCS08 t (* H:X<-0x006F *)
+   (set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+    (start_of_mcu_version_HCS08
+     MC9S08AW60 t
+     (load_from_source_at t (* carica b1-3 in RAM:mTest_HCS08_RAM *)
+      (load_from_source_at t (* carica mTest_bytes in RAM:mTest_HCS08_RAM *)
+       (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_HCS08_prog *)
+         mTest_HCS08_CBEQ_DBNZ_source mTest_HCS08_prog)
+        mTest_bytes mTest_HCS08_RAM)
+       [ b1 ; b2 ; b3 ] mTest_HCS08_RAM)
+     (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+     (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+     false false false false false false) (* non deterministici tutti a 0 *)
+    mTest_HCS08_prog)
+   (mk_word16 (mk_byte8 x0 x0) (mk_byte8 x6 xF)))
+  (mk_word16 (mk_byte8 x0 x0) (mk_byte8 x6 xF)).
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+(* NB: la memoria e' cambiata e bisogna applicare eq_status *)
+lemma ok_mTest_HCS08_CBEQ_DBNZ_full :
+∀t:memory_impl.
+ eq_status HCS08 t
+  (match execute HCS08 t (TickOK ? (mTest_HCS08_CBEQ_DBNZ_status t 〈x0,x0〉 〈x0,x1〉 〈x0,x2〉)) 68
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+  (set_acc_8_low_reg HCS08 t (* nuovo A *)
+   (set_pc_reg HCS08 t (* nuovo PC *)
+    (setweak_indX_16_reg HCS08 t (mTest_HCS08_CBEQ_DBNZ_status t 〈xF,xE〉 〈x0,x1〉 〈x0,x0〉) (* nuovo H:X *)
+     (mk_word16 〈x0,x0〉 〈x7,x0〉))
+    (mk_word16 〈x1,x8〉 〈x8,xE〉))
+   (mk_byte8 xF xF))
+  [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] = true.
+ intro; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] HCS08 t
+        (match execute HCS08 t (TickOK ? (mTest_HCS08_CBEQ_DBNZ_status t 〈x0,x0〉 〈x0,x1〉 〈x0,x2〉)) 68
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+        (set_acc_8_low_reg HCS08 t (* nuovo A *)
+         (set_pc_reg HCS08 t (* nuovo PC *)
+          (setweak_indX_16_reg HCS08 t (mTest_HCS08_CBEQ_DBNZ_status t 〈xF,xE〉 〈x0,x1〉 〈x0,x0〉) (* nuovo H:X *)
+           (mk_word16 〈x0,x0〉 〈x7,x0〉))
+          (mk_word16 〈x1,x8〉 〈x8,xE〉))
+         (mk_byte8 xF xF)));
+ elim t;
+ [ 1,2,3: normalize in ⊢ (? ? ? %); reflexivity
+ | 4,5,6: normalize in ⊢ (? ? ? %); reflexivity
+ | 7,8,9: normalize; reflexivity
+ ].
+qed.
+
+(* ***************** *)
+(* HCS08 BSETn/BCLRn *)
+(* ***************** *)
+
+definition mTest_HCS08_BSETn_BCLRn_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di BSETn/BCLRn e le modalita' DIRn *)
+(* BEFORE: PC=0x1860 *)
+(* [0x1860] 5clk *) (compile m ? BSETn (maDIRn o0 〈x7,x0〉) I) @ (* [0x0070]=0x01 *)
+(* [0x1862] 5clk *) (compile m ? BSETn (maDIRn o1 〈x7,x0〉) I) @ (* [0x0070]=0x03 *)
+(* [0x1864] 5clk *) (compile m ? BSETn (maDIRn o2 〈x7,x0〉) I) @ (* [0x0070]=0x07 *)
+(* [0x1866] 5clk *) (compile m ? BSETn (maDIRn o3 〈x7,x0〉) I) @ (* [0x0070]=0x0F *)
+(* [0x1868] 5clk *) (compile m ? BSETn (maDIRn o4 〈x7,x0〉) I) @ (* [0x0070]=0x1F *)
+(* [0x186A] 5clk *) (compile m ? BSETn (maDIRn o5 〈x7,x0〉) I) @ (* [0x0070]=0x3F *)
+(* [0x186C] 5clk *) (compile m ? BSETn (maDIRn o6 〈x7,x0〉) I) @ (* [0x0070]=0x7F *)
+(* [0x186E] 5clk *) (compile m ? BSETn (maDIRn o7 〈x7,x0〉) I) @ (* [0x0070]=0xFF *)
+
+(* [0x1870] 5clk *) (compile m ? BCLRn (maDIRn o0 〈x7,x0〉) I) @ (* [0x0070]=0xFE *)
+(* [0x1872] 5clk *) (compile m ? BCLRn (maDIRn o1 〈x7,x0〉) I) @ (* [0x0070]=0xFC *)
+(* [0x1874] 5clk *) (compile m ? BCLRn (maDIRn o2 〈x7,x0〉) I) @ (* [0x0070]=0xF8 *)
+(* [0x1876] 5clk *) (compile m ? BCLRn (maDIRn o3 〈x7,x0〉) I) @ (* [0x0070]=0xF0 *)
+(* [0x1878] 5clk *) (compile m ? BCLRn (maDIRn o4 〈x7,x0〉) I) @ (* [0x0070]=0xE0 *)
+(* [0x187A] 5clk *) (compile m ? BCLRn (maDIRn o5 〈x7,x0〉) I) @ (* [0x0070]=0xC0 *)
+(* [0x187C] 5clk *) (compile m ? BCLRn (maDIRn o6 〈x7,x0〉) I) @ (* [0x0070]=0x80 *)
+(* [0x187E] 5clk *) (compile m ? BCLRn (maDIRn o7 〈x7,x0〉) I)   (* [0x0070]=0x00 *)
+(* [0x1880] si puo' quindi enunciare che dopo 5+5+5+5+5+5+5+5
+                                              5+5+5+5+5+5+5+5 =80 clk *)
+(*          PC<-0x1880 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_HCS08_BSETn_BCLRn_status ≝
+λt:memory_impl.
+λb1:byte8.
+ set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+  (start_of_mcu_version_HCS08
+   MC9S08AW60 t
+   (load_from_source_at t (* carica b1 in RAM:mTest_HCS08_RAM *)
+    (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_HCS08_prog *)
+      mTest_HCS08_BSETn_BCLRn_source mTest_HCS08_prog)
+     [ b1 ] mTest_HCS08_RAM)
+   (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+   (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+   false false false false false false) (* non deterministici tutti a 0 *)
+  mTest_HCS08_prog.
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+(* NB: la memoria e' cambiata e bisogna applicare eq_status *)
+lemma ok_mTest_HCS08_BSETn_BCLRn_full :
+∀t:memory_impl.
+ eq_status HCS08 t
+  (match execute HCS08 t (TickOK ? (mTest_HCS08_BSETn_BCLRn_status t 〈x0,x0〉)) 80
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+  (set_pc_reg HCS08 t (mTest_HCS08_BSETn_BCLRn_status t 〈x0,x0〉) 〈〈x1,x8〉:〈x8,x0〉〉 (* nuovo PC *))
+  [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] = true.
+ intro; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x7,x0〉〉 ; 〈〈x0,x0〉:〈x7,x1〉〉 ; 〈〈x0,x0〉:〈x7,x2〉〉 ] HCS08 t
+        (match execute HCS08 t (TickOK ? (mTest_HCS08_BSETn_BCLRn_status t 〈x0,x0〉)) 80
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+        (set_pc_reg HCS08 t (mTest_HCS08_BSETn_BCLRn_status t 〈x0,x0〉) 〈〈x1,x8〉:〈x8,x0〉〉 (* nuovo PC *)));
+ elim t;
+ [ 1,2,3: normalize in ⊢ (? ? ? %); reflexivity
+ | 4,5,6: normalize in ⊢ (? ? ? %); reflexivity
+ | 7,8,9: normalize; reflexivity
+ ].
+qed.
+
+(* ******************* *)
+(* HCS08 BRSETn/BRCLRn *)
+(* ******************* *)
+
+definition mTest_HCS08_BRSETn_BRCLRn_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* testa la logica di BRSETn/BRCLRn e le modalita' DIRn_and_IMM1 *)
+(* BEFORE: va a testare [0x00C5]=0x55 PC=0x1860 *)
+(* [0x1860] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o0 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1863] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1864] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o1 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1867] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1868] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o2 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x186B] 1clk *) (compile m ? NOP maINH I) @
+(* [0x186C] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o3 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x186F] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1870] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o4 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1873] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1874] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o5 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1877] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1878] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o6 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x187B] 1clk *) (compile m ? NOP maINH I) @
+(* [0x187C] 5clk *) (compile m ? BRSETn (maDIRn_and_IMM1 o7 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x187F] 1clk *) (compile m ? NOP maINH I) @
+
+(* [0x1880] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o0 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1883] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1884] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o1 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1887] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1888] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o2 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x188B] 1clk *) (compile m ? NOP maINH I) @
+(* [0x188C] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o3 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x188F] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1890] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o4 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1893] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1894] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o5 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x1897] 1clk *) (compile m ? NOP maINH I) @
+(* [0x1898] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o6 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x189B] 1clk *) (compile m ? NOP maINH I) @
+(* [0x189C] 5clk *) (compile m ? BRCLRn (maDIRn_and_IMM1 o7 〈xC,x5〉 〈x0,x1〉) I) @
+(* [0x189F] 1clk *) (compile m ? NOP maINH I)
+
+(* [0x18A0] si puo' quindi enunciare che dopo 80+8=88 clk
+            (vengono eseguiti 16*5 test, meta' BRSETn/BRCLRn saltano *) 
+(*          PC<-0x18A0 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_HCS08_BRSETn_BRCLRn_status ≝
+λt:memory_impl.
+ set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+  (start_of_mcu_version_HCS08
+   MC9S08AW60 t
+   (load_from_source_at t
+    (load_from_source_at t (zero_memory t) (* carica mTest_bytes in RAM:mTest_HCS08_RAM *)
+      mTest_HCS08_BRSETn_BRCLRn_source mTest_HCS08_prog) (* carica source in ROM:mTest_HCS08_prog *)
+     mTest_bytes mTest_HCS08_RAM)
+   (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+   (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+   false false false false false false) (* non deterministici tutti a 0 *)
+  mTest_HCS08_prog.
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+lemma ok_mTest_HCS08_BRSETn_BRCLRn_full :
+ ∀t:memory_impl.
+ execute HCS08 t (TickOK ? (mTest_HCS08_BRSETn_BRCLRn_status t)) 88 =
+ TickOK ? (set_pc_reg HCS08 t (mTest_HCS08_BRSETn_BRCLRn_status t) (* nuovo PC *)
+           (mk_word16 〈x1,x8〉 〈xA,x0〉)).
+ intro;
+ elim t;
+ reflexivity.
+qed.
+
+(* *************** *)
+(* RS08 X,D[X],TNY *)
+(* *************** *)
+
+definition mTest_RS08_TNY_source ≝ let m ≝ RS08 in source_to_byte8 m (
+(* testa la logica RS08 X,D[X] le modalita' TNY *)
+(* NB: il meccanismo utilizzato e' quello complesso dell'RS08
+       fare riferimento alle spiegazioni in STATUS/LOAD_WRITE *)
+(* X=20 PS=0 *)
+(* [0x3800] 3clk *) (compile m ? ADD (maTNY xD) I) @       (* ... +[0x000D]=0x0C *)
+(* [0x3801] 3clk *) (compile m ? ADD (maTNY xE) I) @       (* ... +D[X]=[0x0020]=0x1F *)
+(* [0x3802] 3clk *) (compile m ? ADD (maTNY xF) I) @       (* ... +X=0x20 *)
+(* [0x3803] 3clk *) (compile m ? ADD (maDIR1 〈xC,xF〉) I) @ (* ... +X=0x20 *)
+(* [0x3805] 3clk *) (compile m ? ADD (maDIR1 〈xC,xE〉) I)   (* ... +[0x000E]=0x0D *)
+(* [0x3807] si puo' quindi enunciare che dopo 15 clk
+            A<-0x78 PC<-0x3807 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_RS08_TNY_status ≝
+λt:memory_impl.
+ setweak_x_map RS08 t (* X<-0x20 *)
+ (setweak_ps_map RS08 t (* PS<-0x00 *)
+ (set_pc_reg RS08 t (* PC<-mTest_RS08_prog *)
+  (start_of_mcu_version_RS08 
+   MC9RS08KA2 t
+   (load_from_source_at t (* carica mTest_bytes in RAM:mTest_RS08_RAM *)
+    (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_RS08_prog *)
+     mTest_RS08_TNY_source mTest_RS08_prog)
+    mTest_bytes 〈〈x0,x0〉:〈x0,x1〉〉)
+   (build_memory_type_of_mcu_version (FamilyRS08 MC9RS08KA2) t)
+   (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+   false false false false false false (* non deterministici tutti a 0 *)
+   ) mTest_RS08_prog)
+  (mk_byte8 x0 x0))
+  (mk_byte8 x2 x0).
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+lemma ok_mTest_RS08_TNY_full :
+ ∀t:memory_impl.
+ execute RS08 t (TickOK ? (mTest_RS08_TNY_status t)) 15 =
+ TickOK ? (set_acc_8_low_reg RS08 t (* nuovo A *)
+           (set_pc_reg RS08 t (mTest_RS08_TNY_status t) (* nuovo PC *)
+            (mk_word16 〈x3,x8〉 〈x0,x7〉))
+             (mk_byte8 x7 x8)).
+ intro;
+ elim t;
+ reflexivity.
+qed.
+
+(* *********** *)
+(* RS08 PS,SRT *)
+(* *********** *)
+
+definition mTest_RS08_SRT_source ≝ let m ≝ RS08 in source_to_byte8 m (
+(* testa la logica RS08 PS le modalita' SRT *)
+(* NB: il meccanismo utilizzato e' quello complesso dell'RS08
+       fare riferimento alle spiegazioni in STATUS/LOAD_WRITE *)
+(* X=0x1F PS=0xFE Z=1 *)
+(* [0x3800] 3clk *) (compile m ? LDA (maSRT t1F) I) @      (* A<-PS *)
+(* [0x3801] 2clk *) (compile m ? SUB (maIMM1 〈xF,xE〉) I) @ (* risulta 0 *)
+(* [0x3803] 3clk *) (compile m ? BEQ (maIMM1 〈x0,x1〉) I) @ (* salta *)
+(* [0x3805] 1clk *) (compile m ? NOP maINH I) @ 
+
+(* [0x3806] 3clk *) (compile m ? LDA (maSRT t0E) I) @      (* A<-PS *)
+(* [0x3807] 2clk *) (compile m ? SUB (maIMM1 〈xF,xE〉) I) @ (* risulta 0 *)
+(* [0x3809] 3clk *) (compile m ? BEQ (maIMM1 〈x0,x1〉) I) @ (* salta *)
+(* [0x380B] 1clk *) (compile m ? NOP maINH I) @
+
+(* [0x380C] 3clk *) (compile m ? LDA (maDIR1 〈xC,x3〉) I) @ (* A<-[0x00C3]=[0x3F83]=0x83 *)
+(* [0x380E] 2clk *) (compile m ? SUB (maIMM1 〈x8,x3〉) I) @ (* risulta 0 *)
+(* [0x3810] 3clk *) (compile m ? BEQ (maIMM1 〈x0,x1〉) I) @ (* salta *)
+(* [0x3812] 1clk *) (compile m ? NOP maINH I)
+(* [0x3813] si puo' quindi enunciare che dopo 24 clk
+            PC<-0x3813 *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_RS08_SRT_status ≝
+λt:memory_impl.
+ setweak_x_map RS08 t (* X<-0x1F *)
+  (setweak_ps_map RS08 t (* PS<-0xFE *)
+   (set_z_flag RS08 t (* Z<-true *)
+    (set_pc_reg RS08 t (* PC<-mTest_RS08_prog *)
+     (start_of_mcu_version_RS08
+      MC9RS08KA2 t
+       (load_from_source_at t (* carica mTest_bytes in ROM:mTest_RS08_data *)
+        (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_RS08_prog *)
+         mTest_RS08_SRT_source mTest_RS08_prog)
+        mTest_bytes mTest_RS08_data)
+       (build_memory_type_of_mcu_version (FamilyRS08 MC9RS08KA2) t)
+      (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+      false false false false false false (* non deterministici tutti a 0 *)
+      ) mTest_RS08_prog)
+     true)
+    (mk_byte8 xF xE))
+   (mk_byte8 x1 xF).
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+lemma ok_mTest_RS08_SRT_full :
+ ∀t:memory_impl.
+ execute RS08 t (TickOK ? (mTest_RS08_SRT_status t)) 24 =
+ TickOK ? (set_pc_reg RS08 t (mTest_RS08_SRT_status t) (* nuovo PC *)
+           (mk_word16 〈x3,x8〉 〈x1,x3〉)).
+ intro;
+ elim t;
+ reflexivity.
+qed.
+
+(* ********************* *)
+(* TEOREMA MULT PER RS08 *)
+(* ********************* *)
+
+definition mTest_RS08_mult_source ≝ let m ≝ RS08 in source_to_byte8 m (
+(* 
+   ZH:ZL=X*Y con [0x0020-0x004F] X ≝ [0x0020] Y ≝ [0x0021] ZH ≝ [0x0022] ZL ≝ [0x0023]
+*)
+(* [0x3800] ZH <- 0      3clk *) (compile m ? CLR (maDIR1 〈x2,x2〉) I) @
+(* [0x3802] ZL <- 0      3clk *) (compile m ? CLR (maDIR1 〈x2,x3〉) I) @
+(* [0x3804] (l1) A <- Y  3clk *) (compile m ? LDA (maDIR1 〈x2,x1〉) I) @
+(* [0x3806] A=0 goto l2  3clk *) (compile m ? BEQ (maIMM1 〈x0,xE〉) I) @
+(* [0x3808] A <- ZL      3clk *) (compile m ? LDA (maDIR1 〈x2,x3〉) I) @
+(* [0x380A] Y --         5clk *) (compile m ? DEC (maDIR1 〈x2,x1〉) I) @
+(* [0x380C] A += X       3clk *) (compile m ? ADD (maDIR1 〈x2,x0〉) I) @
+(* [0x380E] C=0 goto l3  3clk *) (compile m ? BCC (maIMM1 〈x0,x2〉) I) @
+(* [0x3810] ZH ++        5clk *) (compile m ? INC (maDIR1 〈x2,x2〉) I) @
+(* [0x3812] (l3) ZL <- A 3clk *) (compile m ? STA (maDIR1 〈x2,x3〉) I) @
+(* [0x3814] goto l1      3clk *) (compile m ? BRA (maIMM1 〈xE,xE〉) I)
+(* [0x3816] (l2) si puo' quindi enunciare che
+                 - il caso base X * 0 richiede 12 cicli
+                 - bisogna aggiungere Y * 26 cicli, Y>0
+                 - bisogna aggiungere ZH * 5 cicli, X * Y > 0xFF *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_RS08_mult_status ≝
+λt:memory_impl.
+λb1,b2,b3,b4:byte8.
+ set_z_flag RS08 t (* Z<-true *)
+ (set_pc_reg RS08 t (* PC<-mTest_RS08_prog *)
+  (start_of_mcu_version_RS08 
+   MC9RS08KA2 t
+   (load_from_source_at t (* carica X,Y,ZH,ZL:mTest_RS08_RAM *)
+    (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_RS08_prog *)
+     mTest_RS08_mult_source mTest_RS08_prog)
+    [ b1 ; b2 ; b3 ; b4 ] mTest_RS08_RAM)
+   (build_memory_type_of_mcu_version (FamilyRS08 MC9RS08KA2) t)
+   (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+   false false false false false false (* non deterministici tutti a 0 *)
+   ) mTest_RS08_prog)
+  true.
+
+(* parametrizzazione dell'enunciato del teorema mult *)
+(* NB: la memoria e' cambiata e bisogna applicare eq_status *)
+definition ok_mTest_RS08_mult_full_aux ≝
+λt:memory_impl.λX,Y:byte8.
+ eq_status RS08 t
+  (match execute RS08 t (TickOK ? (mTest_RS08_mult_status t X Y 〈x0,x0〉 〈x0,x0〉))
+                                  (12 + (26 * (nat_of_byte8 Y)) + (5 * (nat_of_byte8 (w16h (mul_b8 X Y)))))
+   (* FIXME: alla ALU azzero C perche' la funzione che ne descrive il valore finale e' MOLTO complessa *)
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ set_c_flag RS08 t s false ])
+  (set_pc_reg RS08 t (mTest_RS08_mult_status t X 〈x0,x0〉 (w16h (mul_b8 X Y)) (w16l (mul_b8 X Y))) 〈〈x3,x8〉:〈x1,x6〉〉)
+  (* controllo che coincidano X,Y,ZH,ZL *)
+  [ 〈〈x0,x0〉:〈x2,x0〉〉 ; 〈〈x0,x0〉:〈x2,x1〉〉 ; 〈〈x0,x0〉:〈x2,x2〉〉 ; 〈〈x0,x0〉:〈x2,x3〉〉 ] = true.
+
+lemma ok_mTest_RS08_mult_full : 
+let X ≝ 〈xF,xF〉 in
+let Y ≝ 〈x1,xE〉 in
+ ∀t:memory_impl.
+  ok_mTest_RS08_mult_full_aux t X Y.
+ unfold ok_mTest_RS08_mult_full_aux;
+ intros 3; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x2,x0〉〉 ; 〈〈x0,x0〉:〈x2,x1〉〉 ; 〈〈x0,x0〉:〈x2,x2〉〉 ; 〈〈x0,x0〉:〈x2,x3〉〉 ] RS08 t
+        (match execute RS08 t (TickOK ? (mTest_RS08_mult_status t X Y 〈x0,x0〉 〈x0,x0〉))
+                                        (12 + (26 * (nat_of_byte8 Y)) + (5 * (nat_of_byte8 (w16h (mul_b8 X Y)))))
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ set_c_flag RS08 t s false ])
+        (set_pc_reg RS08 t (mTest_RS08_mult_status t X 〈x0,x0〉 (w16h (mul_b8 X Y)) (w16l (mul_b8 X Y))) 〈〈x3,x8〉:〈x1,x6〉〉));
+ elim t;
+ [ 1,2,3: normalize in ⊢ (? ? ? %); reflexivity
+ | 4,5,6: normalize in ⊢ (? ? ? %); reflexivity
+ | 7,8,9: normalize; reflexivity
+ ].
+qed.
+
+(* ************************ *)
+(* TEST SU GRANULARITA' BIT *)
+(* ************************ *)
+
+definition mTest_bits_source ≝ let m ≝ HCS08 in source_to_byte8 m (
+(* BEFORE: va a testare [0x0070]=0x00 *)
+(* [0x1860] 4clk *) (compile m ? MOV (maIMM1_to_DIR1 〈xF,xF〉 〈x7,x0〉) I)
+(* [0x1863] *)
+).
+
+(* creazione del processore+caricamento+impostazione registri *)
+definition mTest_bits_status ≝
+λt:memory_impl.
+λsub:oct.
+λb:byte8.
+ setweak_n_flag HCS08 t (* N<-1 *)
+  (set_pc_reg HCS08 t (* PC<-mTest_HCS08_prog *)
+   (start_of_mcu_version_HCS08
+    MC9S08AW60 t
+    (load_from_source_at t
+     (load_from_source_at t (zero_memory t) (* carica b in RAM:mTest_HCS08_RAM *)
+       mTest_bits_source mTest_HCS08_prog) (* carica source in ROM:mTest_HCS08_prog *)
+      [ b ] mTest_HCS08_RAM)
+    (check_update_bit t (* setta mTest_HCS08_RAM,o come ROM *)
+     (build_memory_type_of_mcu_version (FamilyHCS08 MC9S08AW60) t)
+     mTest_HCS08_RAM sub MEM_READ_ONLY)
+    (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
+    false false false false false false) (* non deterministici tutti a 0 *)
+   mTest_HCS08_prog)
+  true.
+
+(* dimostrazione senza svolgimento degli stati, immediata *)
+lemma ok_mTest_bits_MEM_BITS_full :
+ ∀sub:oct.
+ execute HCS08 MEM_BITS (TickOK ? (mTest_bits_status MEM_BITS sub 〈x0,x0〉)) 4 =
+ TickOK ? (set_pc_reg HCS08 MEM_BITS (mTest_bits_status MEM_BITS sub (byte8_of_bits (setn_array8T sub ? (bits_of_byte8 〈xF,xF〉) false))) (* nuovo PC *)
+           (mk_word16 〈x1,x8〉 〈x6,x3〉)).
+ intro;
+ elim sub;
+ reflexivity.
+qed.
+
+(* NB: la memoria e' cambiata e bisogna applicare eq_status *)
+lemma ok_mTest_bits_MEM_FUNC_full :
+∀sub:oct.
+ eq_status HCS08 MEM_FUNC
+  (match execute HCS08 MEM_FUNC (TickOK ? (mTest_bits_status MEM_FUNC sub 〈x0,x0〉)) 4
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+  (set_pc_reg HCS08 MEM_FUNC (mTest_bits_status MEM_FUNC sub 〈xF,xF〉) (* nuovo PC *) 〈〈x1,x8〉:〈x6,x3〉〉)
+  [ 〈〈x0,x0〉:〈x7,x0〉〉 ] = true.
+ intro; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x7,x0〉〉 ] HCS08 MEM_FUNC
+        (match execute HCS08 MEM_FUNC (TickOK ? (mTest_bits_status MEM_FUNC sub 〈x0,x0〉)) 4
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+        (set_pc_reg HCS08 MEM_FUNC (mTest_bits_status MEM_FUNC sub 〈xF,xF〉) (* nuovo PC *) 〈〈x1,x8〉:〈x6,x3〉〉));
+ normalize in ⊢ (? ? ? %);
+ reflexivity.
+qed.
+
+lemma ok_mTest_bits_MEM_TREE_full :
+∀sub:oct.
+ eq_status HCS08 MEM_TREE
+  (match execute HCS08 MEM_TREE (TickOK ? (mTest_bits_status MEM_TREE sub 〈x0,x0〉)) 4
+   with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+  (set_pc_reg HCS08 MEM_TREE (mTest_bits_status MEM_TREE sub 〈xF,xF〉) (* nuovo PC *) 〈〈x1,x8〉:〈x6,x3〉〉)
+  [ 〈〈x0,x0〉:〈x7,x0〉〉 ] = true.
+ intro; 
+ apply (eq_to_eqstatus_weak [ 〈〈x0,x0〉:〈x7,x0〉〉 ] HCS08 MEM_TREE
+        (match execute HCS08 MEM_TREE (TickOK ? (mTest_bits_status MEM_TREE sub 〈x0,x0〉)) 4
+         with [ TickERR s _ ⇒ s | TickSUSP s _ ⇒ s | TickOK s ⇒ s ])
+        (set_pc_reg HCS08 MEM_TREE (mTest_bits_status MEM_TREE sub 〈xF,xF〉) (* nuovo PC *) 〈〈x1,x8〉:〈x6,x3〉〉));
+ normalize in ⊢ (? ? ? %);
+ reflexivity.
+qed.
+*)
index 260e49ad05a78b0299149c18bae1d4c2cbcb402f..a8f505a9e5ea2675c65a3ae9be9f264e6798f2f6 100755 (executable)
@@ -346,8 +346,12 @@ ndefinition b8_to_recb8_aux3 : Πn1,n2.rec_byte8 〈n1,x0〉 → rec_byte8 〈n1
   | xF ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb))))))))))))))
   ].
 
-ndefinition b8_to_recb8 ≝
-λn.b8_to_recb8_aux3 (b8h n) (b8l n) (b8_to_recb8_aux2 (b8h n) (ex_to_recex (b8h n))).
+ndefinition b8_to_recb8 : Πb.rec_byte8 b.
+ #b;
+ nletin K ≝ (b8_to_recb8_aux3 (b8h b) (b8l b) (b8_to_recb8_aux2 (b8h b) (ex_to_recex (b8h b))));
+ nelim b in K:(%) ⊢ %;
+ #e1; #e2; nnormalize; #H; napply H.
+nqed.
 
 (* ottali → esadecimali *)
 ndefinition b8_of_bit ≝
index 965fb4b38c1921758449ef6acdd3b601c18f54a3..1d06fb2d1c9527614e35657263e28535879731d3 100755 (executable)
@@ -482,14 +482,12 @@ ndefinition w16_to_recw16_aux4 ≝
  | xF ⇒ w16_to_recw16_aux4_15 … recw
  ].
 
-nlemma w16_to_recw16_aux5 : ∀b.rec_byte8 (〈b8h b,b8l b〉) → rec_byte8 b.
- #b; nelim b; #e1; #e2; nnormalize; #input; napply input. nqed.
-
-ndefinition w16_to_recw16 ≝
-λn.w16_to_recw16_aux4 (w16h n) (b8h (w16l n)) (b8l (w16l n))
-    (w16_to_recw16_aux3 (w16h n) (b8h (w16l n)) (w16_to_recw16_aux2 (w16h n) ?)).
- nelim n; #b1; #b2;
- nchange with (rec_byte8 b1);
- napply (w16_to_recw16_aux5 b1);
- napply (b8_to_recb8 b1).
+ndefinition w16_to_recw16 : Πw.rec_word16 w.
+ #w;
+ nletin K ≝ (w16_to_recw16_aux4 (w16h w) (b8h (w16l w)) (b8l (w16l w))
+              (w16_to_recw16_aux3 (w16h w) (b8h (w16l w)) (w16_to_recw16_aux2 (w16h w) (b8_to_recb8 (w16h w)))));
+ nelim w in K:(%) ⊢ %;
+ #b1; #b2;
+ nelim b2;
+ #e1; #e2; nnormalize; #H; napply H.
 nqed.