+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/utility.ma".
-
-(* ************************* *)
-(* dimensioni degli elementi *)
-(* ************************* *)
-
-(* usato per definire nell'ast *)
-ninductive ast_base_type : Type ≝
- AST_BASE_TYPE_BYTE8: ast_base_type
-| AST_BASE_TYPE_WORD16: ast_base_type
-| AST_BASE_TYPE_WORD32: ast_base_type.
-
-ninductive ast_type : Type ≝
- AST_TYPE_BASE: ast_base_type → ast_type
-| AST_TYPE_ARRAY: ast_type → nat → ast_type
-| AST_TYPE_STRUCT: ne_list ast_type → ast_type.
-
-(* principio di eliminazione arricchito *)
-nlet rec ast_type_index_aux (P:ast_type → Prop)
- (f:Πt.P t → P (AST_TYPE_STRUCT (ne_nil ? t)))
- (f1:Πh,t.P h → P (AST_TYPE_STRUCT t) → P (AST_TYPE_STRUCT (ne_cons ? h t)))
- (f2:Πt.P t)
- (t:ne_list ast_type) on t ≝
- match t return λt.P (AST_TYPE_STRUCT t) with
- [ ne_nil h ⇒ f h (f2 h)
- | ne_cons h t ⇒ f1 h t (f2 h) (ast_type_index_aux P f f1 f2 t)
- ].
-
-nlet rec ast_type_index (P:ast_type → Prop)
- (f:Πb.P (AST_TYPE_BASE b))
- (f1:Πt,n.P t → P (AST_TYPE_ARRAY t n))
- (f2:Πt.P t → P (AST_TYPE_STRUCT (ne_nil ? t)))
- (f3:Πh,t.P h → P (AST_TYPE_STRUCT t) → P (AST_TYPE_STRUCT (ne_cons ? h t)))
- (t:ast_type) on t : P t ≝
- match t return λt.P t with
- [ AST_TYPE_BASE b ⇒ f b
- | AST_TYPE_ARRAY t' n ⇒ f1 t' n (ast_type_index P f f1 f2 f3 t')
- | AST_TYPE_STRUCT nl ⇒ match nl with
- [ ne_nil h ⇒ f2 h (ast_type_index P f f1 f2 f3 h)
- | ne_cons h t ⇒ f3 h t (ast_type_index P f f1 f2 f3 h) (ast_type_index_aux P f2 f3 (ast_type_index P f f1 f2 f3) t)
- ]
- ].
-
-nlet rec ast_type_rectex_aux (P:ast_type → Type)
- (f:Πt.P t → P (AST_TYPE_STRUCT (ne_nil ? t)))
- (f1:Πh,t.P h → P (AST_TYPE_STRUCT t) → P (AST_TYPE_STRUCT (ne_cons ? h t)))
- (f2:Πt.P t)
- (t:ne_list ast_type) on t ≝
- match t return λt.P (AST_TYPE_STRUCT t) with
- [ ne_nil h ⇒ f h (f2 h)
- | ne_cons h t ⇒ f1 h t (f2 h) (ast_type_rectex_aux P f f1 f2 t)
- ].
-
-nlet rec ast_type_rectex (P:ast_type → Type)
- (f:Πb.P (AST_TYPE_BASE b))
- (f1:Πt,n.P t → P (AST_TYPE_ARRAY t n))
- (f2:Πt.P t → P (AST_TYPE_STRUCT (ne_nil ? t)))
- (f3:Πh,t.P h → P (AST_TYPE_STRUCT t) → P (AST_TYPE_STRUCT (ne_cons ? h t)))
- (t:ast_type) on t : P t ≝
- match t return λt.P t with
- [ AST_TYPE_BASE b ⇒ f b
- | AST_TYPE_ARRAY t' n ⇒ f1 t' n (ast_type_rectex P f f1 f2 f3 t')
- | AST_TYPE_STRUCT nl ⇒ match nl with
- [ ne_nil h ⇒ f2 h (ast_type_rectex P f f1 f2 f3 h)
- | ne_cons h t ⇒ f3 h t (ast_type_rectex P f f1 f2 f3 h) (ast_type_rectex_aux P f2 f3 (ast_type_rectex P f f1 f2 f3) t)
- ]
- ].
-
-ndefinition eq_ast_base_type ≝
-λt1,t2:ast_base_type.match t1 with
- [ AST_BASE_TYPE_BYTE8 ⇒ match t2 with
- [ AST_BASE_TYPE_BYTE8 ⇒ true | _ ⇒ false ]
- | AST_BASE_TYPE_WORD16 ⇒ match t2 with
- [ AST_BASE_TYPE_WORD16 ⇒ true | _ ⇒ false ]
- | AST_BASE_TYPE_WORD32 ⇒ match t2 with
- [ AST_BASE_TYPE_WORD32 ⇒ true | _ ⇒ false ]
- ].
-
-nlet rec eq_ast_type (t1,t2:ast_type) on t1 ≝
- match t1 with
- [ AST_TYPE_BASE bType1 ⇒ match t2 with
- [ AST_TYPE_BASE bType2 ⇒ eq_ast_base_type bType1 bType2
- | _ ⇒ false ]
- | AST_TYPE_ARRAY subType1 dim1 ⇒ match t2 with
- [ AST_TYPE_ARRAY subType2 dim2 ⇒ (eq_ast_type subType1 subType2) ⊗ (eq_nat dim1 dim2)
- | _ ⇒ false ]
- | AST_TYPE_STRUCT nelSubType1 ⇒ match t2 with
- [ AST_TYPE_STRUCT nelSubType2 ⇒ bfold_right_neList2 ? (λx1,x2.eq_ast_type x1 x2) nelSubType1 nelSubType2
- | _ ⇒ false
- ]
- ].
-
-ndefinition is_ast_base_type ≝
-λast:ast_type.match ast with [ AST_TYPE_BASE _ ⇒ True | _ ⇒ False ].
-
-ndefinition isb_ast_base_type ≝
-λast:ast_type.match ast with [ AST_TYPE_BASE _ ⇒ true | _ ⇒ false ].
-
-ndefinition isnt_ast_base_type ≝
-λast:ast_type.match ast with [ AST_TYPE_BASE _ ⇒ False | _ ⇒ True ].
-
-ndefinition isntb_ast_base_type ≝
-λast:ast_type.match ast with [ AST_TYPE_BASE _ ⇒ false | _ ⇒ true ].
-
-ndefinition eval_size_base_type ≝
-λast:ast_base_type.match ast with
- [ AST_BASE_TYPE_BYTE8 ⇒ 1
- | AST_BASE_TYPE_WORD16 ⇒ 2
- | AST_BASE_TYPE_WORD32 ⇒ 4
- ].
-
-nlet rec eval_size_type (ast:ast_type) on ast ≝
- match ast with
- [ AST_TYPE_BASE b ⇒ eval_size_base_type b
- | AST_TYPE_ARRAY sub_ast dim ⇒ (dim+1)*(eval_size_type sub_ast)
- | AST_TYPE_STRUCT nel_ast ⇒ fold_right_neList … (λt,x.(eval_size_type t)+x) O nel_ast
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "compiler/ast_type.ma".
-include "utility/utility_lemmas.ma".
-
-(* ************************* *)
-(* dimensioni degli elementi *)
-(* ************************* *)
-
-ndefinition astbasetype_destruct_aux ≝
-Πb1,b2:ast_base_type.ΠP:Prop.b1 = b2 →
- match b1 with
- [ AST_BASE_TYPE_BYTE8 ⇒ match b2 with [ AST_BASE_TYPE_BYTE8 ⇒ P → P | _ ⇒ P ]
- | AST_BASE_TYPE_WORD16 ⇒ match b2 with [ AST_BASE_TYPE_WORD16 ⇒ P → P | _ ⇒ P ]
- | AST_BASE_TYPE_WORD32 ⇒ match b2 with [ AST_BASE_TYPE_WORD32 ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition astbasetype_destruct : astbasetype_destruct_aux.
- #b1; #b2; #P;
- nelim b1;
- nelim b2;
- nnormalize;
- #H;
- ##[ ##1,5,9: napply (λx:P.x)
- ##| ##2,3: napply (False_ind (λ_.?) ?);
- nchange with (match AST_BASE_TYPE_BYTE8 with [ AST_BASE_TYPE_BYTE8 ⇒ False | _ ⇒ True]);
- nrewrite > H;
- nnormalize;
- napply I
- ##| ##4,6: napply (False_ind (λ_.?) ?);
- nchange with (match AST_BASE_TYPE_WORD16 with [ AST_BASE_TYPE_WORD16 ⇒ False | _ ⇒ True]);
- nrewrite > H;
- nnormalize;
- napply I
- ##| ##7,8: napply (False_ind (λ_.?) ?);
- nchange with (match AST_BASE_TYPE_WORD32 with [ AST_BASE_TYPE_WORD32 ⇒ False | _ ⇒ True]);
- nrewrite > H;
- nnormalize;
- napply I
- ##]
-nqed.
-
-nlemma symmetric_eqastbasetype : symmetricT ast_base_type bool eq_ast_base_type.
- #b1; #b2; ncases b1; ncases b2; nnormalize; napply refl_eq. nqed.
-
-nlemma eqastbasetype_to_eq : ∀b1,b2.eq_ast_base_type b1 b2 = true → b1 = b2.
- #b1; #b2; ncases b1; ncases b2; nnormalize;
- ##[ ##1,5,9: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqastbasetype : ∀b1,b2.b1 = b2 → eq_ast_base_type b1 b2 = true.
- #b1; #b2; ncases b1; ncases b2; nnormalize;
- ##[ ##1,5,9: #H; napply refl_eq
- ##| ##*: #H; napply (astbasetype_destruct … H)
- ##]
-nqed.
-
-nlemma asttype_destruct_base_base : ∀b1,b2.AST_TYPE_BASE b1 = AST_TYPE_BASE b2 → b1 = b2.
- #b1; #b2; #H;
- nchange with (match AST_TYPE_BASE b2 with [ AST_TYPE_BASE a ⇒ b1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma asttype_destruct_array_array_1 : ∀x1,x2,y1,y2.AST_TYPE_ARRAY x1 y1 = AST_TYPE_ARRAY x2 y2 → x1 = x2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match AST_TYPE_ARRAY x2 y2 with [ AST_TYPE_ARRAY a _ ⇒ x1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma asttype_destruct_array_array_2 : ∀x1,x2,y1,y2.AST_TYPE_ARRAY x1 y1 = AST_TYPE_ARRAY x2 y2 → y1 = y2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match AST_TYPE_ARRAY x2 y2 with [ AST_TYPE_ARRAY _ b ⇒ y1 = b | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma asttype_destruct_struct_struct : ∀b1,b2.AST_TYPE_STRUCT b1 = AST_TYPE_STRUCT b2 → b1 = b2.
- #b1; #b2; #H;
- nchange with (match AST_TYPE_STRUCT b2 with [ AST_TYPE_STRUCT a ⇒ b1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition asttype_destruct_aux ≝
-Πb1,b2:ast_type.ΠP:Prop.b1 = b2 →
- match b1 with
- [ AST_TYPE_BASE s1 ⇒ match b2 with
- [ AST_TYPE_BASE s2 ⇒ match s1 with
- [ AST_BASE_TYPE_BYTE8 ⇒ match s2 with [ AST_BASE_TYPE_BYTE8 ⇒ P → P | _ ⇒ P ]
- | AST_BASE_TYPE_WORD16 ⇒ match s2 with [ AST_BASE_TYPE_WORD16 ⇒ P → P | _ ⇒ P ]
- | AST_BASE_TYPE_WORD32 ⇒ match s2 with [ AST_BASE_TYPE_WORD32 ⇒ P → P | _ ⇒ P ]
- ] | _ ⇒ P ]
- | AST_TYPE_ARRAY _ _ ⇒ match b2 with [ AST_TYPE_ARRAY _ _ ⇒ P → P | _ ⇒ P ]
- | AST_TYPE_STRUCT _ ⇒ match b2 with [ AST_TYPE_STRUCT _ ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition asttype_destruct : asttype_destruct_aux.
- #b1; #b2; #P;
- ncases b1;
- ##[ ##1: ncases b2;
- ##[ ##1: nnormalize; #s1; #s2; ncases s1; ncases s2; nnormalize;
- ##[ ##1,5,9: #H; napply (λx:P.x)
- ##| ##*: #H; napply (astbasetype_destruct … (asttype_destruct_base_base … H))
- ##]
- ##| ##2: #t; #n; #b; nnormalize; #H
- ##| ##3: #l; #b; nnormalize; #H
- ##]
- napply (False_ind (λ_.?) ?);
- nchange with (match AST_TYPE_BASE b with [ AST_TYPE_BASE _ ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##2: ncases b2;
- ##[ ##2: #t1; #n1; #t2; #n2; nnormalize; #H; napply (λx:P.x)
- ##| ##1: #b; #t; #n; nnormalize; #H
- ##| ##3: #l; #t; #n; nnormalize; #H
- ##]
- napply (False_ind (λ_.?) ?);
- nchange with (match AST_TYPE_ARRAY t n with [ AST_TYPE_ARRAY _ _ ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##3: ncases b2;
- ##[ ##3: #l1; #l2; nnormalize; #H; napply (λx:P.x)
- ##| ##1: #b; #l; nnormalize; #H
- ##| ##2: #t; #n; #l; nnormalize; #H
- ##]
- napply (False_ind (λ_.?) ?);
- nchange with (match AST_TYPE_STRUCT l with [ AST_TYPE_STRUCT _ ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-nlemma symmetric_eqasttype_aux1
- : ∀nl1,nl2.
- (eq_ast_type (AST_TYPE_STRUCT nl1) (AST_TYPE_STRUCT nl2)) = (eq_ast_type (AST_TYPE_STRUCT nl2) (AST_TYPE_STRUCT nl1)) →
- (bfold_right_neList2 ? (λx,y.eq_ast_type x y) nl1 nl2) = (bfold_right_neList2 ? (λx,y.eq_ast_type x y) nl2 nl1).
- #nl1; #nl2; #H;
- napply H.
-nqed.
-
-nlemma symmetric_eqasttype : symmetricT ast_type bool eq_ast_type.
- #t1; napply (ast_type_index … t1);
- ##[ ##1: #b1; #t2; ncases t2;
- ##[ ##1: #b2; nchange with ((eq_ast_base_type b1 b2) = (eq_ast_base_type b2 b1));
- nrewrite > (symmetric_eqastbasetype b1 b2);
- napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##| ##3: #nl2; nnormalize; napply refl_eq
- ##]
- ##| ##2: #st1; #n1; #H; #t2; ncases t2;
- ##[ ##2: #st2; #n2; nchange with (((eq_ast_type st1 st2)⊗(eq_nat n1 n2)) = ((eq_ast_type st2 st1)⊗(eq_nat n2 n1)));
- nrewrite > (symmetric_eqnat n1 n2);
- nrewrite > (H st2);
- napply refl_eq
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##3: #nl2; nnormalize; napply refl_eq
- ##]
- ##| ##3: #hh1; #H; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nchange with ((eq_ast_type hh1 hh2) = (eq_ast_type hh2 hh1));
- nrewrite > (H hh2);
- napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize; napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##]
- ##| ##4: #hh1; #ll1; #H; #H1; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize;
- nrewrite > (H hh2);
- nrewrite > (symmetric_eqasttype_aux1 ll1 ll2 (H1 (AST_TYPE_STRUCT ll2)));
- napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma eqasttype_to_eq : ∀t1,t2.eq_ast_type t1 t2 = true → t1 = t2.
- #t1;
- napply (ast_type_index … t1);
- ##[ ##1: #b1; #t2; ncases t2;
- ##[ ##1: #b2; #H; nchange in H:(%) with ((eq_ast_base_type b1 b2) = true);
- nrewrite > (eqastbasetype_to_eq b1 b2 H);
- napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; #H; napply (bool_destruct … H)
- ##| ##3: #nl2; nnormalize; #H; napply (bool_destruct … H)
- ##]
- ##| ##2: #st1; #n1; #H; #t2; ncases t2;
- ##[ ##2: #st2; #n2; #H1; nchange in H1:(%) with (((eq_ast_type st1 st2)⊗(eq_nat n1 n2)) = true);
- nrewrite > (H st2 (andb_true_true_l … H1));
- nrewrite > (eqnat_to_eq n1 n2 (andb_true_true_r … H1));
- napply refl_eq
- ##| ##1: #b2; nnormalize; #H1; napply (bool_destruct … H1)
- ##| ##3: #nl2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##3: #hh1; #H; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; #H1; nchange in H1:(%) with ((eq_ast_type hh1 hh2) = true);
- nrewrite > (H hh2 H1);
- napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##1: #b2; nnormalize; #H1; napply (bool_destruct … H1)
- ##| ##2: #st2; #n2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##4: #hh1; #ll1; #H; #H1; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #hh2; #ll2; #H2; nchange in H2:(%) with (((eq_ast_type hh1 hh2)⊗(bfold_right_neList2 ? (λx,y.eq_ast_type x y) ll1 ll2)) = true);
- nrewrite > (H hh2 (andb_true_true_l … H2));
- nrewrite > (asttype_destruct_struct_struct ll1 ll2 (H1 (AST_TYPE_STRUCT ll2) (andb_true_true_r … H2)));
- napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #st2; #n2; nnormalize; #H2; napply (bool_destruct … H2)
- ##]
- ##]
-nqed.
-
-nlemma eq_to_eqasttype_aux1
- : ∀nl1,nl2.
- ((eq_ast_type (AST_TYPE_STRUCT nl1) (AST_TYPE_STRUCT nl2)) = true) →
- ((bfold_right_neList2 ? (λx,y.eq_ast_type x y) nl1 nl2) = true).
- #nl1; #nl2; #H;
- napply H.
-nqed.
-
-nlemma eq_to_eqasttype : ∀t1,t2.t1 = t2 → eq_ast_type t1 t2 = true.
- #t1;
- napply (ast_type_index … t1);
- ##[ ##1: #b1; #t2; ncases t2;
- ##[ ##1: #b2; #H; nrewrite > (asttype_destruct_base_base … H);
- nchange with ((eq_ast_base_type b2 b2) = true);
- nrewrite > (eq_to_eqastbasetype b2 b2 (refl_eq …));
- napply refl_eq
- ##| ##2: #st2; #n2; #H; napply (asttype_destruct … H)
- ##| ##3: #nl2; #H; napply (asttype_destruct … H)
- ##]
- ##| ##2: #st1; #n1; #H; #t2; ncases t2;
- ##[ ##2: #st2; #n2; #H1; nchange with (((eq_ast_type st1 st2)⊗(eq_nat n1 n2)) = true);
- nrewrite > (H st2 (asttype_destruct_array_array_1 … H1));
- nrewrite > (eq_to_eqnat n1 n2 (asttype_destruct_array_array_2 … H1));
- nnormalize;
- napply refl_eq
- ##| ##1: #b2; #H1; napply (asttype_destruct … H1)
- ##| ##3: #nl2; #H1; napply (asttype_destruct … H1)
- ##]
- ##| ##3: #hh1; #H; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; #H1; nchange with ((eq_ast_type hh1 hh2) = true);
- nrewrite > (H hh2 (nelist_destruct_nil_nil ? hh1 hh2 (asttype_destruct_struct_struct … H1)));
- napply refl_eq
- ##| ##2: #hh2; #ll2; #H1; nelim (nelist_destruct_nil_cons ? hh1 hh2 ll2 (asttype_destruct_struct_struct … H1))
- ##]
- ##| ##1: #b2; #H1; napply (asttype_destruct … H1)
- ##| ##2: #st2; #n2; #H1; napply (asttype_destruct … H1)
- ##]
- ##| ##4: #hh1; #ll1; #H; #H1; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; #H2; nelim (nelist_destruct_cons_nil ? hh1 hh2 ll1 (asttype_destruct_struct_struct … H2))
- ##| ##2: #hh2; #ll2; #H2; nchange with (((eq_ast_type hh1 hh2)⊗(bfold_right_neList2 ? (λx,y.eq_ast_type x y) ll1 ll2)) = true);
- nrewrite > (H hh2 (nelist_destruct_cons_cons_1 … (asttype_destruct_struct_struct … H2)));
- nrewrite > (eq_to_eqasttype_aux1 ll1 ll2 (H1 (AST_TYPE_STRUCT ll2) ?));
- ##[ ##1: nnormalize; napply refl_eq
- ##| ##2: nrewrite > (nelist_destruct_cons_cons_2 … (asttype_destruct_struct_struct … H2));
- napply refl_eq
- ##]
- ##]
- ##| ##1: #b2; #H2; napply (asttype_destruct … H2)
- ##| ##2: #st2; #n2; #H2; napply (asttype_destruct … H2)
- ##]
- ##]
-nqed.
-
-nlemma isbastbasetype_to_isastbasetype : ∀ast.isb_ast_base_type ast = true → is_ast_base_type ast.
- #ast;
- ncases ast;
- nnormalize;
- ##[ ##1: #t; #H; napply I
- ##| ##2: #t; #n; #H; napply (bool_destruct … H)
- ##| ##3: #t; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma isntbastbasetype_to_isntastbasetype : ∀ast.isntb_ast_base_type ast = true → isnt_ast_base_type ast.
- #ast;
- ncases ast;
- nnormalize;
- ##[ ##1: #t; #H; napply (bool_destruct … H)
- ##| ##2: #t; #n; #H; napply I
- ##| ##3: #l; #H; napply I
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ************* *)
-(* BITRIGESIMALI *)
-(* ************* *)
-
-ninductive bitrigesim : Type ≝
- t00: bitrigesim
-| t01: bitrigesim
-| t02: bitrigesim
-| t03: bitrigesim
-| t04: bitrigesim
-| t05: bitrigesim
-| t06: bitrigesim
-| t07: bitrigesim
-| t08: bitrigesim
-| t09: bitrigesim
-| t0A: bitrigesim
-| t0B: bitrigesim
-| t0C: bitrigesim
-| t0D: bitrigesim
-| t0E: bitrigesim
-| t0F: bitrigesim
-| t10: bitrigesim
-| t11: bitrigesim
-| t12: bitrigesim
-| t13: bitrigesim
-| t14: bitrigesim
-| t15: bitrigesim
-| t16: bitrigesim
-| t17: bitrigesim
-| t18: bitrigesim
-| t19: bitrigesim
-| t1A: bitrigesim
-| t1B: bitrigesim
-| t1C: bitrigesim
-| t1D: bitrigesim
-| t1E: bitrigesim
-| t1F: bitrigesim.
-
-(* operatore = *)
-ndefinition eq_bit ≝
-λt1,t2:bitrigesim.
- match t1 with
- [ t00 ⇒ match t2 with [ t00 ⇒ true | _ ⇒ false ]
- | t01 ⇒ match t2 with [ t01 ⇒ true | _ ⇒ false ]
- | t02 ⇒ match t2 with [ t02 ⇒ true | _ ⇒ false ]
- | t03 ⇒ match t2 with [ t03 ⇒ true | _ ⇒ false ]
- | t04 ⇒ match t2 with [ t04 ⇒ true | _ ⇒ false ]
- | t05 ⇒ match t2 with [ t05 ⇒ true | _ ⇒ false ]
- | t06 ⇒ match t2 with [ t06 ⇒ true | _ ⇒ false ]
- | t07 ⇒ match t2 with [ t07 ⇒ true | _ ⇒ false ]
- | t08 ⇒ match t2 with [ t08 ⇒ true | _ ⇒ false ]
- | t09 ⇒ match t2 with [ t09 ⇒ true | _ ⇒ false ]
- | t0A ⇒ match t2 with [ t0A ⇒ true | _ ⇒ false ]
- | t0B ⇒ match t2 with [ t0B ⇒ true | _ ⇒ false ]
- | t0C ⇒ match t2 with [ t0C ⇒ true | _ ⇒ false ]
- | t0D ⇒ match t2 with [ t0D ⇒ true | _ ⇒ false ]
- | t0E ⇒ match t2 with [ t0E ⇒ true | _ ⇒ false ]
- | t0F ⇒ match t2 with [ t0F ⇒ true | _ ⇒ false ]
- | t10 ⇒ match t2 with [ t10 ⇒ true | _ ⇒ false ]
- | t11 ⇒ match t2 with [ t11 ⇒ true | _ ⇒ false ]
- | t12 ⇒ match t2 with [ t12 ⇒ true | _ ⇒ false ]
- | t13 ⇒ match t2 with [ t13 ⇒ true | _ ⇒ false ]
- | t14 ⇒ match t2 with [ t14 ⇒ true | _ ⇒ false ]
- | t15 ⇒ match t2 with [ t15 ⇒ true | _ ⇒ false ]
- | t16 ⇒ match t2 with [ t16 ⇒ true | _ ⇒ false ]
- | t17 ⇒ match t2 with [ t17 ⇒ true | _ ⇒ false ]
- | t18 ⇒ match t2 with [ t18 ⇒ true | _ ⇒ false ]
- | t19 ⇒ match t2 with [ t19 ⇒ true | _ ⇒ false ]
- | t1A ⇒ match t2 with [ t1A ⇒ true | _ ⇒ false ]
- | t1B ⇒ match t2 with [ t1B ⇒ true | _ ⇒ false ]
- | t1C ⇒ match t2 with [ t1C ⇒ true | _ ⇒ false ]
- | t1D ⇒ match t2 with [ t1D ⇒ true | _ ⇒ false ]
- | t1E ⇒ match t2 with [ t1E ⇒ true | _ ⇒ false ]
- | t1F ⇒ match t2 with [ t1F ⇒ true | _ ⇒ false ]
- ].
-
-(* iteratore sui bitrigesimali *)
-ndefinition forall_bit ≝ λP.
- P t00 ⊗ P t01 ⊗ P t02 ⊗ P t03 ⊗ P t04 ⊗ P t05 ⊗ P t06 ⊗ P t07 ⊗
- P t08 ⊗ P t09 ⊗ P t0A ⊗ P t0B ⊗ P t0C ⊗ P t0D ⊗ P t0E ⊗ P t0F ⊗
- P t10 ⊗ P t11 ⊗ P t12 ⊗ P t13 ⊗ P t14 ⊗ P t15 ⊗ P t16 ⊗ P t17 ⊗
- P t18 ⊗ P t19 ⊗ P t1A ⊗ P t1B ⊗ P t1C ⊗ P t1D ⊗ P t1E ⊗ P t1F.
-
-(* operatore successore *)
-ndefinition succ_bit ≝
-λn.match n with
- [ t00 ⇒ t01 | t01 ⇒ t02 | t02 ⇒ t03 | t03 ⇒ t04 | t04 ⇒ t05 | t05 ⇒ t06 | t06 ⇒ t07 | t07 ⇒ t08
- | t08 ⇒ t09 | t09 ⇒ t0A | t0A ⇒ t0B | t0B ⇒ t0C | t0C ⇒ t0D | t0D ⇒ t0E | t0E ⇒ t0F | t0F ⇒ t10
- | t10 ⇒ t11 | t11 ⇒ t12 | t12 ⇒ t13 | t13 ⇒ t14 | t14 ⇒ t15 | t15 ⇒ t16 | t16 ⇒ t17 | t17 ⇒ t18
- | t18 ⇒ t19 | t19 ⇒ t1A | t1A ⇒ t1B | t1B ⇒ t1C | t1C ⇒ t1D | t1D ⇒ t1E | t1E ⇒ t1F | t1F ⇒ t00
- ].
-
-(* bitrigesimali ricorsivi *)
-ninductive rec_bitrigesim : bitrigesim → Type ≝
- bi_O : rec_bitrigesim t00
-| bi_S : ∀n.rec_bitrigesim n → rec_bitrigesim (succ_bit n).
-
-(* bitrigesimali → bitrigesimali ricorsivi *)
-ndefinition bit_to_recbit ≝
-λn.match n return λx.rec_bitrigesim x with
- [ t00 ⇒ bi_O
- | t01 ⇒ bi_S ? bi_O
- | t02 ⇒ bi_S ? (bi_S ? bi_O)
- | t03 ⇒ bi_S ? (bi_S ? (bi_S ? bi_O))
- | t04 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))
- | t05 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))
- | t06 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))
- | t07 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))
- | t08 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- bi_O)))))))
- | t09 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? bi_O))))))))
- | t0A ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? bi_O)))))))))
- | t0B ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))
- | t0C ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))
- | t0D ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))
- | t0E ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))))
- | t0F ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))
- | t10 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- bi_O)))))))))))))))
- | t11 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? bi_O))))))))))))))))
- | t12 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? bi_O)))))))))))))))))
- | t13 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))
- | t14 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))))))))))
- | t15 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))))
- | t16 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))))))))))))
- | t17 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))))))
- | t18 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- bi_O)))))))))))))))))))))))
- | t19 ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? bi_O))))))))))))))))))))))))
- | t1A ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? bi_O)))))))))))))))))))))))))
- | t1B ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))))))))))
- | t1C ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))))))))))))))))))
- | t1D ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))))))))))))
- | t1E ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O)))))))))))))))))))))))))))))
- | t1F ⇒ bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ?
- (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? (bi_S ? bi_O))))))))))))))))))))))))))))))
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/bitrigesim.ma".
-
-(* ************* *)
-(* BITRIGESIMALI *)
-(* ************* *)
-
-ndefinition bitrigesim_destruct1 :
-Πt2:bitrigesim.ΠP:Prop.t00 = t2 → match t2 with [ t00 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##1: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t00 with [ t00 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct2 :
-Πt2:bitrigesim.ΠP:Prop.t01 = t2 → match t2 with [ t01 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##2: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t01 with [ t01 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct3 :
-Πt2:bitrigesim.ΠP:Prop.t02 = t2 → match t2 with [ t02 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##3: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t02 with [ t02 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct4 :
-Πt2:bitrigesim.ΠP:Prop.t03 = t2 → match t2 with [ t03 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##4: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t03 with [ t03 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct5 :
-Πt2:bitrigesim.ΠP:Prop.t04 = t2 → match t2 with [ t04 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##5: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t04 with [ t04 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct6 :
-Πt2:bitrigesim.ΠP:Prop.t05 = t2 → match t2 with [ t05 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##6: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t05 with [ t05 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct7 :
-Πt2:bitrigesim.ΠP:Prop.t06 = t2 → match t2 with [ t06 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##7: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t06 with [ t06 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct8 :
-Πt2:bitrigesim.ΠP:Prop.t07 = t2 → match t2 with [ t07 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##8: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t07 with [ t07 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct9 :
-Πt2:bitrigesim.ΠP:Prop.t08 = t2 → match t2 with [ t08 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##9: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t08 with [ t08 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct10 :
-Πt2:bitrigesim.ΠP:Prop.t09 = t2 → match t2 with [ t09 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##10: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t09 with [ t09 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct11 :
-Πt2:bitrigesim.ΠP:Prop.t0A = t2 → match t2 with [ t0A ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##11: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0A with [ t0A ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct12 :
-Πt2:bitrigesim.ΠP:Prop.t0B = t2 → match t2 with [ t0B ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##12: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0B with [ t0B ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct13 :
-Πt2:bitrigesim.ΠP:Prop.t0C = t2 → match t2 with [ t0C ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##13: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0C with [ t0C ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct14 :
-Πt2:bitrigesim.ΠP:Prop.t0D = t2 → match t2 with [ t0D ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##14: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0D with [ t0D ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct15 :
-Πt2:bitrigesim.ΠP:Prop.t0E = t2 → match t2 with [ t0E ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##15: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0E with [ t0E ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct16 :
-Πt2:bitrigesim.ΠP:Prop.t0F = t2 → match t2 with [ t0F ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##16: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t0F with [ t0F ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct17 :
-Πt2:bitrigesim.ΠP:Prop.t10 = t2 → match t2 with [ t10 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##17: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t10 with [ t10 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct18 :
-Πt2:bitrigesim.ΠP:Prop.t11 = t2 → match t2 with [ t11 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##18: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t11 with [ t11 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct19 :
-Πt2:bitrigesim.ΠP:Prop.t12 = t2 → match t2 with [ t12 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##19: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t12 with [ t12 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct20 :
-Πt2:bitrigesim.ΠP:Prop.t13 = t2 → match t2 with [ t13 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##20: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t13 with [ t13 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct21 :
-Πt2:bitrigesim.ΠP:Prop.t14 = t2 → match t2 with [ t14 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##21: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t14 with [ t14 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct22 :
-Πt2:bitrigesim.ΠP:Prop.t15 = t2 → match t2 with [ t15 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##22: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t15 with [ t15 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct23 :
-Πt2:bitrigesim.ΠP:Prop.t16 = t2 → match t2 with [ t16 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##23: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t16 with [ t16 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct24 :
-Πt2:bitrigesim.ΠP:Prop.t17 = t2 → match t2 with [ t17 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##24: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t17 with [ t17 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct25 :
-Πt2:bitrigesim.ΠP:Prop.t18 = t2 → match t2 with [ t18 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##25: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t18 with [ t18 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct26 :
-Πt2:bitrigesim.ΠP:Prop.t19 = t2 → match t2 with [ t19 ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##26: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t19 with [ t19 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct27 :
-Πt2:bitrigesim.ΠP:Prop.t1A = t2 → match t2 with [ t1A ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##27: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1A with [ t1A ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct28 :
-Πt2:bitrigesim.ΠP:Prop.t1B = t2 → match t2 with [ t1B ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##28: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1B with [ t1B ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct29 :
-Πt2:bitrigesim.ΠP:Prop.t1C = t2 → match t2 with [ t1C ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##29: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1C with [ t1C ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct30 :
-Πt2:bitrigesim.ΠP:Prop.t1D = t2 → match t2 with [ t1D ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##30: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1D with [ t1D ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct31 :
-Πt2:bitrigesim.ΠP:Prop.t1E = t2 → match t2 with [ t1E ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##31: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1E with [ t1E ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct32 :
-Πt2:bitrigesim.ΠP:Prop.t1F = t2 → match t2 with [ t1F ⇒ P → P | _ ⇒ P ].
- #t2; #P;
- ncases t2;
- nnormalize; #H;
- ##[ ##32: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match t1F with [ t1F ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition bitrigesim_destruct_aux ≝
-Πt1,t2:bitrigesim.ΠP:Prop.t1 = t2 →
- match t1 with
- [ t00 ⇒ match t2 with [ t00 ⇒ P → P | _ ⇒ P ]
- | t01 ⇒ match t2 with [ t01 ⇒ P → P | _ ⇒ P ]
- | t02 ⇒ match t2 with [ t02 ⇒ P → P | _ ⇒ P ]
- | t03 ⇒ match t2 with [ t03 ⇒ P → P | _ ⇒ P ]
- | t04 ⇒ match t2 with [ t04 ⇒ P → P | _ ⇒ P ]
- | t05 ⇒ match t2 with [ t05 ⇒ P → P | _ ⇒ P ]
- | t06 ⇒ match t2 with [ t06 ⇒ P → P | _ ⇒ P ]
- | t07 ⇒ match t2 with [ t07 ⇒ P → P | _ ⇒ P ]
- | t08 ⇒ match t2 with [ t08 ⇒ P → P | _ ⇒ P ]
- | t09 ⇒ match t2 with [ t09 ⇒ P → P | _ ⇒ P ]
- | t0A ⇒ match t2 with [ t0A ⇒ P → P | _ ⇒ P ]
- | t0B ⇒ match t2 with [ t0B ⇒ P → P | _ ⇒ P ]
- | t0C ⇒ match t2 with [ t0C ⇒ P → P | _ ⇒ P ]
- | t0D ⇒ match t2 with [ t0D ⇒ P → P | _ ⇒ P ]
- | t0E ⇒ match t2 with [ t0E ⇒ P → P | _ ⇒ P ]
- | t0F ⇒ match t2 with [ t0F ⇒ P → P | _ ⇒ P ]
- | t10 ⇒ match t2 with [ t10 ⇒ P → P | _ ⇒ P ]
- | t11 ⇒ match t2 with [ t11 ⇒ P → P | _ ⇒ P ]
- | t12 ⇒ match t2 with [ t12 ⇒ P → P | _ ⇒ P ]
- | t13 ⇒ match t2 with [ t13 ⇒ P → P | _ ⇒ P ]
- | t14 ⇒ match t2 with [ t14 ⇒ P → P | _ ⇒ P ]
- | t15 ⇒ match t2 with [ t15 ⇒ P → P | _ ⇒ P ]
- | t16 ⇒ match t2 with [ t16 ⇒ P → P | _ ⇒ P ]
- | t17 ⇒ match t2 with [ t17 ⇒ P → P | _ ⇒ P ]
- | t18 ⇒ match t2 with [ t18 ⇒ P → P | _ ⇒ P ]
- | t19 ⇒ match t2 with [ t19 ⇒ P → P | _ ⇒ P ]
- | t1A ⇒ match t2 with [ t1A ⇒ P → P | _ ⇒ P ]
- | t1B ⇒ match t2 with [ t1B ⇒ P → P | _ ⇒ P ]
- | t1C ⇒ match t2 with [ t1C ⇒ P → P | _ ⇒ P ]
- | t1D ⇒ match t2 with [ t1D ⇒ P → P | _ ⇒ P ]
- | t1E ⇒ match t2 with [ t1E ⇒ P → P | _ ⇒ P ]
- | t1F ⇒ match t2 with [ t1F ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition bitrigesim_destruct : bitrigesim_destruct_aux.
- #t1;
- ncases t1;
- ##[ ##1: napply bitrigesim_destruct1
- ##| ##2: napply bitrigesim_destruct2
- ##| ##3: napply bitrigesim_destruct3
- ##| ##4: napply bitrigesim_destruct4
- ##| ##5: napply bitrigesim_destruct5
- ##| ##6: napply bitrigesim_destruct6
- ##| ##7: napply bitrigesim_destruct7
- ##| ##8: napply bitrigesim_destruct8
- ##| ##9: napply bitrigesim_destruct9
- ##| ##10: napply bitrigesim_destruct10
- ##| ##11: napply bitrigesim_destruct11
- ##| ##12: napply bitrigesim_destruct12
- ##| ##13: napply bitrigesim_destruct13
- ##| ##14: napply bitrigesim_destruct14
- ##| ##15: napply bitrigesim_destruct15
- ##| ##16: napply bitrigesim_destruct16
- ##| ##17: napply bitrigesim_destruct17
- ##| ##18: napply bitrigesim_destruct18
- ##| ##19: napply bitrigesim_destruct19
- ##| ##20: napply bitrigesim_destruct20
- ##| ##21: napply bitrigesim_destruct21
- ##| ##22: napply bitrigesim_destruct22
- ##| ##23: napply bitrigesim_destruct23
- ##| ##24: napply bitrigesim_destruct24
- ##| ##25: napply bitrigesim_destruct25
- ##| ##26: napply bitrigesim_destruct26
- ##| ##27: napply bitrigesim_destruct27
- ##| ##28: napply bitrigesim_destruct28
- ##| ##29: napply bitrigesim_destruct29
- ##| ##30: napply bitrigesim_destruct30
- ##| ##31: napply bitrigesim_destruct31
- ##| ##32: napply bitrigesim_destruct32
- ##]
-nqed.
-
-nlemma symmetric_eqbit : symmetricT bitrigesim bool eq_bit.
- #t1;
- nelim t1;
- ##[ ##1: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##2: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##3: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##4: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##5: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##6: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##7: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##8: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##9: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##10: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##11: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##12: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##13: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##14: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##15: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##16: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##17: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##18: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##19: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##20: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##21: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##22: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##23: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##24: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##25: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##26: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##27: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##28: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##29: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##30: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##31: #t2; nelim t2; nnormalize; napply refl_eq
- ##| ##32: #t2; nelim t2; nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma eqbit_to_eq1 : ∀t2.eq_bit t00 t2 = true → t00 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##1: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq2 : ∀t2.eq_bit t01 t2 = true → t01 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##2: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq3 : ∀t2.eq_bit t02 t2 = true → t02 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##3: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq4 : ∀t2.eq_bit t03 t2 = true → t03 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##4: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq5 : ∀t2.eq_bit t04 t2 = true → t04 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##5: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq6 : ∀t2.eq_bit t05 t2 = true → t05 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##6: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq7 : ∀t2.eq_bit t06 t2 = true → t06 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##7: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq8 : ∀t2.eq_bit t07 t2 = true → t07 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##8: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq9 : ∀t2.eq_bit t08 t2 = true → t08 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##9: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq10 : ∀t2.eq_bit t09 t2 = true → t09 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##10: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq11 : ∀t2.eq_bit t0A t2 = true → t0A = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##11: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq12 : ∀t2.eq_bit t0B t2 = true → t0B = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##12: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq13 : ∀t2.eq_bit t0C t2 = true → t0C = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##13: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq14 : ∀t2.eq_bit t0D t2 = true → t0D = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##14: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq15 : ∀t2.eq_bit t0E t2 = true → t0E = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##15: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq16 : ∀t2.eq_bit t0F t2 = true → t0F = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##16: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq17 : ∀t2.eq_bit t10 t2 = true → t10 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##17: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq18 : ∀t2.eq_bit t11 t2 = true → t11 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##18: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq19 : ∀t2.eq_bit t12 t2 = true → t12 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##19: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq20 : ∀t2.eq_bit t13 t2 = true → t13 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##20: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq21 : ∀t2.eq_bit t14 t2 = true → t14 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##21: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq22 : ∀t2.eq_bit t15 t2 = true → t15 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##22: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq23 : ∀t2.eq_bit t16 t2 = true → t16 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##23: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq24 : ∀t2.eq_bit t17 t2 = true → t17 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##24: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq25 : ∀t2.eq_bit t18 t2 = true → t18 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##25: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq26 : ∀t2.eq_bit t19 t2 = true → t19 = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##26: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq27 : ∀t2.eq_bit t1A t2 = true → t1A = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##27: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq28 : ∀t2.eq_bit t1B t2 = true → t1B = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##28: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq29 : ∀t2.eq_bit t1C t2 = true → t1C = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##29: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq30 : ∀t2.eq_bit t1D t2 = true → t1D = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##30: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq31 : ∀t2.eq_bit t1E t2 = true → t1E = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##31: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq32 : ∀t2.eq_bit t1F t2 = true → t1F = t2.
- #t2; ncases t2; nnormalize; #H; ##[ ##32: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]
-nqed.
-
-nlemma eqbit_to_eq : ∀t1,t2.eq_bit t1 t2 = true → t1 = t2.
- #t1;
- ncases t1;
- ##[ ##1: napply eqbit_to_eq1
- ##| ##2: napply eqbit_to_eq2
- ##| ##3: napply eqbit_to_eq3
- ##| ##4: napply eqbit_to_eq4
- ##| ##5: napply eqbit_to_eq5
- ##| ##6: napply eqbit_to_eq6
- ##| ##7: napply eqbit_to_eq7
- ##| ##8: napply eqbit_to_eq8
- ##| ##9: napply eqbit_to_eq9
- ##| ##10: napply eqbit_to_eq10
- ##| ##11: napply eqbit_to_eq11
- ##| ##12: napply eqbit_to_eq12
- ##| ##13: napply eqbit_to_eq13
- ##| ##14: napply eqbit_to_eq14
- ##| ##15: napply eqbit_to_eq15
- ##| ##16: napply eqbit_to_eq16
- ##| ##17: napply eqbit_to_eq17
- ##| ##18: napply eqbit_to_eq18
- ##| ##19: napply eqbit_to_eq19
- ##| ##20: napply eqbit_to_eq20
- ##| ##21: napply eqbit_to_eq21
- ##| ##22: napply eqbit_to_eq22
- ##| ##23: napply eqbit_to_eq23
- ##| ##24: napply eqbit_to_eq24
- ##| ##25: napply eqbit_to_eq25
- ##| ##26: napply eqbit_to_eq26
- ##| ##27: napply eqbit_to_eq27
- ##| ##28: napply eqbit_to_eq28
- ##| ##29: napply eqbit_to_eq29
- ##| ##30: napply eqbit_to_eq30
- ##| ##31: napply eqbit_to_eq31
- ##| ##32: napply eqbit_to_eq32
- ##]
-nqed.
-
-nlemma eq_to_eqbit1 : ∀t2.t00 = t2 → eq_bit t00 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##1: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit2 : ∀t2.t01 = t2 → eq_bit t01 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##2: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit3 : ∀t2.t02 = t2 → eq_bit t02 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##3: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit4 : ∀t2.t03 = t2 → eq_bit t03 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##4: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit5 : ∀t2.t04 = t2 → eq_bit t04 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##5: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit6 : ∀t2.t05 = t2 → eq_bit t05 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##6: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit7 : ∀t2.t06 = t2 → eq_bit t06 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##7: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit8 : ∀t2.t07 = t2 → eq_bit t07 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##8: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit9 : ∀t2.t08 = t2 → eq_bit t08 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##9: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit10 : ∀t2.t09 = t2 → eq_bit t09 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##10: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit11 : ∀t2.t0A = t2 → eq_bit t0A t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##11: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit12 : ∀t2.t0B = t2 → eq_bit t0B t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##12: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit13 : ∀t2.t0C = t2 → eq_bit t0C t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##13: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit14 : ∀t2.t0D = t2 → eq_bit t0D t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##14: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit15 : ∀t2.t0E = t2 → eq_bit t0E t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##15: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit16 : ∀t2.t0F = t2 → eq_bit t0F t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##16: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit17 : ∀t2.t10 = t2 → eq_bit t10 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##17: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit18 : ∀t2.t11 = t2 → eq_bit t11 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##18: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit19 : ∀t2.t12 = t2 → eq_bit t12 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##19: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit20 : ∀t2.t13 = t2 → eq_bit t13 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##20: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit21 : ∀t2.t14 = t2 → eq_bit t14 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##21: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit22 : ∀t2.t15 = t2 → eq_bit t15 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##22: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit23 : ∀t2.t16 = t2 → eq_bit t16 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##23: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit24 : ∀t2.t17 = t2 → eq_bit t17 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##24: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit25 : ∀t2.t18 = t2 → eq_bit t18 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##25: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit26 : ∀t2.t19 = t2 → eq_bit t19 t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##26: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit27 : ∀t2.t1A = t2 → eq_bit t1A t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##27: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit28 : ∀t2.t1B = t2 → eq_bit t1B t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##28: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit29 : ∀t2.t1C = t2 → eq_bit t1C t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##29: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit30 : ∀t2.t1D = t2 → eq_bit t1D t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##30: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit31 : ∀t2.t1E = t2 → eq_bit t1E t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##31: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit32 : ∀t2.t1F = t2 → eq_bit t1F t2 = true.
- #t2; ncases t2; nnormalize; #H; ##[ ##32: napply refl_eq ##| ##*: napply (bitrigesim_destruct … H) ##]
-nqed.
-
-nlemma eq_to_eqbit : ∀t1,t2.t1 = t2 → eq_bit t1 t2 = true.
- #t1;
- ncases t1;
- ##[ ##1: napply eq_to_eqbit1
- ##| ##2: napply eq_to_eqbit2
- ##| ##3: napply eq_to_eqbit3
- ##| ##4: napply eq_to_eqbit4
- ##| ##5: napply eq_to_eqbit5
- ##| ##6: napply eq_to_eqbit6
- ##| ##7: napply eq_to_eqbit7
- ##| ##8: napply eq_to_eqbit8
- ##| ##9: napply eq_to_eqbit9
- ##| ##10: napply eq_to_eqbit10
- ##| ##11: napply eq_to_eqbit11
- ##| ##12: napply eq_to_eqbit12
- ##| ##13: napply eq_to_eqbit13
- ##| ##14: napply eq_to_eqbit14
- ##| ##15: napply eq_to_eqbit15
- ##| ##16: napply eq_to_eqbit16
- ##| ##17: napply eq_to_eqbit17
- ##| ##18: napply eq_to_eqbit18
- ##| ##19: napply eq_to_eqbit19
- ##| ##20: napply eq_to_eqbit20
- ##| ##21: napply eq_to_eqbit21
- ##| ##22: napply eq_to_eqbit22
- ##| ##23: napply eq_to_eqbit23
- ##| ##24: napply eq_to_eqbit24
- ##| ##25: napply eq_to_eqbit25
- ##| ##26: napply eq_to_eqbit26
- ##| ##27: napply eq_to_eqbit27
- ##| ##28: napply eq_to_eqbit28
- ##| ##29: napply eq_to_eqbit29
- ##| ##30: napply eq_to_eqbit30
- ##| ##31: napply eq_to_eqbit31
- ##| ##32: napply eq_to_eqbit32
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/pts.ma".
-
-(* ******** *)
-(* BOOLEANI *)
-(* ******** *)
-
-ninductive bool : Type ≝
- true : bool
-| false : bool.
-
-(* operatori booleani *)
-
-ndefinition eq_bool ≝
-λb1,b2:bool.match b1 with
- [ true ⇒ match b2 with [ true ⇒ true | false ⇒ false ]
- | false ⇒ match b2 with [ true ⇒ false | false ⇒ true ]
- ].
-
-ndefinition not_bool ≝
-λb:bool.match b with [ true ⇒ false | false ⇒ true ].
-
-ndefinition and_bool ≝
-λb1,b2:bool.match b1 with
- [ true ⇒ b2 | false ⇒ false ].
-
-ndefinition or_bool ≝
-λb1,b2:bool.match b1 with
- [ true ⇒ true | false ⇒ b2 ].
-
-ndefinition xor_bool ≝
-λb1,b2:bool.match b1 with
- [ true ⇒ not_bool b2
- | false ⇒ b2 ].
-
-(* \ominus *)
-notation "hvbox(⊖ a)" non associative with precedence 36
- for @{ 'not_bool $a }.
-interpretation "not_bool" 'not_bool x = (not_bool x).
-
-(* \otimes *)
-notation "hvbox(a break ⊗ b)" left associative with precedence 35
- for @{ 'and_bool $a $b }.
-interpretation "and_bool" 'and_bool x y = (and_bool x y).
-
-(* \oplus *)
-notation "hvbox(a break ⊕ b)" left associative with precedence 34
- for @{ 'or_bool $a $b }.
-interpretation "or_bool" 'or_bool x y = (or_bool x y).
-
-(* \odot *)
-notation "hvbox(a break ⊙ b)" left associative with precedence 33
- for @{ 'xor_bool $a $b }.
-interpretation "xor_bool" 'xor_bool x y = (xor_bool x y).
-
-ndefinition boolRelation : Type → Type ≝
-λA:Type.A → A → bool.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/theory.ma".
-include "freescale/bool.ma".
-
-(* ******** *)
-(* BOOLEANI *)
-(* ******** *)
-
-ndefinition bool_destruct_aux ≝
-Πb1,b2:bool.ΠP:Prop.b1 = b2 →
- match b1 with
- [ true ⇒ match b2 with [ true ⇒ P → P | false ⇒ P ]
- | false ⇒ match b2 with [ true ⇒ P | false ⇒ P → P ]
- ].
-
-ndefinition bool_destruct : bool_destruct_aux.
- #b1; #b2; #P;
- nelim b1;
- nelim b2;
- nnormalize;
- #H;
- ##[ ##2: napply False_ind;
- nchange with (match true with [ true ⇒ False | false ⇒ True]);
- nrewrite > H;
- nnormalize;
- napply I
- ##| ##3: napply False_ind;
- nchange with (match true with [ true ⇒ False | false ⇒ True]);
- nrewrite < H;
- nnormalize;
- napply I
- ##| ##1,4: napply (λx:P.x)
- ##]
-nqed.
-
-nlemma symmetric_eqbool : symmetricT bool bool eq_bool.
- #b1; #b2;
- nelim b1;
- nelim b2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_andbool : symmetricT bool bool and_bool.
- #b1; #b2;
- nelim b1;
- nelim b2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_andbool : ∀b1,b2,b3.((b1 ⊗ b2) ⊗ b3) = (b1 ⊗ (b2 ⊗ b3)).
- #b1; #b2; #b3;
- nelim b1;
- nelim b2;
- nelim b3;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_orbool : symmetricT bool bool or_bool.
- #b1; #b2;
- nelim b1;
- nelim b2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_orbool : ∀b1,b2,b3.((b1 ⊕ b2) ⊕ b3) = (b1 ⊕ (b2 ⊕ b3)).
- #b1; #b2; #b3;
- nelim b1;
- nelim b2;
- nelim b3;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_xorbool : symmetricT bool bool xor_bool.
- #b1; #b2;
- nelim b1;
- nelim b2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_xorbool : ∀b1,b2,b3.((b1 ⊙ b2) ⊙ b3) = (b1 ⊙ (b2 ⊙ b3)).
- #b1; #b2; #b3;
- nelim b1;
- nelim b2;
- nelim b3;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqbool_to_eq : ∀b1,b2:bool.(eq_bool b1 b2 = true) → (b1 = b2).
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##1,4: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqbool : ∀b1,b2.b1 = b2 → eq_bool b1 b2 = true.
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##1,4: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma andb_true_true_l: ∀b1,b2.(b1 ⊗ b2) = true → b1 = true.
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##1,2: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma andb_true_true_r: ∀b1,b2.(b1 ⊗ b2) = true → b2 = true.
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##1,3: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma orb_false_false_l : ∀b1,b2:bool.(b1 ⊕ b2) = false → b1 = false.
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##4: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma orb_false_false_r : ∀b1,b2:bool.(b1 ⊕ b2) = false → b2 = false.
- #b1; #b2;
- ncases b1;
- ncases b2;
- nnormalize;
- ##[ ##4: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/exadecim.ma".
-include "freescale/bitrigesim.ma".
-
-(* **** *)
-(* BYTE *)
-(* **** *)
-
-nrecord byte8 : Type ≝
- {
- b8h: exadecim;
- b8l: exadecim
- }.
-
-(* \langle \rangle *)
-notation "〈x,y〉" non associative with precedence 80
- for @{ 'mk_byte8 $x $y }.
-interpretation "mk_byte8" 'mk_byte8 x y = (mk_byte8 x y).
-
-(* operatore = *)
-ndefinition eq_b8 ≝ λb1,b2:byte8.(eq_ex (b8h b1) (b8h b2)) ⊗ (eq_ex (b8l b1) (b8l b2)).
-
-(* operatore < *)
-ndefinition lt_b8 ≝
-λb1,b2:byte8.match lt_ex (b8h b1) (b8h b2) with
- [ true ⇒ true
- | false ⇒ match gt_ex (b8h b1) (b8h b2) with
- [ true ⇒ false
- | false ⇒ lt_ex (b8l b1) (b8l b2) ]].
-
-(* operatore ≤ *)
-ndefinition le_b8 ≝ λb1,b2:byte8.(eq_b8 b1 b2) ⊕ (lt_b8 b1 b2).
-
-(* operatore > *)
-ndefinition gt_b8 ≝ λb1,b2:byte8.⊖ (le_b8 b1 b2).
-
-(* operatore ≥ *)
-ndefinition ge_b8 ≝ λb1,b2:byte8.⊖ (lt_b8 b1 b2).
-
-(* operatore and *)
-ndefinition and_b8 ≝
-λb1,b2:byte8.mk_byte8 (and_ex (b8h b1) (b8h b2)) (and_ex (b8l b1) (b8l b2)).
-
-(* operatore or *)
-ndefinition or_b8 ≝
-λb1,b2:byte8.mk_byte8 (or_ex (b8h b1) (b8h b2)) (or_ex (b8l b1) (b8l b2)).
-
-(* operatore xor *)
-ndefinition xor_b8 ≝
-λb1,b2:byte8.mk_byte8 (xor_ex (b8h b1) (b8h b2)) (xor_ex (b8l b1) (b8l b2)).
-
-(* operatore rotazione destra con carry *)
-ndefinition rcr_b8 ≝
-λb:byte8.λc:bool.match rcr_ex (b8h b) c with
- [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
- [ pair bl' c'' ⇒ pair … (mk_byte8 bh' bl') c'' ]].
-
-(* operatore shift destro *)
-ndefinition shr_b8 ≝
-λb:byte8.match rcr_ex (b8h b) false with
- [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
- [ pair bl' c'' ⇒ pair … (mk_byte8 bh' bl') c'' ]].
-
-(* operatore rotazione destra *)
-ndefinition ror_b8 ≝
-λb:byte8.match rcr_ex (b8h b) false with
- [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
- [ pair bl' c'' ⇒ match c'' with
- [ true ⇒ mk_byte8 (or_ex x8 bh') bl'
- | false ⇒ mk_byte8 bh' bl' ]]].
-
-(* operatore rotazione destra n-volte *)
-nlet rec ror_b8_n (b:byte8) (n:oct) (r:rec_oct n) on r ≝
- match r with
- [ oc_O ⇒ b
- | oc_S t n' ⇒ ror_b8_n (ror_b8 b) t n' ].
-
-(* operatore rotazione sinistra con carry *)
-ndefinition rcl_b8 ≝
-λb:byte8.λc:bool.match rcl_ex (b8l b) c with
- [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
- [ pair bh' c'' ⇒ pair … (mk_byte8 bh' bl') c'' ]].
-
-(* operatore shift sinistro *)
-ndefinition shl_b8 ≝
-λb:byte8.match rcl_ex (b8l b) false with
- [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
- [ pair bh' c'' ⇒ pair … (mk_byte8 bh' bl') c'' ]].
-
-(* operatore rotazione sinistra *)
-ndefinition rol_b8 ≝
-λb:byte8.match rcl_ex (b8l b) false with
- [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
- [ pair bh' c'' ⇒ match c'' with
- [ true ⇒ mk_byte8 bh' (or_ex x1 bl')
- | false ⇒ mk_byte8 bh' bl' ]]].
-
-(* operatore rotazione sinistra n-volte *)
-nlet rec rol_b8_n (b:byte8) (n:oct) (r:rec_oct n) on r ≝
- match r with
- [ oc_O ⇒ b
- | oc_S t n' ⇒ rol_b8_n (rol_b8 b) t n' ].
-
-(* operatore not/complemento a 1 *)
-ndefinition not_b8 ≝
-λb:byte8.mk_byte8 (not_ex (b8h b)) (not_ex (b8l b)).
-
-(* operatore somma con data+carry → data+carry *)
-ndefinition plus_b8_dc_dc ≝
-λb1,b2:byte8.λc:bool.
- match plus_ex_dc_dc (b8l b1) (b8l b2) c with
- [ pair l c ⇒ match plus_ex_dc_dc (b8h b1) (b8h b2) c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]].
-
-(* operatore somma con data+carry → data *)
-ndefinition plus_b8_dc_d ≝
-λb1,b2:byte8.λc:bool.
- match plus_ex_dc_dc (b8l b1) (b8l b2) c with
- [ pair l c ⇒ 〈plus_ex_dc_d (b8h b1) (b8h b2) c,l〉 ].
-
-(* operatore somma con data+carry → c *)
-ndefinition plus_b8_dc_c ≝
-λb1,b2:byte8.λc:bool.
- plus_ex_dc_c (b8h b1) (b8h b2) (plus_ex_dc_c (b8l b1) (b8l b2) c).
-
-(* operatore somma con data → data+carry *)
-ndefinition plus_b8_d_dc ≝
-λb1,b2:byte8.
- match plus_ex_d_dc (b8l b1) (b8l b2) with
- [ pair l c ⇒ match plus_ex_dc_dc (b8h b1) (b8h b2) c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]].
-
-(* operatore somma con data → data *)
-ndefinition plus_b8_d_d ≝
-λb1,b2:byte8.
- match plus_ex_d_dc (b8l b1) (b8l b2) with
- [ pair l c ⇒ 〈plus_ex_dc_d (b8h b1) (b8h b2) c,l〉 ].
-
-(* operatore somma con data → c *)
-ndefinition plus_b8_d_c ≝
-λb1,b2:byte8.
- plus_ex_dc_c (b8h b1) (b8h b2) (plus_ex_d_c (b8l b1) (b8l b2)).
-
-(* operatore Most Significant Bit *)
-ndefinition MSB_b8 ≝ λb:byte8.eq_ex x8 (and_ex x8 (b8h b)).
-
-(* operatore predecessore *)
-ndefinition pred_b8 ≝
-λb:byte8.match eq_ex (b8l b) x0 with
- [ true ⇒ mk_byte8 (pred_ex (b8h b)) (pred_ex (b8l b))
- | false ⇒ mk_byte8 (b8h b) (pred_ex (b8l b)) ].
-
-(* operatore successore *)
-ndefinition succ_b8 ≝
-λb:byte8.match eq_ex (b8l b) xF with
- [ true ⇒ mk_byte8 (succ_ex (b8h b)) (succ_ex (b8l b))
- | false ⇒ mk_byte8 (b8h b) (succ_ex (b8l b)) ].
-
-(* operatore neg/complemento a 2 *)
-ndefinition compl_b8 ≝
-λb:byte8.match MSB_b8 b with
- [ true ⇒ succ_b8 (not_b8 b)
- | false ⇒ not_b8 (pred_b8 b) ].
-
-(* operatore moltiplicazione senza segno: e*e=[0x00,0xE1] *)
-ndefinition mul_ex ≝
-λe1,e2:exadecim.match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x0〉 | x2 ⇒ 〈x0,x0〉 | x3 ⇒ 〈x0,x0〉
- | x4 ⇒ 〈x0,x0〉 | x5 ⇒ 〈x0,x0〉 | x6 ⇒ 〈x0,x0〉 | x7 ⇒ 〈x0,x0〉
- | x8 ⇒ 〈x0,x0〉 | x9 ⇒ 〈x0,x0〉 | xA ⇒ 〈x0,x0〉 | xB ⇒ 〈x0,x0〉
- | xC ⇒ 〈x0,x0〉 | xD ⇒ 〈x0,x0〉 | xE ⇒ 〈x0,x0〉 | xF ⇒ 〈x0,x0〉 ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x1〉 | x2 ⇒ 〈x0,x2〉 | x3 ⇒ 〈x0,x3〉
- | x4 ⇒ 〈x0,x4〉 | x5 ⇒ 〈x0,x5〉 | x6 ⇒ 〈x0,x6〉 | x7 ⇒ 〈x0,x7〉
- | x8 ⇒ 〈x0,x8〉 | x9 ⇒ 〈x0,x9〉 | xA ⇒ 〈x0,xA〉 | xB ⇒ 〈x0,xB〉
- | xC ⇒ 〈x0,xC〉 | xD ⇒ 〈x0,xD〉 | xE ⇒ 〈x0,xE〉 | xF ⇒ 〈x0,xF〉 ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x2〉 | x2 ⇒ 〈x0,x4〉 | x3 ⇒ 〈x0,x6〉
- | x4 ⇒ 〈x0,x8〉 | x5 ⇒ 〈x0,xA〉 | x6 ⇒ 〈x0,xC〉 | x7 ⇒ 〈x0,xE〉
- | x8 ⇒ 〈x1,x0〉 | x9 ⇒ 〈x1,x2〉 | xA ⇒ 〈x1,x4〉 | xB ⇒ 〈x1,x6〉
- | xC ⇒ 〈x1,x8〉 | xD ⇒ 〈x1,xA〉 | xE ⇒ 〈x1,xC〉 | xF ⇒ 〈x1,xE〉 ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x3〉 | x2 ⇒ 〈x0,x6〉 | x3 ⇒ 〈x0,x9〉
- | x4 ⇒ 〈x0,xC〉 | x5 ⇒ 〈x0,xF〉 | x6 ⇒ 〈x1,x2〉 | x7 ⇒ 〈x1,x5〉
- | x8 ⇒ 〈x1,x8〉 | x9 ⇒ 〈x1,xB〉 | xA ⇒ 〈x1,xE〉 | xB ⇒ 〈x2,x1〉
- | xC ⇒ 〈x2,x4〉 | xD ⇒ 〈x2,x7〉 | xE ⇒ 〈x2,xA〉 | xF ⇒ 〈x2,xD〉 ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x4〉 | x2 ⇒ 〈x0,x8〉 | x3 ⇒ 〈x0,xC〉
- | x4 ⇒ 〈x1,x0〉 | x5 ⇒ 〈x1,x4〉 | x6 ⇒ 〈x1,x8〉 | x7 ⇒ 〈x1,xC〉
- | x8 ⇒ 〈x2,x0〉 | x9 ⇒ 〈x2,x4〉 | xA ⇒ 〈x2,x8〉 | xB ⇒ 〈x2,xC〉
- | xC ⇒ 〈x3,x0〉 | xD ⇒ 〈x3,x4〉 | xE ⇒ 〈x3,x8〉 | xF ⇒ 〈x3,xC〉 ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x5〉 | x2 ⇒ 〈x0,xA〉 | x3 ⇒ 〈x0,xF〉
- | x4 ⇒ 〈x1,x4〉 | x5 ⇒ 〈x1,x9〉 | x6 ⇒ 〈x1,xE〉 | x7 ⇒ 〈x2,x3〉
- | x8 ⇒ 〈x2,x8〉 | x9 ⇒ 〈x2,xD〉 | xA ⇒ 〈x3,x2〉 | xB ⇒ 〈x3,x7〉
- | xC ⇒ 〈x3,xC〉 | xD ⇒ 〈x4,x1〉 | xE ⇒ 〈x4,x6〉 | xF ⇒ 〈x4,xB〉 ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x6〉 | x2 ⇒ 〈x0,xC〉 | x3 ⇒ 〈x1,x2〉
- | x4 ⇒ 〈x1,x8〉 | x5 ⇒ 〈x1,xE〉 | x6 ⇒ 〈x2,x4〉 | x7 ⇒ 〈x2,xA〉
- | x8 ⇒ 〈x3,x0〉 | x9 ⇒ 〈x3,x6〉 | xA ⇒ 〈x3,xC〉 | xB ⇒ 〈x4,x2〉
- | xC ⇒ 〈x4,x8〉 | xD ⇒ 〈x4,xE〉 | xE ⇒ 〈x5,x4〉 | xF ⇒ 〈x5,xA〉 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x7〉 | x2 ⇒ 〈x0,xE〉 | x3 ⇒ 〈x1,x5〉
- | x4 ⇒ 〈x1,xC〉 | x5 ⇒ 〈x2,x3〉 | x6 ⇒ 〈x2,xA〉 | x7 ⇒ 〈x3,x1〉
- | x8 ⇒ 〈x3,x8〉 | x9 ⇒ 〈x3,xF〉 | xA ⇒ 〈x4,x6〉 | xB ⇒ 〈x4,xD〉
- | xC ⇒ 〈x5,x4〉 | xD ⇒ 〈x5,xB〉 | xE ⇒ 〈x6,x2〉 | xF ⇒ 〈x6,x9〉 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x8〉 | x2 ⇒ 〈x1,x0〉 | x3 ⇒ 〈x1,x8〉
- | x4 ⇒ 〈x2,x0〉 | x5 ⇒ 〈x2,x8〉 | x6 ⇒ 〈x3,x0〉 | x7 ⇒ 〈x3,x8〉
- | x8 ⇒ 〈x4,x0〉 | x9 ⇒ 〈x4,x8〉 | xA ⇒ 〈x5,x0〉 | xB ⇒ 〈x5,x8〉
- | xC ⇒ 〈x6,x0〉 | xD ⇒ 〈x6,x8〉 | xE ⇒ 〈x7,x0〉 | xF ⇒ 〈x7,x8〉 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,x9〉 | x2 ⇒ 〈x1,x2〉 | x3 ⇒ 〈x1,xB〉
- | x4 ⇒ 〈x2,x4〉 | x5 ⇒ 〈x2,xD〉 | x6 ⇒ 〈x3,x6〉 | x7 ⇒ 〈x3,xF〉
- | x8 ⇒ 〈x4,x8〉 | x9 ⇒ 〈x5,x1〉 | xA ⇒ 〈x5,xA〉 | xB ⇒ 〈x6,x3〉
- | xC ⇒ 〈x6,xC〉 | xD ⇒ 〈x7,x5〉 | xE ⇒ 〈x7,xE〉 | xF ⇒ 〈x8,x7〉 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xA〉 | x2 ⇒ 〈x1,x4〉 | x3 ⇒ 〈x1,xE〉
- | x4 ⇒ 〈x2,x8〉 | x5 ⇒ 〈x3,x2〉 | x6 ⇒ 〈x3,xC〉 | x7 ⇒ 〈x4,x6〉
- | x8 ⇒ 〈x5,x0〉 | x9 ⇒ 〈x5,xA〉 | xA ⇒ 〈x6,x4〉 | xB ⇒ 〈x6,xE〉
- | xC ⇒ 〈x7,x8〉 | xD ⇒ 〈x8,x2〉 | xE ⇒ 〈x8,xC〉 | xF ⇒ 〈x9,x6〉 ]
- | xB ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xB〉 | x2 ⇒ 〈x1,x6〉 | x3 ⇒ 〈x2,x1〉
- | x4 ⇒ 〈x2,xC〉 | x5 ⇒ 〈x3,x7〉 | x6 ⇒ 〈x4,x2〉 | x7 ⇒ 〈x4,xD〉
- | x8 ⇒ 〈x5,x8〉 | x9 ⇒ 〈x6,x3〉 | xA ⇒ 〈x6,xE〉 | xB ⇒ 〈x7,x9〉
- | xC ⇒ 〈x8,x4〉 | xD ⇒ 〈x8,xF〉 | xE ⇒ 〈x9,xA〉 | xF ⇒ 〈xA,x5〉 ]
- | xC ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xC〉 | x2 ⇒ 〈x1,x8〉 | x3 ⇒ 〈x2,x4〉
- | x4 ⇒ 〈x3,x0〉 | x5 ⇒ 〈x3,xC〉 | x6 ⇒ 〈x4,x8〉 | x7 ⇒ 〈x5,x4〉
- | x8 ⇒ 〈x6,x0〉 | x9 ⇒ 〈x6,xC〉 | xA ⇒ 〈x7,x8〉 | xB ⇒ 〈x8,x4〉
- | xC ⇒ 〈x9,x0〉 | xD ⇒ 〈x9,xC〉 | xE ⇒ 〈xA,x8〉 | xF ⇒ 〈xB,x4〉 ]
- | xD ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xD〉 | x2 ⇒ 〈x1,xA〉 | x3 ⇒ 〈x2,x7〉
- | x4 ⇒ 〈x3,x4〉 | x5 ⇒ 〈x4,x1〉 | x6 ⇒ 〈x4,xE〉 | x7 ⇒ 〈x5,xB〉
- | x8 ⇒ 〈x6,x8〉 | x9 ⇒ 〈x7,x5〉 | xA ⇒ 〈x8,x2〉 | xB ⇒ 〈x8,xF〉
- | xC ⇒ 〈x9,xC〉 | xD ⇒ 〈xA,x9〉 | xE ⇒ 〈xB,x6〉 | xF ⇒ 〈xC,x3〉 ]
- | xE ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xE〉 | x2 ⇒ 〈x1,xC〉 | x3 ⇒ 〈x2,xA〉
- | x4 ⇒ 〈x3,x8〉 | x5 ⇒ 〈x4,x6〉 | x6 ⇒ 〈x5,x4〉 | x7 ⇒ 〈x6,x2〉
- | x8 ⇒ 〈x7,x0〉 | x9 ⇒ 〈x7,xE〉 | xA ⇒ 〈x8,xC〉 | xB ⇒ 〈x9,xA〉
- | xC ⇒ 〈xA,x8〉 | xD ⇒ 〈xB,x6〉 | xE ⇒ 〈xC,x4〉 | xF ⇒ 〈xD,x2〉 ]
- | xF ⇒ match e2 with
- [ x0 ⇒ 〈x0,x0〉 | x1 ⇒ 〈x0,xF〉 | x2 ⇒ 〈x1,xE〉 | x3 ⇒ 〈x2,xD〉
- | x4 ⇒ 〈x3,xC〉 | x5 ⇒ 〈x4,xB〉 | x6 ⇒ 〈x5,xA〉 | x7 ⇒ 〈x6,x9〉
- | x8 ⇒ 〈x7,x8〉 | x9 ⇒ 〈x8,x7〉 | xA ⇒ 〈x9,x6〉 | xB ⇒ 〈xA,x5〉
- | xC ⇒ 〈xB,x4〉 | xD ⇒ 〈xC,x3〉 | xE ⇒ 〈xD,x2〉 | xF ⇒ 〈xE,x1〉 ]
- ].
-
-(* correzione per somma su BCD *)
-(* input: halfcarry,carry,X(BCD+BCD) *)
-(* output: X',carry' *)
-ndefinition daa_b8 ≝
-λh,c:bool.λX:byte8.
- match lt_b8 X 〈x9,xA〉 with
- (* [X:0x00-0x99] *)
- (* c' = c *)
- (* X' = [(b16l X):0x0-0x9] X + [h=1 ? 0x06 : 0x00] + [c=1 ? 0x60 : 0x00]
- [(b16l X):0xA-0xF] X + 0x06 + [c=1 ? 0x60 : 0x00] *)
- [ true ⇒
- let X' ≝ match (lt_ex (b8l X) xA) ⊗ (⊖h) with
- [ true ⇒ X
- | false ⇒ plus_b8_d_d X 〈x0,x6〉 ] in
- let X'' ≝ match c with
- [ true ⇒ plus_b8_d_d X' 〈x6,x0〉
- | false ⇒ X' ] in
- pair … X'' c
- (* [X:0x9A-0xFF] *)
- (* c' = 1 *)
- (* X' = [X:0x9A-0xFF]
- [(b16l X):0x0-0x9] X + [h=1 ? 0x06 : 0x00] + 0x60
- [(b16l X):0xA-0xF] X + 0x6 + 0x60 *)
- | false ⇒
- let X' ≝ match (lt_ex (b8l X) xA) ⊗ (⊖h) with
- [ true ⇒ X
- | false ⇒ plus_b8_d_d X 〈x0,x6〉 ] in
- let X'' ≝ plus_b8_d_d X' 〈x6,x0〉 in
- pair … X'' true
- ].
-
-(* iteratore sui byte *)
-ndefinition forall_b8 ≝
- λP.
- forall_ex (λbh.
- forall_ex (λbl.
- P (mk_byte8 bh bl))).
-
-(* byte ricorsivi *)
-ninductive rec_byte8 : byte8 → Type ≝
- b8_O : rec_byte8 〈x0,x0〉
-| b8_S : ∀n.rec_byte8 n → rec_byte8 (succ_b8 n).
-
-(* byte → byte ricorsivi *)
-ndefinition b8_to_recb8_aux1 : Πn.rec_byte8 〈n,x0〉 → rec_byte8 〈succ_ex n,x0〉 ≝
-λn.λrecb:rec_byte8 〈n,x0〉.
- 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 ? (b8_S ? recb))))))))))))))).
-
-(* ... cifra esadecimale superiore *)
-nlet rec b8_to_recb8_aux2 (n:exadecim) (r:rec_exadecim n) on r ≝
- match r return λx.λy:rec_exadecim x.rec_byte8 〈x,x0〉 with
- [ ex_O ⇒ b8_O
- | ex_S t n' ⇒ b8_to_recb8_aux1 ? (b8_to_recb8_aux2 t n')
- ].
-
-(* ... cifra esadecimale inferiore *)
-ndefinition b8_to_recb8_aux3 : Πn1,n2.rec_byte8 〈n1,x0〉 → rec_byte8 〈n1,n2〉 ≝
-λn1,n2.λrecb:rec_byte8 〈n1,x0〉.
- match n2 return λx.rec_byte8 〈n1,x〉 with
- [ x0 ⇒ recb
- | x1 ⇒ b8_S ? recb
- | x2 ⇒ b8_S ? (b8_S ? recb)
- | x3 ⇒ b8_S ? (b8_S ? (b8_S ? recb))
- | x4 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? recb)))
- | x5 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb))))
- | x6 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb)))))
- | x7 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb))))))
- | x8 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb)))))))
- | x9 ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb))))))))
- | xA ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb)))))))))
- | xB ⇒ b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? (b8_S ? recb))))))))))
- | xC ⇒ 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)))))))))))
- | xD ⇒ 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))))))))))))
- | xE ⇒ 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)))))))))))))
- | 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))).
-
-(* ottali → esadecimali *)
-ndefinition b8_of_bit ≝
-λn.match n with
- [ t00 ⇒ 〈x0,x0〉 | t01 ⇒ 〈x0,x1〉 | t02 ⇒ 〈x0,x2〉 | t03 ⇒ 〈x0,x3〉
- | t04 ⇒ 〈x0,x4〉 | t05 ⇒ 〈x0,x5〉 | t06 ⇒ 〈x0,x6〉 | t07 ⇒ 〈x0,x7〉
- | t08 ⇒ 〈x0,x8〉 | t09 ⇒ 〈x0,x9〉 | t0A ⇒ 〈x0,xA〉 | t0B ⇒ 〈x0,xB〉
- | t0C ⇒ 〈x0,xC〉 | t0D ⇒ 〈x0,xD〉 | t0E ⇒ 〈x0,xE〉 | t0F ⇒ 〈x0,xF〉
- | t10 ⇒ 〈x1,x0〉 | t11 ⇒ 〈x1,x1〉 | t12 ⇒ 〈x1,x2〉 | t13 ⇒ 〈x1,x3〉
- | t14 ⇒ 〈x1,x4〉 | t15 ⇒ 〈x1,x5〉 | t16 ⇒ 〈x1,x6〉 | t17 ⇒ 〈x1,x7〉
- | t18 ⇒ 〈x1,x8〉 | t19 ⇒ 〈x1,x9〉 | t1A ⇒ 〈x1,xA〉 | t1B ⇒ 〈x1,xB〉
- | t1C ⇒ 〈x1,xC〉 | t1D ⇒ 〈x1,xD〉 | t1E ⇒ 〈x1,xE〉 | t1F ⇒ 〈x1,xF〉
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/exadecim_lemmas.ma".
-include "freescale/byte8.ma".
-
-(* **** *)
-(* BYTE *)
-(* **** *)
-
-nlemma byte8_destruct_1 :
-∀x1,x2,y1,y2.
- mk_byte8 x1 y1 = mk_byte8 x2 y2 → x1 = x2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_byte8 x2 y2 with [ mk_byte8 a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma byte8_destruct_2 :
-∀x1,x2,y1,y2.
- mk_byte8 x1 y1 = mk_byte8 x2 y2 → y1 = y2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_byte8 x2 y2 with [ mk_byte8 _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqb8 : symmetricT byte8 bool eq_b8.
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- nchange with (((eq_ex e3 e1)⊗(eq_ex e4 e2)) = ((eq_ex e1 e3)⊗(eq_ex e2 e4)));
- nrewrite > (symmetric_eqex e1 e3);
- nrewrite > (symmetric_eqex e2 e4);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_andb8 : symmetricT byte8 byte8 and_b8.
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- nchange with ((mk_byte8 (and_ex e3 e1) (and_ex e4 e2)) = (mk_byte8 (and_ex e1 e3) (and_ex e2 e4)));
- nrewrite > (symmetric_andex e1 e3);
- nrewrite > (symmetric_andex e2 e4);
- napply refl_eq.
-nqed.
-
-nlemma associative_andb8 : ∀b1,b2,b3.(and_b8 (and_b8 b1 b2) b3) = (and_b8 b1 (and_b8 b2 b3)).
- #b1; #b2; #b3;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nelim b3;
- #e5; #e6;
- nchange with (mk_byte8 (and_ex (and_ex e1 e3) e5) (and_ex (and_ex e2 e4) e6) =
- mk_byte8 (and_ex e1 (and_ex e3 e5)) (and_ex e2 (and_ex e4 e6)));
- nrewrite < (associative_andex e1 e3 e5);
- nrewrite < (associative_andex e2 e4 e6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_orb8 : symmetricT byte8 byte8 or_b8.
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- nchange with ((mk_byte8 (or_ex e3 e1) (or_ex e4 e2)) = (mk_byte8 (or_ex e1 e3) (or_ex e2 e4)));
- nrewrite > (symmetric_orex e1 e3);
- nrewrite > (symmetric_orex e2 e4);
- napply refl_eq.
-nqed.
-
-nlemma associative_orb8 : ∀b1,b2,b3.(or_b8 (or_b8 b1 b2) b3) = (or_b8 b1 (or_b8 b2 b3)).
- #b1; #b2; #b3;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nelim b3;
- #e5; #e6;
- nchange with (mk_byte8 (or_ex (or_ex e1 e3) e5) (or_ex (or_ex e2 e4) e6) =
- mk_byte8 (or_ex e1 (or_ex e3 e5)) (or_ex e2 (or_ex e4 e6)));
- nrewrite < (associative_orex e1 e3 e5);
- nrewrite < (associative_orex e2 e4 e6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_xorb8 : symmetricT byte8 byte8 xor_b8.
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- nchange with ((mk_byte8 (xor_ex e3 e1) (xor_ex e4 e2)) = (mk_byte8 (xor_ex e1 e3) (xor_ex e2 e4)));
- nrewrite > (symmetric_xorex e1 e3);
- nrewrite > (symmetric_xorex e2 e4);
- napply refl_eq.
-nqed.
-
-nlemma associative_xorb8 : ∀b1,b2,b3.(xor_b8 (xor_b8 b1 b2) b3) = (xor_b8 b1 (xor_b8 b2 b3)).
- #b1; #b2; #b3;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nelim b3;
- #e5; #e6;
- nchange with (mk_byte8 (xor_ex (xor_ex e1 e3) e5) (xor_ex (xor_ex e2 e4) e6) =
- mk_byte8 (xor_ex e1 (xor_ex e3 e5)) (xor_ex e2 (xor_ex e4 e6)));
- nrewrite < (associative_xorex e1 e3 e5);
- nrewrite < (associative_xorex e2 e4 e6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_dc_dc : ∀b1,b2,c.plus_b8_dc_dc b1 b2 c = plus_b8_dc_dc b2 b1 c.
- #b1; #b2; #c;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- match plus_ex_dc_dc e2 e4 c with
- [ pair l c ⇒ match plus_ex_dc_dc e1 e3 c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]] =
- match plus_ex_dc_dc e4 e2 c with
- [ pair l c ⇒ match plus_ex_dc_dc e3 e1 c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]]);
- nrewrite > (symmetric_plusex_dc_dc e4 e2 c);
- ncases (plus_ex_dc_dc e2 e4 c);
- #e5; #c1;
- nchange with (
- match plus_ex_dc_dc e1 e3 c1 with
- [ pair h c' ⇒ pair … 〈h,e5〉 c' ] =
- match plus_ex_dc_dc e3 e1 c1 with
- [ pair h c' ⇒ pair … 〈h,e5〉 c' ]);
- nrewrite > (symmetric_plusex_dc_dc e1 e3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_dc_d : ∀b1,b2,c.plus_b8_dc_d b1 b2 c = plus_b8_dc_d b2 b1 c.
- #b1; #b2; #c;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- match plus_ex_dc_dc e2 e4 c with
- [ pair l c ⇒ 〈plus_ex_dc_d e1 e3 c,l〉 ] =
- match plus_ex_dc_dc e4 e2 c with
- [ pair l c ⇒ 〈plus_ex_dc_d e3 e1 c,l〉 ]);
- nrewrite > (symmetric_plusex_dc_dc e4 e2 c);
- ncases (plus_ex_dc_dc e2 e4 c);
- #e5; #c1;
- nchange with (〈plus_ex_dc_d e1 e3 c1,e5〉 = 〈plus_ex_dc_d e3 e1 c1,e5〉);
- nrewrite > (symmetric_plusex_dc_d e1 e3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_dc_c : ∀b1,b2,c.plus_b8_dc_c b1 b2 c = plus_b8_dc_c b2 b1 c.
- #b1; #b2; #c;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- plus_ex_dc_c e1 e3 (plus_ex_dc_c e2 e4 c) =
- plus_ex_dc_c e3 e1 (plus_ex_dc_c e4 e2 c));
- nrewrite > (symmetric_plusex_dc_c e4 e2 c);
- nrewrite > (symmetric_plusex_dc_c e3 e1 (plus_ex_dc_c e2 e4 c));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_d_dc : ∀b1,b2.plus_b8_d_dc b1 b2 = plus_b8_d_dc b2 b1.
- #b1; #b2;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- match plus_ex_d_dc e2 e4 with
- [ pair l c ⇒ match plus_ex_dc_dc e1 e3 c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]] =
- match plus_ex_d_dc e4 e2 with
- [ pair l c ⇒ match plus_ex_dc_dc e3 e1 c with
- [ pair h c' ⇒ pair … 〈h,l〉 c' ]]);
- nrewrite > (symmetric_plusex_d_dc e4 e2);
- ncases (plus_ex_d_dc e2 e4);
- #e5; #c;
- nchange with (
- match plus_ex_dc_dc e1 e3 c with
- [ pair h c' ⇒ pair … 〈h,e5〉 c' ] =
- match plus_ex_dc_dc e3 e1 c with
- [ pair h c' ⇒ pair … 〈h,e5〉 c' ]);
- nrewrite > (symmetric_plusex_dc_dc e1 e3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_d_d : ∀b1,b2.plus_b8_d_d b1 b2 = plus_b8_d_d b2 b1.
- #b1; #b2;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- match plus_ex_d_dc e2 e4 with
- [ pair l c ⇒ 〈plus_ex_dc_d e1 e3 c,l〉 ] =
- match plus_ex_d_dc e4 e2 with
- [ pair l c ⇒ 〈plus_ex_dc_d e3 e1 c,l〉 ]);
- nrewrite > (symmetric_plusex_d_dc e4 e2);
- ncases (plus_ex_d_dc e2 e4);
- #e5; #c;
- nchange with (〈plus_ex_dc_d e1 e3 c,e5〉 = 〈plus_ex_dc_d e3 e1 c,e5〉);
- nrewrite > (symmetric_plusex_dc_d e1 e3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusb8_d_c : ∀b1,b2.plus_b8_d_c b1 b2 = plus_b8_d_c b2 b1.
- #b1; #b2;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (
- plus_ex_dc_c e1 e3 (plus_ex_d_c e2 e4) =
- plus_ex_dc_c e3 e1 (plus_ex_d_c e4 e2));
- nrewrite > (symmetric_plusex_d_c e4 e2);
- nrewrite > (symmetric_plusex_dc_c e3 e1 (plus_ex_d_c e2 e4));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_mulex : symmetricT exadecim byte8 mul_ex.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqb8_to_eq : ∀b1,b2:byte8.(eq_b8 b1 b2 = true) → (b1 = b2).
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- nchange in ⊢ (% → ?) with (((eq_ex e3 e1)⊗(eq_ex e4 e2)) = true);
- #H;
- nrewrite < (eqex_to_eq … (andb_true_true_l … H));
- nrewrite < (eqex_to_eq … (andb_true_true_r … H));
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqb8 : ∀b1,b2.b1 = b2 → eq_b8 b1 b2 = true.
- #b1; #b2;
- nelim b1;
- nelim b2;
- #e1; #e2; #e3; #e4;
- #H;
- nrewrite < (byte8_destruct_1 … H);
- nrewrite < (byte8_destruct_2 … H);
- nchange with (((eq_ex e3 e3)⊗(eq_ex e4 e4)) = true);
- nrewrite > (eq_to_eqex e3 e3 (refl_eq …));
- nrewrite > (eq_to_eqex e4 e4 (refl_eq …));
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-include "freescale/quatern.ma".
-include "freescale/oct.ma".
-include "freescale/prod.ma".
-
-(* *********** *)
-(* ESADECIMALI *)
-(* *********** *)
-
-ninductive exadecim : Type ≝
- x0: exadecim
-| x1: exadecim
-| x2: exadecim
-| x3: exadecim
-| x4: exadecim
-| x5: exadecim
-| x6: exadecim
-| x7: exadecim
-| x8: exadecim
-| x9: exadecim
-| xA: exadecim
-| xB: exadecim
-| xC: exadecim
-| xD: exadecim
-| xE: exadecim
-| xF: exadecim.
-
-(* operatore = *)
-ndefinition eq_ex ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with [ x0 ⇒ true | _ ⇒ false ]
- | x1 ⇒ match e2 with [ x1 ⇒ true | _ ⇒ false ]
- | x2 ⇒ match e2 with [ x2 ⇒ true | _ ⇒ false ]
- | x3 ⇒ match e2 with [ x3 ⇒ true | _ ⇒ false ]
- | x4 ⇒ match e2 with [ x4 ⇒ true | _ ⇒ false ]
- | x5 ⇒ match e2 with [ x5 ⇒ true | _ ⇒ false ]
- | x6 ⇒ match e2 with [ x6 ⇒ true | _ ⇒ false ]
- | x7 ⇒ match e2 with [ x7 ⇒ true | _ ⇒ false ]
- | x8 ⇒ match e2 with [ x8 ⇒ true | _ ⇒ false ]
- | x9 ⇒ match e2 with [ x9 ⇒ true | _ ⇒ false ]
- | xA ⇒ match e2 with [ xA ⇒ true | _ ⇒ false ]
- | xB ⇒ match e2 with [ xB ⇒ true | _ ⇒ false ]
- | xC ⇒ match e2 with [ xC ⇒ true | _ ⇒ false ]
- | xD ⇒ match e2 with [ xD ⇒ true | _ ⇒ false ]
- | xE ⇒ match e2 with [ xE ⇒ true | _ ⇒ false ]
- | xF ⇒ match e2 with [ xF ⇒ true | _ ⇒ false ]
- ].
-
-(* operatore < *)
-ndefinition lt_ex ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ true | xF ⇒ true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- ].
-
-(* operatore ≤ *)
-ndefinition le_ex ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ true | xF ⇒ true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ true ]
- ].
-
-(* operatore > *)
-ndefinition gt_ex ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xA ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xB ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xC ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xD ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xE ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ false | xF ⇒ false ]
- | xF ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ false ]
- ].
-
-(* operatore ≥ *)
-ndefinition ge_ex ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ false | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ false | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xA ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ false
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xB ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xC ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | xD ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ false | xF ⇒ false ]
- | xE ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ false ]
- | xF ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true
- | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- ].
-
-(* operatore and *)
-ndefinition and_ex ≝
-λe1,e2:exadecim.match e1 with
- [ x0 ⇒ match e2 with
- [ 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 ⇒ x0 ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x0 | x3 ⇒ x1
- | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x0 | xB ⇒ x1
- | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x0 | xF ⇒ x1 ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x2 | x3 ⇒ x2
- | x4 ⇒ x0 | x5 ⇒ x0 | x6 ⇒ x2 | x7 ⇒ x2
- | x8 ⇒ x0 | x9 ⇒ x0 | xA ⇒ x2 | xB ⇒ x2
- | xC ⇒ x0 | xD ⇒ x0 | xE ⇒ x2 | xF ⇒ x2 ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3
- | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x2 | xF ⇒ x3 ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x0 | x3 ⇒ x0
- | x4 ⇒ x4 | x5 ⇒ x4 | x6 ⇒ x4 | x7 ⇒ x4
- | x8 ⇒ x0 | x9 ⇒ x0 | xA ⇒ x0 | xB ⇒ x0
- | xC ⇒ x4 | xD ⇒ x4 | xE ⇒ x4 | xF ⇒ x4 ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x0 | x3 ⇒ x1
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x0 | xB ⇒ x1
- | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x4 | xF ⇒ x5 ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x2 | x3 ⇒ x2
- | x4 ⇒ x4 | x5 ⇒ x4 | x6 ⇒ x6 | x7 ⇒ x6
- | x8 ⇒ x0 | x9 ⇒ x0 | xA ⇒ x2 | xB ⇒ x2
- | xC ⇒ x4 | xD ⇒ x4 | xE ⇒ x6 | xF ⇒ x6 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3
- | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x6 | xF ⇒ x7 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x0 | x3 ⇒ x0
- | x4 ⇒ x0 | x5 ⇒ x0 | x6 ⇒ x0 | x7 ⇒ x0
- | x8 ⇒ x8 | x9 ⇒ x8 | xA ⇒ x8 | xB ⇒ x8
- | xC ⇒ x8 | xD ⇒ x8 | xE ⇒ x8 | xF ⇒ x8 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x0 | x3 ⇒ x1
- | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ x8 | xB ⇒ x9
- | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ x8 | xF ⇒ x9 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x2 | x3 ⇒ x2
- | x4 ⇒ x0 | x5 ⇒ x0 | x6 ⇒ x2 | x7 ⇒ x2
- | x8 ⇒ x8 | x9 ⇒ x8 | xA ⇒ xA | xB ⇒ xA
- | xC ⇒ x8 | xD ⇒ x8 | xE ⇒ xA | xF ⇒ xA ]
- | xB ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ xA | xF ⇒ xB ]
- | xC ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x0 | x3 ⇒ x0
- | x4 ⇒ x4 | x5 ⇒ x4 | x6 ⇒ x4 | x7 ⇒ x4
- | x8 ⇒ x8 | x9 ⇒ x8 | xA ⇒ x8 | xB ⇒ x8
- | xC ⇒ xC | xD ⇒ xC | xE ⇒ xC | xF ⇒ xC ]
- | xD ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x0 | x3 ⇒ x1
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ x8 | xB ⇒ x9
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xC | xF ⇒ xD ]
- | xE ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x0 | x2 ⇒ x2 | x3 ⇒ x2
- | x4 ⇒ x4 | x5 ⇒ x4 | x6 ⇒ x6 | x7 ⇒ x6
- | x8 ⇒ x8 | x9 ⇒ x8 | xA ⇒ xA | xB ⇒ xA
- | xC ⇒ xC | xD ⇒ xC | xE ⇒ xE | xF ⇒ xE ]
- | xF ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- ].
-
-(* operatore or *)
-ndefinition or_ex ≝
-λe1,e2:exadecim.match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x1 | x1 ⇒ x1 | x2 ⇒ x3 | x3 ⇒ x3
- | x4 ⇒ x5 | x5 ⇒ x5 | x6 ⇒ x7 | x7 ⇒ x7
- | x8 ⇒ x9 | x9 ⇒ x9 | xA ⇒ xB | xB ⇒ xB
- | xC ⇒ xD | xD ⇒ xD | xE ⇒ xF | xF ⇒ xF ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x2 | x1 ⇒ x3 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xE | xD ⇒ xF | xE ⇒ xE | xF ⇒ xF ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x3 | x1 ⇒ x3 | x2 ⇒ x3 | x3 ⇒ x3
- | x4 ⇒ x7 | x5 ⇒ x7 | x6 ⇒ x7 | x7 ⇒ x7
- | x8 ⇒ xB | x9 ⇒ xB | xA ⇒ xB | xB ⇒ xB
- | xC ⇒ xF | xD ⇒ xF | xE ⇒ xF | xF ⇒ xF ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x4 | x1 ⇒ x5 | x2 ⇒ x6 | x3 ⇒ x7
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x5 | x1 ⇒ x5 | x2 ⇒ x7 | x3 ⇒ x7
- | x4 ⇒ x5 | x5 ⇒ x5 | x6 ⇒ x7 | x7 ⇒ x7
- | x8 ⇒ xD | x9 ⇒ xD | xA ⇒ xF | xB ⇒ xF
- | xC ⇒ xD | xD ⇒ xD | xE ⇒ xF | xF ⇒ xF ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x6 | x1 ⇒ x7 | x2 ⇒ x6 | x3 ⇒ x7
- | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ xE | xB ⇒ xF
- | xC ⇒ xE | xD ⇒ xF | xE ⇒ xE | xF ⇒ xF ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x7 | x1 ⇒ x7 | x2 ⇒ x7 | x3 ⇒ x7
- | x4 ⇒ x7 | x5 ⇒ x7 | x6 ⇒ x7 | x7 ⇒ x7
- | x8 ⇒ xF | x9 ⇒ xF | xA ⇒ xF | xB ⇒ xF
- | xC ⇒ xF | xD ⇒ xF | xE ⇒ xF | xF ⇒ xF ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x8 | x1 ⇒ x9 | x2 ⇒ xA | x3 ⇒ xB
- | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ x9 | x1 ⇒ x9 | x2 ⇒ xB | x3 ⇒ xB
- | x4 ⇒ xD | x5 ⇒ xD | x6 ⇒ xF | x7 ⇒ xF
- | x8 ⇒ x9 | x9 ⇒ x9 | xA ⇒ xB | xB ⇒ xB
- | xC ⇒ xD | xD ⇒ xD | xE ⇒ xF | xF ⇒ xF ]
- | xA ⇒ match e2 with
- [ x0 ⇒ xA | x1 ⇒ xB | x2 ⇒ xA | x3 ⇒ xB
- | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xE | xD ⇒ xF | xE ⇒ xE | xF ⇒ xF ]
- | xB ⇒ match e2 with
- [ x0 ⇒ xB | x1 ⇒ xB | x2 ⇒ xB | x3 ⇒ xB
- | x4 ⇒ xF | x5 ⇒ xF | x6 ⇒ xF | x7 ⇒ xF
- | x8 ⇒ xB | x9 ⇒ xB | xA ⇒ xB | xB ⇒ xB
- | xC ⇒ xF | xD ⇒ xF | xE ⇒ xF | xF ⇒ xF ]
- | xC ⇒ match e2 with
- [ x0 ⇒ xC | x1 ⇒ xD | x2 ⇒ xE | x3 ⇒ xF
- | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | xD ⇒ match e2 with
- [ x0 ⇒ xD | x1 ⇒ xD | x2 ⇒ xF | x3 ⇒ xF
- | x4 ⇒ xD | x5 ⇒ xD | x6 ⇒ xF | x7 ⇒ xF
- | x8 ⇒ xD | x9 ⇒ xD | xA ⇒ xF | xB ⇒ xF
- | xC ⇒ xD | xD ⇒ xD | xE ⇒ xF | xF ⇒ xF ]
- | xE ⇒ match e2 with
- [ x0 ⇒ xE | x1 ⇒ xF | x2 ⇒ xE | x3 ⇒ xF
- | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ xE | xB ⇒ xF
- | xC ⇒ xE | xD ⇒ xF | xE ⇒ xE | xF ⇒ xF ]
- | xF ⇒ match e2 with
- [ 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 ⇒ xF ]
- ].
-
-(* operatore xor *)
-ndefinition xor_ex ≝
-λe1,e2:exadecim.match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3
- | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB
- | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x1 | x1 ⇒ x0 | x2 ⇒ x3 | x3 ⇒ x2
- | x4 ⇒ x5 | x5 ⇒ x4 | x6 ⇒ x7 | x7 ⇒ x6
- | x8 ⇒ x9 | x9 ⇒ x8 | xA ⇒ xB | xB ⇒ xA
- | xC ⇒ xD | xD ⇒ xC | xE ⇒ xF | xF ⇒ xE ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x2 | x1 ⇒ x3 | x2 ⇒ x0 | x3 ⇒ x1
- | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ x8 | xB ⇒ x9
- | xC ⇒ xE | xD ⇒ xF | xE ⇒ xC | xF ⇒ xD ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x3 | x1 ⇒ x2 | x2 ⇒ x1 | x3 ⇒ x0
- | x4 ⇒ x7 | x5 ⇒ x6 | x6 ⇒ x5 | x7 ⇒ x4
- | x8 ⇒ xB | x9 ⇒ xA | xA ⇒ x9 | xB ⇒ x8
- | xC ⇒ xF | xD ⇒ xE | xE ⇒ xD | xF ⇒ xC ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x4 | x1 ⇒ x5 | x2 ⇒ x6 | x3 ⇒ x7
- | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF
- | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ xA | xF ⇒ xB ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x5 | x1 ⇒ x4 | x2 ⇒ x7 | x3 ⇒ x6
- | x4 ⇒ x1 | x5 ⇒ x0 | x6 ⇒ x3 | x7 ⇒ x2
- | x8 ⇒ xD | x9 ⇒ xC | xA ⇒ xF | xB ⇒ xE
- | xC ⇒ x9 | xD ⇒ x8 | xE ⇒ xB | xF ⇒ xA ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x6 | x1 ⇒ x7 | x2 ⇒ x4 | x3 ⇒ x5
- | x4 ⇒ x2 | x5 ⇒ x3 | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ xC | xB ⇒ xD
- | xC ⇒ xA | xD ⇒ xB | xE ⇒ x8 | xF ⇒ x9 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x7 | x1 ⇒ x6 | x2 ⇒ x5 | x3 ⇒ x4
- | x4 ⇒ x3 | x5 ⇒ x2 | x6 ⇒ x1 | x7 ⇒ x0
- | x8 ⇒ xF | x9 ⇒ xE | xA ⇒ xD | xB ⇒ xC
- | xC ⇒ xB | xD ⇒ xA | xE ⇒ x9 | xF ⇒ x8 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x8 | x1 ⇒ x9 | x2 ⇒ xA | x3 ⇒ xB
- | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3
- | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x6 | xF ⇒ x7 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ x9 | x1 ⇒ x8 | x2 ⇒ xB | x3 ⇒ xA
- | x4 ⇒ xD | x5 ⇒ xC | x6 ⇒ xF | x7 ⇒ xE
- | x8 ⇒ x1 | x9 ⇒ x0 | xA ⇒ x3 | xB ⇒ x2
- | xC ⇒ x5 | xD ⇒ x4 | xE ⇒ x7 | xF ⇒ x6 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ xA | x1 ⇒ xB | x2 ⇒ x8 | x3 ⇒ x9
- | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ xC | x7 ⇒ xD
- | x8 ⇒ x2 | x9 ⇒ x3 | xA ⇒ x0 | xB ⇒ x1
- | xC ⇒ x6 | xD ⇒ x7 | xE ⇒ x4 | xF ⇒ x5 ]
- | xB ⇒ match e2 with
- [ x0 ⇒ xB | x1 ⇒ xA | x2 ⇒ x9 | x3 ⇒ x8
- | x4 ⇒ xF | x5 ⇒ xE | x6 ⇒ xD | x7 ⇒ xC
- | x8 ⇒ x3 | x9 ⇒ x2 | xA ⇒ x1 | xB ⇒ x0
- | xC ⇒ x7 | xD ⇒ x6 | xE ⇒ x5 | xF ⇒ x4 ]
- | xC ⇒ match e2 with
- [ x0 ⇒ xC | x1 ⇒ xD | x2 ⇒ xE | x3 ⇒ xF
- | x4 ⇒ x8 | x5 ⇒ x9 | x6 ⇒ xA | x7 ⇒ xB
- | x8 ⇒ x4 | x9 ⇒ x5 | xA ⇒ x6 | xB ⇒ x7
- | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x2 | xF ⇒ x3 ]
- | xD ⇒ match e2 with
- [ x0 ⇒ xD | x1 ⇒ xC | x2 ⇒ xF | x3 ⇒ xE
- | x4 ⇒ x9 | x5 ⇒ x8 | x6 ⇒ xB | x7 ⇒ xA
- | x8 ⇒ x5 | x9 ⇒ x4 | xA ⇒ x7 | xB ⇒ x6
- | xC ⇒ x1 | xD ⇒ x0 | xE ⇒ x3 | xF ⇒ x2 ]
- | xE ⇒ match e2 with
- [ x0 ⇒ xE | x1 ⇒ xF | x2 ⇒ xC | x3 ⇒ xD
- | x4 ⇒ xA | x5 ⇒ xB | x6 ⇒ x8 | x7 ⇒ x9
- | x8 ⇒ x6 | x9 ⇒ x7 | xA ⇒ x4 | xB ⇒ x5
- | xC ⇒ x2 | xD ⇒ x3 | xE ⇒ x0 | xF ⇒ x1 ]
- | xF ⇒ match e2 with
- [ x0 ⇒ xF | x1 ⇒ xE | x2 ⇒ xD | x3 ⇒ xC
- | x4 ⇒ xB | x5 ⇒ xA | x6 ⇒ x9 | x7 ⇒ x8
- | x8 ⇒ x7 | x9 ⇒ x6 | xA ⇒ x5 | xB ⇒ x4
- | xC ⇒ x3 | xD ⇒ x2 | xE ⇒ x1 | xF ⇒ x0 ]
- ].
-
-(* operatore rotazione destra con carry *)
-ndefinition rcr_ex ≝
-λe:exadecim.λc:bool.match c with
- [ true ⇒ match e with
- [ x0 ⇒ pair exadecim bool x8 false | x1 ⇒ pair exadecim bool x8 true
- | x2 ⇒ pair exadecim bool x9 false | x3 ⇒ pair exadecim bool x9 true
- | x4 ⇒ pair exadecim bool xA false | x5 ⇒ pair exadecim bool xA true
- | x6 ⇒ pair exadecim bool xB false | x7 ⇒ pair exadecim bool xB true
- | x8 ⇒ pair exadecim bool xC false | x9 ⇒ pair exadecim bool xC true
- | xA ⇒ pair exadecim bool xD false | xB ⇒ pair exadecim bool xD true
- | xC ⇒ pair exadecim bool xE false | xD ⇒ pair exadecim bool xE true
- | xE ⇒ pair exadecim bool xF false | xF ⇒ pair exadecim bool xF true ]
- | false ⇒ match e with
- [ x0 ⇒ pair exadecim bool x0 false | x1 ⇒ pair exadecim bool x0 true
- | x2 ⇒ pair exadecim bool x1 false | x3 ⇒ pair exadecim bool x1 true
- | x4 ⇒ pair exadecim bool x2 false | x5 ⇒ pair exadecim bool x2 true
- | x6 ⇒ pair exadecim bool x3 false | x7 ⇒ pair exadecim bool x3 true
- | x8 ⇒ pair exadecim bool x4 false | x9 ⇒ pair exadecim bool x4 true
- | xA ⇒ pair exadecim bool x5 false | xB ⇒ pair exadecim bool x5 true
- | xC ⇒ pair exadecim bool x6 false | xD ⇒ pair exadecim bool x6 true
- | xE ⇒ pair exadecim bool x7 false | xF ⇒ pair exadecim bool x7 true ]
- ].
-
-(* operatore shift destro *)
-ndefinition shr_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ pair exadecim bool x0 false | x1 ⇒ pair exadecim bool x0 true
- | x2 ⇒ pair exadecim bool x1 false | x3 ⇒ pair exadecim bool x1 true
- | x4 ⇒ pair exadecim bool x2 false | x5 ⇒ pair exadecim bool x2 true
- | x6 ⇒ pair exadecim bool x3 false | x7 ⇒ pair exadecim bool x3 true
- | x8 ⇒ pair exadecim bool x4 false | x9 ⇒ pair exadecim bool x4 true
- | xA ⇒ pair exadecim bool x5 false | xB ⇒ pair exadecim bool x5 true
- | xC ⇒ pair exadecim bool x6 false | xD ⇒ pair exadecim bool x6 true
- | xE ⇒ pair exadecim bool x7 false | xF ⇒ pair exadecim bool x7 true ].
-
-(* operatore rotazione destra *)
-ndefinition ror_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ x0 | x1 ⇒ x8 | x2 ⇒ x1 | x3 ⇒ x9
- | x4 ⇒ x2 | x5 ⇒ xA | x6 ⇒ x3 | x7 ⇒ xB
- | x8 ⇒ x4 | x9 ⇒ xC | xA ⇒ x5 | xB ⇒ xD
- | xC ⇒ x6 | xD ⇒ xE | xE ⇒ x7 | xF ⇒ xF ].
-
-(* operatore rotazione destra n-volte *)
-nlet rec ror_ex_n (e:exadecim) (n:quatern) (r:rec_quatern n) on r ≝
- match r with
- [ qu_O ⇒ e
- | qu_S t n' ⇒ ror_ex_n (ror_ex e) t n' ].
-
-(* operatore rotazione sinistra con carry *)
-ndefinition rcl_ex ≝
-λe:exadecim.λc:bool.match c with
- [ true ⇒ match e with
- [ x0 ⇒ pair exadecim bool x1 false | x1 ⇒ pair exadecim bool x3 false
- | x2 ⇒ pair exadecim bool x5 false | x3 ⇒ pair exadecim bool x7 false
- | x4 ⇒ pair exadecim bool x9 false | x5 ⇒ pair exadecim bool xB false
- | x6 ⇒ pair exadecim bool xD false | x7 ⇒ pair exadecim bool xF false
- | x8 ⇒ pair exadecim bool x1 true | x9 ⇒ pair exadecim bool x3 true
- | xA ⇒ pair exadecim bool x5 true | xB ⇒ pair exadecim bool x7 true
- | xC ⇒ pair exadecim bool x9 true | xD ⇒ pair exadecim bool xB true
- | xE ⇒ pair exadecim bool xD true | xF ⇒ pair exadecim bool xF true ]
- | false ⇒ match e with
- [ x0 ⇒ pair exadecim bool x0 false | x1 ⇒ pair exadecim bool x2 false
- | x2 ⇒ pair exadecim bool x4 false | x3 ⇒ pair exadecim bool x6 false
- | x4 ⇒ pair exadecim bool x8 false | x5 ⇒ pair exadecim bool xA false
- | x6 ⇒ pair exadecim bool xC false | x7 ⇒ pair exadecim bool xE false
- | x8 ⇒ pair exadecim bool x0 true | x9 ⇒ pair exadecim bool x2 true
- | xA ⇒ pair exadecim bool x4 true | xB ⇒ pair exadecim bool x6 true
- | xC ⇒ pair exadecim bool x8 true | xD ⇒ pair exadecim bool xA true
- | xE ⇒ pair exadecim bool xC true | xF ⇒ pair exadecim bool xE true ]
- ].
-
-(* operatore shift sinistro *)
-ndefinition shl_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ pair exadecim bool x0 false | x1 ⇒ pair exadecim bool x2 false
- | x2 ⇒ pair exadecim bool x4 false | x3 ⇒ pair exadecim bool x6 false
- | x4 ⇒ pair exadecim bool x8 false | x5 ⇒ pair exadecim bool xA false
- | x6 ⇒ pair exadecim bool xC false | x7 ⇒ pair exadecim bool xE false
- | x8 ⇒ pair exadecim bool x0 true | x9 ⇒ pair exadecim bool x2 true
- | xA ⇒ pair exadecim bool x4 true | xB ⇒ pair exadecim bool x6 true
- | xC ⇒ pair exadecim bool x8 true | xD ⇒ pair exadecim bool xA true
- | xE ⇒ pair exadecim bool xC true | xF ⇒ pair exadecim bool xE true ].
-
-(* operatore rotazione sinistra *)
-ndefinition rol_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ x0 | x1 ⇒ x2 | x2 ⇒ x4 | x3 ⇒ x6
- | x4 ⇒ x8 | x5 ⇒ xA | x6 ⇒ xC | x7 ⇒ xE
- | x8 ⇒ x1 | x9 ⇒ x3 | xA ⇒ x5 | xB ⇒ x7
- | xC ⇒ x9 | xD ⇒ xB | xE ⇒ xD | xF ⇒ xF ].
-
-(* operatore rotazione sinistra n-volte *)
-nlet rec rol_ex_n (e:exadecim) (n:quatern) (r:rec_quatern n) on r ≝
- match r with
- [ qu_O ⇒ e
- | qu_S t n' ⇒ rol_ex_n (rol_ex e) t n' ].
-
-(* operatore not/complemento a 1 *)
-ndefinition not_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ xF | x1 ⇒ xE | x2 ⇒ xD | x3 ⇒ xC
- | x4 ⇒ xB | x5 ⇒ xA | x6 ⇒ x9 | x7 ⇒ x8
- | x8 ⇒ x7 | x9 ⇒ x6 | xA ⇒ x5 | xB ⇒ x4
- | xC ⇒ x3 | xD ⇒ x2 | xE ⇒ x1 | xF ⇒ x0 ].
-
-(* operatore somma con data+carry → data+carry *)
-ndefinition plus_ex_dc_dc ≝
-λe1,e2:exadecim.λc:bool.
- match c with
- [ true ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ pair … x1 false | x1 ⇒ pair … x2 false | x2 ⇒ pair … x3 false | x3 ⇒ pair … x4 false
- | x4 ⇒ pair … x5 false | x5 ⇒ pair … x6 false | x6 ⇒ pair … x7 false | x7 ⇒ pair … x8 false
- | x8 ⇒ pair … x9 false | x9 ⇒ pair … xA false | xA ⇒ pair … xB false | xB ⇒ pair … xC false
- | xC ⇒ pair … xD false | xD ⇒ pair … xE false | xE ⇒ pair … xF false | xF ⇒ pair … x0 true ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ pair … x2 false | x1 ⇒ pair … x3 false | x2 ⇒ pair … x4 false | x3 ⇒ pair … x5 false
- | x4 ⇒ pair … x6 false | x5 ⇒ pair … x7 false | x6 ⇒ pair … x8 false | x7 ⇒ pair … x9 false
- | x8 ⇒ pair … xA false | x9 ⇒ pair … xB false | xA ⇒ pair … xC false | xB ⇒ pair … xD false
- | xC ⇒ pair … xE false | xD ⇒ pair … xF false | xE ⇒ pair … x0 true | xF ⇒ pair … x1 true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ pair … x3 false | x1 ⇒ pair … x4 false | x2 ⇒ pair … x5 false | x3 ⇒ pair … x6 false
- | x4 ⇒ pair … x7 false | x5 ⇒ pair … x8 false | x6 ⇒ pair … x9 false | x7 ⇒ pair … xA false
- | x8 ⇒ pair … xB false | x9 ⇒ pair … xC false | xA ⇒ pair … xD false | xB ⇒ pair … xE false
- | xC ⇒ pair … xF false | xD ⇒ pair … x0 true | xE ⇒ pair … x1 true | xF ⇒ pair … x2 true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ pair … x4 false | x1 ⇒ pair … x5 false | x2 ⇒ pair … x6 false | x3 ⇒ pair … x7 false
- | x4 ⇒ pair … x8 false | x5 ⇒ pair … x9 false | x6 ⇒ pair … xA false | x7 ⇒ pair … xB false
- | x8 ⇒ pair … xC false | x9 ⇒ pair … xD false | xA ⇒ pair … xE false | xB ⇒ pair … xF false
- | xC ⇒ pair … x0 true | xD ⇒ pair … x1 true | xE ⇒ pair … x2 true | xF ⇒ pair … x3 true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ pair … x5 false | x1 ⇒ pair … x6 false | x2 ⇒ pair … x7 false | x3 ⇒ pair … x8 false
- | x4 ⇒ pair … x9 false | x5 ⇒ pair … xA false | x6 ⇒ pair … xB false | x7 ⇒ pair … xC false
- | x8 ⇒ pair … xD false | x9 ⇒ pair … xE false | xA ⇒ pair … xF false | xB ⇒ pair … x0 true
- | xC ⇒ pair … x1 true | xD ⇒ pair … x2 true | xE ⇒ pair … x3 true | xF ⇒ pair … x4 true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ pair … x6 false | x1 ⇒ pair … x7 false | x2 ⇒ pair … x8 false | x3 ⇒ pair … x9 false
- | x4 ⇒ pair … xA false | x5 ⇒ pair … xB false | x6 ⇒ pair … xC false | x7 ⇒ pair … xD false
- | x8 ⇒ pair … xE false | x9 ⇒ pair … xF false | xA ⇒ pair … x0 true | xB ⇒ pair … x1 true
- | xC ⇒ pair … x2 true | xD ⇒ pair … x3 true | xE ⇒ pair … x4 true | xF ⇒ pair … x5 true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ pair … x7 false | x1 ⇒ pair … x8 false | x2 ⇒ pair … x9 false | x3 ⇒ pair … xA false
- | x4 ⇒ pair … xB false | x5 ⇒ pair … xC false | x6 ⇒ pair … xD false | x7 ⇒ pair … xE false
- | x8 ⇒ pair … xF false | x9 ⇒ pair … x0 true | xA ⇒ pair … x1 true | xB ⇒ pair … x2 true
- | xC ⇒ pair … x3 true | xD ⇒ pair … x4 true | xE ⇒ pair … x5 true | xF ⇒ pair … x6 true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ pair … x8 false | x1 ⇒ pair … x9 false | x2 ⇒ pair … xA false | x3 ⇒ pair … xB false
- | x4 ⇒ pair … xC false | x5 ⇒ pair … xD false | x6 ⇒ pair … xE false | x7 ⇒ pair … xF false
- | x8 ⇒ pair … x0 true | x9 ⇒ pair … x1 true | xA ⇒ pair … x2 true | xB ⇒ pair … x3 true
- | xC ⇒ pair … x4 true | xD ⇒ pair … x5 true | xE ⇒ pair … x6 true | xF ⇒ pair … x7 true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ pair … x9 false | x1 ⇒ pair … xA false | x2 ⇒ pair … xB false | x3 ⇒ pair … xC false
- | x4 ⇒ pair … xD false | x5 ⇒ pair … xE false | x6 ⇒ pair … xF false | x7 ⇒ pair … x0 true
- | x8 ⇒ pair … x1 true | x9 ⇒ pair … x2 true | xA ⇒ pair … x3 true | xB ⇒ pair … x4 true
- | xC ⇒ pair … x5 true | xD ⇒ pair … x6 true | xE ⇒ pair … x7 true | xF ⇒ pair … x8 true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ pair … xA false | x1 ⇒ pair … xB false | x2 ⇒ pair … xC false | x3 ⇒ pair … xD false
- | x4 ⇒ pair … xE false | x5 ⇒ pair … xF false | x6 ⇒ pair … x0 true | x7 ⇒ pair … x1 true
- | x8 ⇒ pair … x2 true | x9 ⇒ pair … x3 true | xA ⇒ pair … x4 true | xB ⇒ pair … x5 true
- | xC ⇒ pair … x6 true | xD ⇒ pair … x7 true | xE ⇒ pair … x8 true | xF ⇒ pair … x9 true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ pair … xB false | x1 ⇒ pair … xC false | x2 ⇒ pair … xD false | x3 ⇒ pair … xE false
- | x4 ⇒ pair … xF false | x5 ⇒ pair … x0 true | x6 ⇒ pair … x1 true | x7 ⇒ pair … x2 true
- | x8 ⇒ pair … x3 true | x9 ⇒ pair … x4 true | xA ⇒ pair … x5 true | xB ⇒ pair … x6 true
- | xC ⇒ pair … x7 true | xD ⇒ pair … x8 true | xE ⇒ pair … x9 true | xF ⇒ pair … xA true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ pair … xC false | x1 ⇒ pair … xD false | x2 ⇒ pair … xE false | x3 ⇒ pair … xF false
- | x4 ⇒ pair … x0 true | x5 ⇒ pair … x1 true | x6 ⇒ pair … x2 true | x7 ⇒ pair … x3 true
- | x8 ⇒ pair … x4 true | x9 ⇒ pair … x5 true | xA ⇒ pair … x6 true | xB ⇒ pair … x7 true
- | xC ⇒ pair … x8 true | xD ⇒ pair … x9 true | xE ⇒ pair … xA true | xF ⇒ pair … xB true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ pair … xD false | x1 ⇒ pair … xE false | x2 ⇒ pair … xF false | x3 ⇒ pair … x0 true
- | x4 ⇒ pair … x1 true | x5 ⇒ pair … x2 true | x6 ⇒ pair … x3 true | x7 ⇒ pair … x4 true
- | x8 ⇒ pair … x5 true | x9 ⇒ pair … x6 true | xA ⇒ pair … x7 true | xB ⇒ pair … x8 true
- | xC ⇒ pair … x9 true | xD ⇒ pair … xA true | xE ⇒ pair … xB true | xF ⇒ pair … xC true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ pair … xE false | x1 ⇒ pair … xF false | x2 ⇒ pair … x0 true | x3 ⇒ pair … x1 true
- | x4 ⇒ pair … x2 true | x5 ⇒ pair … x3 true | x6 ⇒ pair … x4 true | x7 ⇒ pair … x5 true
- | x8 ⇒ pair … x6 true | x9 ⇒ pair … x7 true | xA ⇒ pair … x8 true | xB ⇒ pair … x9 true
- | xC ⇒ pair … xA true | xD ⇒ pair … xB true | xE ⇒ pair … xC true | xF ⇒ pair … xD true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ pair … xF false | x1 ⇒ pair … x0 true | x2 ⇒ pair … x1 true | x3 ⇒ pair … x2 true
- | x4 ⇒ pair … x3 true | x5 ⇒ pair … x4 true | x6 ⇒ pair … x5 true | x7 ⇒ pair … x6 true
- | x8 ⇒ pair … x7 true | x9 ⇒ pair … x8 true | xA ⇒ pair … x9 true | xB ⇒ pair … xA true
- | xC ⇒ pair … xB true | xD ⇒ pair … xC true | xE ⇒ pair … xD true | xF ⇒ pair … xE true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ pair … x0 true | x1 ⇒ pair … x1 true | x2 ⇒ pair … x2 true | x3 ⇒ pair … x3 true
- | x4 ⇒ pair … x4 true | x5 ⇒ pair … x5 true | x6 ⇒ pair … x6 true | x7 ⇒ pair … x7 true
- | x8 ⇒ pair … x8 true | x9 ⇒ pair … x9 true | xA ⇒ pair … xA true | xB ⇒ pair … xB true
- | xC ⇒ pair … xC true | xD ⇒ pair … xD true | xE ⇒ pair … xE true | xF ⇒ pair … xF true ]
- ]
- | false ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ pair … x0 false | x1 ⇒ pair … x1 false | x2 ⇒ pair … x2 false | x3 ⇒ pair … x3 false
- | x4 ⇒ pair … x4 false | x5 ⇒ pair … x5 false | x6 ⇒ pair … x6 false | x7 ⇒ pair … x7 false
- | x8 ⇒ pair … x8 false | x9 ⇒ pair … x9 false | xA ⇒ pair … xA false | xB ⇒ pair … xB false
- | xC ⇒ pair … xC false | xD ⇒ pair … xD false | xE ⇒ pair … xE false | xF ⇒ pair … xF false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ pair … x1 false | x1 ⇒ pair … x2 false | x2 ⇒ pair … x3 false | x3 ⇒ pair … x4 false
- | x4 ⇒ pair … x5 false | x5 ⇒ pair … x6 false | x6 ⇒ pair … x7 false | x7 ⇒ pair … x8 false
- | x8 ⇒ pair … x9 false | x9 ⇒ pair … xA false | xA ⇒ pair … xB false | xB ⇒ pair … xC false
- | xC ⇒ pair … xD false | xD ⇒ pair … xE false | xE ⇒ pair … xF false | xF ⇒ pair … x0 true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ pair … x2 false | x1 ⇒ pair … x3 false | x2 ⇒ pair … x4 false | x3 ⇒ pair … x5 false
- | x4 ⇒ pair … x6 false | x5 ⇒ pair … x7 false | x6 ⇒ pair … x8 false | x7 ⇒ pair … x9 false
- | x8 ⇒ pair … xA false | x9 ⇒ pair … xB false | xA ⇒ pair … xC false | xB ⇒ pair … xD false
- | xC ⇒ pair … xE false | xD ⇒ pair … xF false | xE ⇒ pair … x0 true | xF ⇒ pair … x1 true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ pair … x3 false | x1 ⇒ pair … x4 false | x2 ⇒ pair … x5 false | x3 ⇒ pair … x6 false
- | x4 ⇒ pair … x7 false | x5 ⇒ pair … x8 false | x6 ⇒ pair … x9 false | x7 ⇒ pair … xA false
- | x8 ⇒ pair … xB false | x9 ⇒ pair … xC false | xA ⇒ pair … xD false | xB ⇒ pair … xE false
- | xC ⇒ pair … xF false | xD ⇒ pair … x0 true | xE ⇒ pair … x1 true | xF ⇒ pair … x2 true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ pair … x4 false | x1 ⇒ pair … x5 false | x2 ⇒ pair … x6 false | x3 ⇒ pair … x7 false
- | x4 ⇒ pair … x8 false | x5 ⇒ pair … x9 false | x6 ⇒ pair … xA false | x7 ⇒ pair … xB false
- | x8 ⇒ pair … xC false | x9 ⇒ pair … xD false | xA ⇒ pair … xE false | xB ⇒ pair … xF false
- | xC ⇒ pair … x0 true | xD ⇒ pair … x1 true | xE ⇒ pair … x2 true | xF ⇒ pair … x3 true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ pair … x5 false | x1 ⇒ pair … x6 false | x2 ⇒ pair … x7 false | x3 ⇒ pair … x8 false
- | x4 ⇒ pair … x9 false | x5 ⇒ pair … xA false | x6 ⇒ pair … xB false | x7 ⇒ pair … xC false
- | x8 ⇒ pair … xD false | x9 ⇒ pair … xE false | xA ⇒ pair … xF false | xB ⇒ pair … x0 true
- | xC ⇒ pair … x1 true | xD ⇒ pair … x2 true | xE ⇒ pair … x3 true | xF ⇒ pair … x4 true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ pair … x6 false | x1 ⇒ pair … x7 false | x2 ⇒ pair … x8 false | x3 ⇒ pair … x9 false
- | x4 ⇒ pair … xA false | x5 ⇒ pair … xB false | x6 ⇒ pair … xC false | x7 ⇒ pair … xD false
- | x8 ⇒ pair … xE false | x9 ⇒ pair … xF false | xA ⇒ pair … x0 true | xB ⇒ pair … x1 true
- | xC ⇒ pair … x2 true | xD ⇒ pair … x3 true | xE ⇒ pair … x4 true | xF ⇒ pair … x5 true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ pair … x7 false | x1 ⇒ pair … x8 false | x2 ⇒ pair … x9 false | x3 ⇒ pair … xA false
- | x4 ⇒ pair … xB false | x5 ⇒ pair … xC false | x6 ⇒ pair … xD false | x7 ⇒ pair … xE false
- | x8 ⇒ pair … xF false | x9 ⇒ pair … x0 true | xA ⇒ pair … x1 true | xB ⇒ pair … x2 true
- | xC ⇒ pair … x3 true | xD ⇒ pair … x4 true | xE ⇒ pair … x5 true | xF ⇒ pair … x6 true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ pair … x8 false | x1 ⇒ pair … x9 false | x2 ⇒ pair … xA false | x3 ⇒ pair … xB false
- | x4 ⇒ pair … xC false | x5 ⇒ pair … xD false | x6 ⇒ pair … xE false | x7 ⇒ pair … xF false
- | x8 ⇒ pair … x0 true | x9 ⇒ pair … x1 true | xA ⇒ pair … x2 true | xB ⇒ pair … x3 true
- | xC ⇒ pair … x4 true | xD ⇒ pair … x5 true | xE ⇒ pair … x6 true | xF ⇒ pair … x7 true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ pair … x9 false | x1 ⇒ pair … xA false | x2 ⇒ pair … xB false | x3 ⇒ pair … xC false
- | x4 ⇒ pair … xD false | x5 ⇒ pair … xE false | x6 ⇒ pair … xF false | x7 ⇒ pair … x0 true
- | x8 ⇒ pair … x1 true | x9 ⇒ pair … x2 true | xA ⇒ pair … x3 true | xB ⇒ pair … x4 true
- | xC ⇒ pair … x5 true | xD ⇒ pair … x6 true | xE ⇒ pair … x7 true | xF ⇒ pair … x8 true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ pair … xA false | x1 ⇒ pair … xB false | x2 ⇒ pair … xC false | x3 ⇒ pair … xD false
- | x4 ⇒ pair … xE false | x5 ⇒ pair … xF false | x6 ⇒ pair … x0 true | x7 ⇒ pair … x1 true
- | x8 ⇒ pair … x2 true | x9 ⇒ pair … x3 true | xA ⇒ pair … x4 true | xB ⇒ pair … x5 true
- | xC ⇒ pair … x6 true | xD ⇒ pair … x7 true | xE ⇒ pair … x8 true | xF ⇒ pair … x9 true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ pair … xB false | x1 ⇒ pair … xC false | x2 ⇒ pair … xD false | x3 ⇒ pair … xE false
- | x4 ⇒ pair … xF false | x5 ⇒ pair … x0 true | x6 ⇒ pair … x1 true | x7 ⇒ pair … x2 true
- | x8 ⇒ pair … x3 true | x9 ⇒ pair … x4 true | xA ⇒ pair … x5 true | xB ⇒ pair … x6 true
- | xC ⇒ pair … x7 true | xD ⇒ pair … x8 true | xE ⇒ pair … x9 true | xF ⇒ pair … xA true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ pair … xC false | x1 ⇒ pair … xD false | x2 ⇒ pair … xE false | x3 ⇒ pair … xF false
- | x4 ⇒ pair … x0 true | x5 ⇒ pair … x1 true | x6 ⇒ pair … x2 true | x7 ⇒ pair … x3 true
- | x8 ⇒ pair … x4 true | x9 ⇒ pair … x5 true | xA ⇒ pair … x6 true | xB ⇒ pair … x7 true
- | xC ⇒ pair … x8 true | xD ⇒ pair … x9 true | xE ⇒ pair … xA true | xF ⇒ pair … xB true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ pair … xD false | x1 ⇒ pair … xE false | x2 ⇒ pair … xF false | x3 ⇒ pair … x0 true
- | x4 ⇒ pair … x1 true | x5 ⇒ pair … x2 true | x6 ⇒ pair … x3 true | x7 ⇒ pair … x4 true
- | x8 ⇒ pair … x5 true | x9 ⇒ pair … x6 true | xA ⇒ pair … x7 true | xB ⇒ pair … x8 true
- | xC ⇒ pair … x9 true | xD ⇒ pair … xA true | xE ⇒ pair … xB true | xF ⇒ pair … xC true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ pair … xE false | x1 ⇒ pair … xF false | x2 ⇒ pair … x0 true | x3 ⇒ pair … x1 true
- | x4 ⇒ pair … x2 true | x5 ⇒ pair … x3 true | x6 ⇒ pair … x4 true | x7 ⇒ pair … x5 true
- | x8 ⇒ pair … x6 true | x9 ⇒ pair … x7 true | xA ⇒ pair … x8 true | xB ⇒ pair … x9 true
- | xC ⇒ pair … xA true | xD ⇒ pair … xB true | xE ⇒ pair … xC true | xF ⇒ pair … xD true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ pair … xF false | x1 ⇒ pair … x0 true | x2 ⇒ pair … x1 true | x3 ⇒ pair … x2 true
- | x4 ⇒ pair … x3 true | x5 ⇒ pair … x4 true | x6 ⇒ pair … x5 true | x7 ⇒ pair … x6 true
- | x8 ⇒ pair … x7 true | x9 ⇒ pair … x8 true | xA ⇒ pair … x9 true | xB ⇒ pair … xA true
- | xC ⇒ pair … xB true | xD ⇒ pair … xC true | xE ⇒ pair … xD true | xF ⇒ pair … xE true ]
- ]].
-
-(* operatore somma con data → data+carry *)
-ndefinition plus_ex_d_dc ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ pair … x0 false | x1 ⇒ pair … x1 false | x2 ⇒ pair … x2 false | x3 ⇒ pair … x3 false
- | x4 ⇒ pair … x4 false | x5 ⇒ pair … x5 false | x6 ⇒ pair … x6 false | x7 ⇒ pair … x7 false
- | x8 ⇒ pair … x8 false | x9 ⇒ pair … x9 false | xA ⇒ pair … xA false | xB ⇒ pair … xB false
- | xC ⇒ pair … xC false | xD ⇒ pair … xD false | xE ⇒ pair … xE false | xF ⇒ pair … xF false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ pair … x1 false | x1 ⇒ pair … x2 false | x2 ⇒ pair … x3 false | x3 ⇒ pair … x4 false
- | x4 ⇒ pair … x5 false | x5 ⇒ pair … x6 false | x6 ⇒ pair … x7 false | x7 ⇒ pair … x8 false
- | x8 ⇒ pair … x9 false | x9 ⇒ pair … xA false | xA ⇒ pair … xB false | xB ⇒ pair … xC false
- | xC ⇒ pair … xD false | xD ⇒ pair … xE false | xE ⇒ pair … xF false | xF ⇒ pair … x0 true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ pair … x2 false | x1 ⇒ pair … x3 false | x2 ⇒ pair … x4 false | x3 ⇒ pair … x5 false
- | x4 ⇒ pair … x6 false | x5 ⇒ pair … x7 false | x6 ⇒ pair … x8 false | x7 ⇒ pair … x9 false
- | x8 ⇒ pair … xA false | x9 ⇒ pair … xB false | xA ⇒ pair … xC false | xB ⇒ pair … xD false
- | xC ⇒ pair … xE false | xD ⇒ pair … xF false | xE ⇒ pair … x0 true | xF ⇒ pair … x1 true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ pair … x3 false | x1 ⇒ pair … x4 false | x2 ⇒ pair … x5 false | x3 ⇒ pair … x6 false
- | x4 ⇒ pair … x7 false | x5 ⇒ pair … x8 false | x6 ⇒ pair … x9 false | x7 ⇒ pair … xA false
- | x8 ⇒ pair … xB false | x9 ⇒ pair … xC false | xA ⇒ pair … xD false | xB ⇒ pair … xE false
- | xC ⇒ pair … xF false | xD ⇒ pair … x0 true | xE ⇒ pair … x1 true | xF ⇒ pair … x2 true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ pair … x4 false | x1 ⇒ pair … x5 false | x2 ⇒ pair … x6 false | x3 ⇒ pair … x7 false
- | x4 ⇒ pair … x8 false | x5 ⇒ pair … x9 false | x6 ⇒ pair … xA false | x7 ⇒ pair … xB false
- | x8 ⇒ pair … xC false | x9 ⇒ pair … xD false | xA ⇒ pair … xE false | xB ⇒ pair … xF false
- | xC ⇒ pair … x0 true | xD ⇒ pair … x1 true | xE ⇒ pair … x2 true | xF ⇒ pair … x3 true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ pair … x5 false | x1 ⇒ pair … x6 false | x2 ⇒ pair … x7 false | x3 ⇒ pair … x8 false
- | x4 ⇒ pair … x9 false | x5 ⇒ pair … xA false | x6 ⇒ pair … xB false | x7 ⇒ pair … xC false
- | x8 ⇒ pair … xD false | x9 ⇒ pair … xE false | xA ⇒ pair … xF false | xB ⇒ pair … x0 true
- | xC ⇒ pair … x1 true | xD ⇒ pair … x2 true | xE ⇒ pair … x3 true | xF ⇒ pair … x4 true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ pair … x6 false | x1 ⇒ pair … x7 false | x2 ⇒ pair … x8 false | x3 ⇒ pair … x9 false
- | x4 ⇒ pair … xA false | x5 ⇒ pair … xB false | x6 ⇒ pair … xC false | x7 ⇒ pair … xD false
- | x8 ⇒ pair … xE false | x9 ⇒ pair … xF false | xA ⇒ pair … x0 true | xB ⇒ pair … x1 true
- | xC ⇒ pair … x2 true | xD ⇒ pair … x3 true | xE ⇒ pair … x4 true | xF ⇒ pair … x5 true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ pair … x7 false | x1 ⇒ pair … x8 false | x2 ⇒ pair … x9 false | x3 ⇒ pair … xA false
- | x4 ⇒ pair … xB false | x5 ⇒ pair … xC false | x6 ⇒ pair … xD false | x7 ⇒ pair … xE false
- | x8 ⇒ pair … xF false | x9 ⇒ pair … x0 true | xA ⇒ pair … x1 true | xB ⇒ pair … x2 true
- | xC ⇒ pair … x3 true | xD ⇒ pair … x4 true | xE ⇒ pair … x5 true | xF ⇒ pair … x6 true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ pair … x8 false | x1 ⇒ pair … x9 false | x2 ⇒ pair … xA false | x3 ⇒ pair … xB false
- | x4 ⇒ pair … xC false | x5 ⇒ pair … xD false | x6 ⇒ pair … xE false | x7 ⇒ pair … xF false
- | x8 ⇒ pair … x0 true | x9 ⇒ pair … x1 true | xA ⇒ pair … x2 true | xB ⇒ pair … x3 true
- | xC ⇒ pair … x4 true | xD ⇒ pair … x5 true | xE ⇒ pair … x6 true | xF ⇒ pair … x7 true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ pair … x9 false | x1 ⇒ pair … xA false | x2 ⇒ pair … xB false | x3 ⇒ pair … xC false
- | x4 ⇒ pair … xD false | x5 ⇒ pair … xE false | x6 ⇒ pair … xF false | x7 ⇒ pair … x0 true
- | x8 ⇒ pair … x1 true | x9 ⇒ pair … x2 true | xA ⇒ pair … x3 true | xB ⇒ pair … x4 true
- | xC ⇒ pair … x5 true | xD ⇒ pair … x6 true | xE ⇒ pair … x7 true | xF ⇒ pair … x8 true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ pair … xA false | x1 ⇒ pair … xB false | x2 ⇒ pair … xC false | x3 ⇒ pair … xD false
- | x4 ⇒ pair … xE false | x5 ⇒ pair … xF false | x6 ⇒ pair … x0 true | x7 ⇒ pair … x1 true
- | x8 ⇒ pair … x2 true | x9 ⇒ pair … x3 true | xA ⇒ pair … x4 true | xB ⇒ pair … x5 true
- | xC ⇒ pair … x6 true | xD ⇒ pair … x7 true | xE ⇒ pair … x8 true | xF ⇒ pair … x9 true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ pair … xB false | x1 ⇒ pair … xC false | x2 ⇒ pair … xD false | x3 ⇒ pair … xE false
- | x4 ⇒ pair … xF false | x5 ⇒ pair … x0 true | x6 ⇒ pair … x1 true | x7 ⇒ pair … x2 true
- | x8 ⇒ pair … x3 true | x9 ⇒ pair … x4 true | xA ⇒ pair … x5 true | xB ⇒ pair … x6 true
- | xC ⇒ pair … x7 true | xD ⇒ pair … x8 true | xE ⇒ pair … x9 true | xF ⇒ pair … xA true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ pair … xC false | x1 ⇒ pair … xD false | x2 ⇒ pair … xE false | x3 ⇒ pair … xF false
- | x4 ⇒ pair … x0 true | x5 ⇒ pair … x1 true | x6 ⇒ pair … x2 true | x7 ⇒ pair … x3 true
- | x8 ⇒ pair … x4 true | x9 ⇒ pair … x5 true | xA ⇒ pair … x6 true | xB ⇒ pair … x7 true
- | xC ⇒ pair … x8 true | xD ⇒ pair … x9 true | xE ⇒ pair … xA true | xF ⇒ pair … xB true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ pair … xD false | x1 ⇒ pair … xE false | x2 ⇒ pair … xF false | x3 ⇒ pair … x0 true
- | x4 ⇒ pair … x1 true | x5 ⇒ pair … x2 true | x6 ⇒ pair … x3 true | x7 ⇒ pair … x4 true
- | x8 ⇒ pair … x5 true | x9 ⇒ pair … x6 true | xA ⇒ pair … x7 true | xB ⇒ pair … x8 true
- | xC ⇒ pair … x9 true | xD ⇒ pair … xA true | xE ⇒ pair … xB true | xF ⇒ pair … xC true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ pair … xE false | x1 ⇒ pair … xF false | x2 ⇒ pair … x0 true | x3 ⇒ pair … x1 true
- | x4 ⇒ pair … x2 true | x5 ⇒ pair … x3 true | x6 ⇒ pair … x4 true | x7 ⇒ pair … x5 true
- | x8 ⇒ pair … x6 true | x9 ⇒ pair … x7 true | xA ⇒ pair … x8 true | xB ⇒ pair … x9 true
- | xC ⇒ pair … xA true | xD ⇒ pair … xB true | xE ⇒ pair … xC true | xF ⇒ pair … xD true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ pair … xF false | x1 ⇒ pair … x0 true | x2 ⇒ pair … x1 true | x3 ⇒ pair … x2 true
- | x4 ⇒ pair … x3 true | x5 ⇒ pair … x4 true | x6 ⇒ pair … x5 true | x7 ⇒ pair … x6 true
- | x8 ⇒ pair … x7 true | x9 ⇒ pair … x8 true | xA ⇒ pair … x9 true | xB ⇒ pair … xA true
- | xC ⇒ pair … xB true | xD ⇒ pair … xC true | xE ⇒ pair … xD true | xF ⇒ pair … xE true ]
- ].
-
-(* operatore somma con data+carry → data *)
-ndefinition plus_ex_dc_d ≝
-λe1,e2:exadecim.λc:bool.
- match c with
- [ true ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ x1 | x1 ⇒ x2 | x2 ⇒ x3 | x3 ⇒ x4 | x4 ⇒ x5 | x5 ⇒ x6 | x6 ⇒ x7 | x7 ⇒ x8
- | x8 ⇒ x9 | x9 ⇒ xA | xA ⇒ xB | xB ⇒ xC | xC ⇒ xD | xD ⇒ xE | xE ⇒ xF | xF ⇒ x0 ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x2 | x1 ⇒ x3 | x2 ⇒ x4 | x3 ⇒ x5 | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x8 | x7 ⇒ x9
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ xC | xB ⇒ xD | xC ⇒ xE | xD ⇒ xF | xE ⇒ x0 | xF ⇒ x1 ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x3 | x1 ⇒ x4 | x2 ⇒ x5 | x3 ⇒ x6 | x4 ⇒ x7 | x5 ⇒ x8 | x6 ⇒ x9 | x7 ⇒ xA
- | x8 ⇒ xB | x9 ⇒ xC | xA ⇒ xD | xB ⇒ xE | xC ⇒ xF | xD ⇒ x0 | xE ⇒ x1 | xF ⇒ x2 ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x4 | x1 ⇒ x5 | x2 ⇒ x6 | x3 ⇒ x7 | x4 ⇒ x8 | x5 ⇒ x9 | x6 ⇒ xA | x7 ⇒ xB
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x2 | xF ⇒ x3 ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x5 | x1 ⇒ x6 | x2 ⇒ x7 | x3 ⇒ x8 | x4 ⇒ x9 | x5 ⇒ xA | x6 ⇒ xB | x7 ⇒ xC
- | x8 ⇒ xD | x9 ⇒ xE | xA ⇒ xF | xB ⇒ x0 | xC ⇒ x1 | xD ⇒ x2 | xE ⇒ x3 | xF ⇒ x4 ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x6 | x1 ⇒ x7 | x2 ⇒ x8 | x3 ⇒ x9 | x4 ⇒ xA | x5 ⇒ xB | x6 ⇒ xC | x7 ⇒ xD
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ x0 | xB ⇒ x1 | xC ⇒ x2 | xD ⇒ x3 | xE ⇒ x4 | xF ⇒ x5 ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x7 | x1 ⇒ x8 | x2 ⇒ x9 | x3 ⇒ xA | x4 ⇒ xB | x5 ⇒ xC | x6 ⇒ xD | x7 ⇒ xE
- | x8 ⇒ xF | x9 ⇒ x0 | xA ⇒ x1 | xB ⇒ x2 | xC ⇒ x3 | xD ⇒ x4 | xE ⇒ x5 | xF ⇒ x6 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x8 | x1 ⇒ x9 | x2 ⇒ xA | x3 ⇒ xB | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3 | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x6 | xF ⇒ x7 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x9 | x1 ⇒ xA | x2 ⇒ xB | x3 ⇒ xC | x4 ⇒ xD | x5 ⇒ xE | x6 ⇒ xF | x7 ⇒ x0
- | x8 ⇒ x1 | x9 ⇒ x2 | xA ⇒ x3 | xB ⇒ x4 | xC ⇒ x5 | xD ⇒ x6 | xE ⇒ x7 | xF ⇒ x8 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ xA | x1 ⇒ xB | x2 ⇒ xC | x3 ⇒ xD | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ x2 | x9 ⇒ x3 | xA ⇒ x4 | xB ⇒ x5 | xC ⇒ x6 | xD ⇒ x7 | xE ⇒ x8 | xF ⇒ x9 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ xB | x1 ⇒ xC | x2 ⇒ xD | x3 ⇒ xE | x4 ⇒ xF | x5 ⇒ x0 | x6 ⇒ x1 | x7 ⇒ x2
- | x8 ⇒ x3 | x9 ⇒ x4 | xA ⇒ x5 | xB ⇒ x6 | xC ⇒ x7 | xD ⇒ x8 | xE ⇒ x9 | xF ⇒ xA ]
- | xB ⇒ match e2 with
- [ x0 ⇒ xC | x1 ⇒ xD | x2 ⇒ xE | x3 ⇒ xF | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ x4 | x9 ⇒ x5 | xA ⇒ x6 | xB ⇒ x7 | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ xA | xF ⇒ xB ]
- | xC ⇒ match e2 with
- [ x0 ⇒ xD | x1 ⇒ xE | x2 ⇒ xF | x3 ⇒ x0 | x4 ⇒ x1 | x5 ⇒ x2 | x6 ⇒ x3 | x7 ⇒ x4
- | x8 ⇒ x5 | x9 ⇒ x6 | xA ⇒ x7 | xB ⇒ x8 | xC ⇒ x9 | xD ⇒ xA | xE ⇒ xB | xF ⇒ xC ]
- | xD ⇒ match e2 with
- [ x0 ⇒ xE | x1 ⇒ xF | x2 ⇒ x0 | x3 ⇒ x1 | x4 ⇒ x2 | x5 ⇒ x3 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ x6 | x9 ⇒ x7 | xA ⇒ x8 | xB ⇒ x9 | xC ⇒ xA | xD ⇒ xB | xE ⇒ xC | xF ⇒ xD ]
- | xE ⇒ match e2 with
- [ x0 ⇒ xF | x1 ⇒ x0 | x2 ⇒ x1 | x3 ⇒ x2 | x4 ⇒ x3 | x5 ⇒ x4 | x6 ⇒ x5 | x7 ⇒ x6
- | x8 ⇒ x7 | x9 ⇒ x8 | xA ⇒ x9 | xB ⇒ xA | xC ⇒ xB | xD ⇒ xC | xE ⇒ xD | xF ⇒ xE ]
- | xF ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3 | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- ]
- | false ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3 | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x1 | x1 ⇒ x2 | x2 ⇒ x3 | x3 ⇒ x4 | x4 ⇒ x5 | x5 ⇒ x6 | x6 ⇒ x7 | x7 ⇒ x8
- | x8 ⇒ x9 | x9 ⇒ xA | xA ⇒ xB | xB ⇒ xC | xC ⇒ xD | xD ⇒ xE | xE ⇒ xF | xF ⇒ x0 ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x2 | x1 ⇒ x3 | x2 ⇒ x4 | x3 ⇒ x5 | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x8 | x7 ⇒ x9
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ xC | xB ⇒ xD | xC ⇒ xE | xD ⇒ xF | xE ⇒ x0 | xF ⇒ x1 ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x3 | x1 ⇒ x4 | x2 ⇒ x5 | x3 ⇒ x6 | x4 ⇒ x7 | x5 ⇒ x8 | x6 ⇒ x9 | x7 ⇒ xA
- | x8 ⇒ xB | x9 ⇒ xC | xA ⇒ xD | xB ⇒ xE | xC ⇒ xF | xD ⇒ x0 | xE ⇒ x1 | xF ⇒ x2 ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x4 | x1 ⇒ x5 | x2 ⇒ x6 | x3 ⇒ x7 | x4 ⇒ x8 | x5 ⇒ x9 | x6 ⇒ xA | x7 ⇒ xB
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x2 | xF ⇒ x3 ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x5 | x1 ⇒ x6 | x2 ⇒ x7 | x3 ⇒ x8 | x4 ⇒ x9 | x5 ⇒ xA | x6 ⇒ xB | x7 ⇒ xC
- | x8 ⇒ xD | x9 ⇒ xE | xA ⇒ xF | xB ⇒ x0 | xC ⇒ x1 | xD ⇒ x2 | xE ⇒ x3 | xF ⇒ x4 ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x6 | x1 ⇒ x7 | x2 ⇒ x8 | x3 ⇒ x9 | x4 ⇒ xA | x5 ⇒ xB | x6 ⇒ xC | x7 ⇒ xD
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ x0 | xB ⇒ x1 | xC ⇒ x2 | xD ⇒ x3 | xE ⇒ x4 | xF ⇒ x5 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x7 | x1 ⇒ x8 | x2 ⇒ x9 | x3 ⇒ xA | x4 ⇒ xB | x5 ⇒ xC | x6 ⇒ xD | x7 ⇒ xE
- | x8 ⇒ xF | x9 ⇒ x0 | xA ⇒ x1 | xB ⇒ x2 | xC ⇒ x3 | xD ⇒ x4 | xE ⇒ x5 | xF ⇒ x6 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x8 | x1 ⇒ x9 | x2 ⇒ xA | x3 ⇒ xB | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3 | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x6 | xF ⇒ x7 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ x9 | x1 ⇒ xA | x2 ⇒ xB | x3 ⇒ xC | x4 ⇒ xD | x5 ⇒ xE | x6 ⇒ xF | x7 ⇒ x0
- | x8 ⇒ x1 | x9 ⇒ x2 | xA ⇒ x3 | xB ⇒ x4 | xC ⇒ x5 | xD ⇒ x6 | xE ⇒ x7 | xF ⇒ x8 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ xA | x1 ⇒ xB | x2 ⇒ xC | x3 ⇒ xD | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ x2 | x9 ⇒ x3 | xA ⇒ x4 | xB ⇒ x5 | xC ⇒ x6 | xD ⇒ x7 | xE ⇒ x8 | xF ⇒ x9 ]
- | xB ⇒ match e2 with
- [ x0 ⇒ xB | x1 ⇒ xC | x2 ⇒ xD | x3 ⇒ xE | x4 ⇒ xF | x5 ⇒ x0 | x6 ⇒ x1 | x7 ⇒ x2
- | x8 ⇒ x3 | x9 ⇒ x4 | xA ⇒ x5 | xB ⇒ x6 | xC ⇒ x7 | xD ⇒ x8 | xE ⇒ x9 | xF ⇒ xA ]
- | xC ⇒ match e2 with
- [ x0 ⇒ xC | x1 ⇒ xD | x2 ⇒ xE | x3 ⇒ xF | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ x4 | x9 ⇒ x5 | xA ⇒ x6 | xB ⇒ x7 | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ xA | xF ⇒ xB ]
- | xD ⇒ match e2 with
- [ x0 ⇒ xD | x1 ⇒ xE | x2 ⇒ xF | x3 ⇒ x0 | x4 ⇒ x1 | x5 ⇒ x2 | x6 ⇒ x3 | x7 ⇒ x4
- | x8 ⇒ x5 | x9 ⇒ x6 | xA ⇒ x7 | xB ⇒ x8 | xC ⇒ x9 | xD ⇒ xA | xE ⇒ xB | xF ⇒ xC ]
- | xE ⇒ match e2 with
- [ x0 ⇒ xE | x1 ⇒ xF | x2 ⇒ x0 | x3 ⇒ x1 | x4 ⇒ x2 | x5 ⇒ x3 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ x6 | x9 ⇒ x7 | xA ⇒ x8 | xB ⇒ x9 | xC ⇒ xA | xD ⇒ xB | xE ⇒ xC | xF ⇒ xD ]
- | xF ⇒ match e2 with
- [ x0 ⇒ xF | x1 ⇒ x0 | x2 ⇒ x1 | x3 ⇒ x2 | x4 ⇒ x3 | x5 ⇒ x4 | x6 ⇒ x5 | x7 ⇒ x6
- | x8 ⇒ x7 | x9 ⇒ x8 | xA ⇒ x9 | xB ⇒ xA | xC ⇒ xB | xD ⇒ xC | xE ⇒ xD | xF ⇒ xE ]
- ]].
-
-(* operatore somma con data → data *)
-ndefinition plus_ex_d_d ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ x0 | x1 ⇒ x1 | x2 ⇒ x2 | x3 ⇒ x3 | x4 ⇒ x4 | x5 ⇒ x5 | x6 ⇒ x6 | x7 ⇒ x7
- | x8 ⇒ x8 | x9 ⇒ x9 | xA ⇒ xA | xB ⇒ xB | xC ⇒ xC | xD ⇒ xD | xE ⇒ xE | xF ⇒ xF ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ x1 | x1 ⇒ x2 | x2 ⇒ x3 | x3 ⇒ x4 | x4 ⇒ x5 | x5 ⇒ x6 | x6 ⇒ x7 | x7 ⇒ x8
- | x8 ⇒ x9 | x9 ⇒ xA | xA ⇒ xB | xB ⇒ xC | xC ⇒ xD | xD ⇒ xE | xE ⇒ xF | xF ⇒ x0 ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ x2 | x1 ⇒ x3 | x2 ⇒ x4 | x3 ⇒ x5 | x4 ⇒ x6 | x5 ⇒ x7 | x6 ⇒ x8 | x7 ⇒ x9
- | x8 ⇒ xA | x9 ⇒ xB | xA ⇒ xC | xB ⇒ xD | xC ⇒ xE | xD ⇒ xF | xE ⇒ x0 | xF ⇒ x1 ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ x3 | x1 ⇒ x4 | x2 ⇒ x5 | x3 ⇒ x6 | x4 ⇒ x7 | x5 ⇒ x8 | x6 ⇒ x9 | x7 ⇒ xA
- | x8 ⇒ xB | x9 ⇒ xC | xA ⇒ xD | xB ⇒ xE | xC ⇒ xF | xD ⇒ x0 | xE ⇒ x1 | xF ⇒ x2 ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ x4 | x1 ⇒ x5 | x2 ⇒ x6 | x3 ⇒ x7 | x4 ⇒ x8 | x5 ⇒ x9 | x6 ⇒ xA | x7 ⇒ xB
- | x8 ⇒ xC | x9 ⇒ xD | xA ⇒ xE | xB ⇒ xF | xC ⇒ x0 | xD ⇒ x1 | xE ⇒ x2 | xF ⇒ x3 ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ x5 | x1 ⇒ x6 | x2 ⇒ x7 | x3 ⇒ x8 | x4 ⇒ x9 | x5 ⇒ xA | x6 ⇒ xB | x7 ⇒ xC
- | x8 ⇒ xD | x9 ⇒ xE | xA ⇒ xF | xB ⇒ x0 | xC ⇒ x1 | xD ⇒ x2 | xE ⇒ x3 | xF ⇒ x4 ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ x6 | x1 ⇒ x7 | x2 ⇒ x8 | x3 ⇒ x9 | x4 ⇒ xA | x5 ⇒ xB | x6 ⇒ xC | x7 ⇒ xD
- | x8 ⇒ xE | x9 ⇒ xF | xA ⇒ x0 | xB ⇒ x1 | xC ⇒ x2 | xD ⇒ x3 | xE ⇒ x4 | xF ⇒ x5 ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ x7 | x1 ⇒ x8 | x2 ⇒ x9 | x3 ⇒ xA | x4 ⇒ xB | x5 ⇒ xC | x6 ⇒ xD | x7 ⇒ xE
- | x8 ⇒ xF | x9 ⇒ x0 | xA ⇒ x1 | xB ⇒ x2 | xC ⇒ x3 | xD ⇒ x4 | xE ⇒ x5 | xF ⇒ x6 ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ x8 | x1 ⇒ x9 | x2 ⇒ xA | x3 ⇒ xB | x4 ⇒ xC | x5 ⇒ xD | x6 ⇒ xE | x7 ⇒ xF
- | x8 ⇒ x0 | x9 ⇒ x1 | xA ⇒ x2 | xB ⇒ x3 | xC ⇒ x4 | xD ⇒ x5 | xE ⇒ x6 | xF ⇒ x7 ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ x9 | x1 ⇒ xA | x2 ⇒ xB | x3 ⇒ xC | x4 ⇒ xD | x5 ⇒ xE | x6 ⇒ xF | x7 ⇒ x0
- | x8 ⇒ x1 | x9 ⇒ x2 | xA ⇒ x3 | xB ⇒ x4 | xC ⇒ x5 | xD ⇒ x6 | xE ⇒ x7 | xF ⇒ x8 ]
- | xA ⇒ match e2 with
- [ x0 ⇒ xA | x1 ⇒ xB | x2 ⇒ xC | x3 ⇒ xD | x4 ⇒ xE | x5 ⇒ xF | x6 ⇒ x0 | x7 ⇒ x1
- | x8 ⇒ x2 | x9 ⇒ x3 | xA ⇒ x4 | xB ⇒ x5 | xC ⇒ x6 | xD ⇒ x7 | xE ⇒ x8 | xF ⇒ x9 ]
- | xB ⇒ match e2 with
- [ x0 ⇒ xB | x1 ⇒ xC | x2 ⇒ xD | x3 ⇒ xE | x4 ⇒ xF | x5 ⇒ x0 | x6 ⇒ x1 | x7 ⇒ x2
- | x8 ⇒ x3 | x9 ⇒ x4 | xA ⇒ x5 | xB ⇒ x6 | xC ⇒ x7 | xD ⇒ x8 | xE ⇒ x9 | xF ⇒ xA ]
- | xC ⇒ match e2 with
- [ x0 ⇒ xC | x1 ⇒ xD | x2 ⇒ xE | x3 ⇒ xF | x4 ⇒ x0 | x5 ⇒ x1 | x6 ⇒ x2 | x7 ⇒ x3
- | x8 ⇒ x4 | x9 ⇒ x5 | xA ⇒ x6 | xB ⇒ x7 | xC ⇒ x8 | xD ⇒ x9 | xE ⇒ xA | xF ⇒ xB ]
- | xD ⇒ match e2 with
- [ x0 ⇒ xD | x1 ⇒ xE | x2 ⇒ xF | x3 ⇒ x0 | x4 ⇒ x1 | x5 ⇒ x2 | x6 ⇒ x3 | x7 ⇒ x4
- | x8 ⇒ x5 | x9 ⇒ x6 | xA ⇒ x7 | xB ⇒ x8 | xC ⇒ x9 | xD ⇒ xA | xE ⇒ xB | xF ⇒ xC ]
- | xE ⇒ match e2 with
- [ x0 ⇒ xE | x1 ⇒ xF | x2 ⇒ x0 | x3 ⇒ x1 | x4 ⇒ x2 | x5 ⇒ x3 | x6 ⇒ x4 | x7 ⇒ x5
- | x8 ⇒ x6 | x9 ⇒ x7 | xA ⇒ x8 | xB ⇒ x9 | xC ⇒ xA | xD ⇒ xB | xE ⇒ xC | xF ⇒ xD ]
- | xF ⇒ match e2 with
- [ x0 ⇒ xF | x1 ⇒ x0 | x2 ⇒ x1 | x3 ⇒ x2 | x4 ⇒ x3 | x5 ⇒ x4 | x6 ⇒ x5 | x7 ⇒ x6
- | x8 ⇒ x7 | x9 ⇒ x8 | xA ⇒ x9 | xB ⇒ xA | xC ⇒ xB | xD ⇒ xC | xE ⇒ xD | xF ⇒ xE ]
- ].
-
-(* operatore somma con data+carry → carry *)
-ndefinition plus_ex_dc_c ≝
-λe1,e2:exadecim.λc:bool.
- match c with
- [ true ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ true ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ true | xF ⇒ true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ true | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- ]
- | false ⇒ match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ true | xF ⇒ true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- ]].
-
-(* operatore somma con data → carry *)
-ndefinition plus_ex_d_c ≝
-λe1,e2:exadecim.
- match e1 with
- [ x0 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ false ]
- | x1 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ false | xF ⇒ true ]
- | x2 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ false | xE ⇒ true | xF ⇒ true ]
- | x3 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ false | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x4 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ false | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x5 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ false | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x6 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ false | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x7 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ false | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x8 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | x9 ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xA ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ false | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xB ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ false | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xC ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xD ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xE ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- | xF ⇒ match e2 with
- [ x0 ⇒ false | x1 ⇒ true | x2 ⇒ true | x3 ⇒ true | x4 ⇒ true | x5 ⇒ true | x6 ⇒ true | x7 ⇒ true
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ]
- ].
-
-(* operatore Most Significant Bit *)
-ndefinition MSB_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ false | x1 ⇒ false | x2 ⇒ false | x3 ⇒ false
- | x4 ⇒ false | x5 ⇒ false | x6 ⇒ false | x7 ⇒ false
- | x8 ⇒ true | x9 ⇒ true | xA ⇒ true | xB ⇒ true
- | xC ⇒ true | xD ⇒ true | xE ⇒ true | xF ⇒ true ].
-
-(* operatore predecessore *)
-ndefinition pred_ex ≝
-λe:exadecim.
- match e with
- [ x0 ⇒ xF | x1 ⇒ x0 | x2 ⇒ x1 | x3 ⇒ x2 | x4 ⇒ x3 | x5 ⇒ x4 | x6 ⇒ x5 | x7 ⇒ x6
- | x8 ⇒ x7 | x9 ⇒ x8 | xA ⇒ x9 | xB ⇒ xA | xC ⇒ xB | xD ⇒ xC | xE ⇒ xD | xF ⇒ xE ].
-
-(* operatore successore *)
-ndefinition succ_ex ≝
-λe:exadecim.
- match e with
- [ x0 ⇒ x1 | x1 ⇒ x2 | x2 ⇒ x3 | x3 ⇒ x4 | x4 ⇒ x5 | x5 ⇒ x6 | x6 ⇒ x7 | x7 ⇒ x8
- | x8 ⇒ x9 | x9 ⇒ xA | xA ⇒ xB | xB ⇒ xC | xC ⇒ xD | xD ⇒ xE | xE ⇒ xF | xF ⇒ x0 ].
-
-(* operatore neg/complemento a 2 *)
-ndefinition compl_ex ≝
-λe:exadecim.match e with
- [ x0 ⇒ x0 | x1 ⇒ xF | x2 ⇒ xE | x3 ⇒ xD
- | x4 ⇒ xC | x5 ⇒ xB | x6 ⇒ xA | x7 ⇒ x9
- | x8 ⇒ x8 | x9 ⇒ x7 | xA ⇒ x6 | xB ⇒ x5
- | xC ⇒ x4 | xD ⇒ x3 | xE ⇒ x2 | xF ⇒ x1 ].
-
-(* iteratore sugli esadecimali *)
-ndefinition forall_ex ≝ λP.
- P x0 ⊗ P x1 ⊗ P x2 ⊗ P x3 ⊗ P x4 ⊗ P x5 ⊗ P x6 ⊗ P x7 ⊗
- P x8 ⊗ P x9 ⊗ P xA ⊗ P xB ⊗ P xC ⊗ P xD ⊗ P xE ⊗ P xF.
-
-(* esadecimali ricorsivi *)
-ninductive rec_exadecim : exadecim → Type ≝
- ex_O : rec_exadecim x0
-| ex_S : ∀n.rec_exadecim n → rec_exadecim (succ_ex n).
-
-(* esadecimali → esadecimali ricorsivi *)
-ndefinition ex_to_recex ≝
-λn.match n return λx.rec_exadecim x with
- [ x0 ⇒ ex_O
- | x1 ⇒ ex_S ? ex_O
- | x2 ⇒ ex_S ? (ex_S ? ex_O)
- | x3 ⇒ ex_S ? (ex_S ? (ex_S ? ex_O))
- | x4 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))
- | x5 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))
- | x6 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))))
- | x7 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))))
- | x8 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))))))
- | x9 ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))))))
- | xA ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))))))))
- | xB ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))))))))
- | xC ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))))))))))
- | xD ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))))))))))
- | xE ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O)))))))))))))
- | xF ⇒ ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? (ex_S ? ex_O))))))))))))))
- ].
-
-(* quaternari → esadecimali *)
-ndefinition ex_of_qu ≝
-λn.match n with
- [ q0 ⇒ x0 | q1 ⇒ x1 | q2 ⇒ x2 | q3 ⇒ x3 ].
-
-(* ottali → esadecimali *)
-ndefinition ex_of_oct ≝
-λn.match n with
- [ o0 ⇒ x0 | o1 ⇒ x1 | o2 ⇒ x2 | o3 ⇒ x3 | o4 ⇒ x4 | o5 ⇒ x5 | o6 ⇒ x6 | o7 ⇒ x7 ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/exadecim.ma".
-
-(* *********** *)
-(* ESADECIMALI *)
-(* *********** *)
-
-ndefinition exadecim_destruct1 : Πe2.ΠP:Prop.ΠH:x0 = e2.match e2 with [ x0 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##1: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x0 with [ x0 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct2 : Πe2.ΠP:Prop.ΠH:x1 = e2.match e2 with [ x1 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##2: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x1 with [ x1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct3 : Πe2.ΠP:Prop.ΠH:x2 = e2.match e2 with [ x2 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##3: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x2 with [ x2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct4 : Πe2.ΠP:Prop.ΠH:x3 = e2.match e2 with [ x3 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##4: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x3 with [ x3 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct5 : Πe2.ΠP:Prop.ΠH:x4 = e2.match e2 with [ x4 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##5: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x4 with [ x4 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct6 : Πe2.ΠP:Prop.ΠH:x5 = e2.match e2 with [ x5 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##6: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x5 with [ x5 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct7 : Πe2.ΠP:Prop.ΠH:x6 = e2.match e2 with [ x6 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##7: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x6 with [ x6 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct8 : Πe2.ΠP:Prop.ΠH:x7 = e2.match e2 with [ x7 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##8: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x7 with [ x7 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct9 : Πe2.ΠP:Prop.ΠH:x8 = e2.match e2 with [ x8 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##9: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x8 with [ x8 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct10 : Πe2.ΠP:Prop.ΠH:x9 = e2.match e2 with [ x9 ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##10: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match x9 with [ x9 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct11 : Πe2.ΠP:Prop.ΠH:xA = e2.match e2 with [ xA ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##11: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xA with [ xA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct12 : Πe2.ΠP:Prop.ΠH:xB = e2.match e2 with [ xB ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##12: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xB with [ xB ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct13 : Πe2.ΠP:Prop.ΠH:xC = e2.match e2 with [ xC ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##13: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xC with [ xC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct14 : Πe2.ΠP:Prop.ΠH:xD = e2.match e2 with [ xD ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##14: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xD with [ xD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct15 : Πe2.ΠP:Prop.ΠH:xE = e2.match e2 with [ xE ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##15: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xE with [ xE ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct16 : Πe2.ΠP:Prop.ΠH:xF = e2.match e2 with [ xF ⇒ P → P | _ ⇒ P ].
- #e2; #P; ncases e2; nnormalize; #H;
- ##[ ##16: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match xF with [ xF ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition exadecim_destruct_aux ≝
-Πe1,e2.ΠP:Prop.ΠH:e1 = e2.
- match e1 with
- [ x0 ⇒ match e2 with [ x0 ⇒ P → P | _ ⇒ P ]
- | x1 ⇒ match e2 with [ x1 ⇒ P → P | _ ⇒ P ]
- | x2 ⇒ match e2 with [ x2 ⇒ P → P | _ ⇒ P ]
- | x3 ⇒ match e2 with [ x3 ⇒ P → P | _ ⇒ P ]
- | x4 ⇒ match e2 with [ x4 ⇒ P → P | _ ⇒ P ]
- | x5 ⇒ match e2 with [ x5 ⇒ P → P | _ ⇒ P ]
- | x6 ⇒ match e2 with [ x6 ⇒ P → P | _ ⇒ P ]
- | x7 ⇒ match e2 with [ x7 ⇒ P → P | _ ⇒ P ]
- | x8 ⇒ match e2 with [ x8 ⇒ P → P | _ ⇒ P ]
- | x9 ⇒ match e2 with [ x9 ⇒ P → P | _ ⇒ P ]
- | xA ⇒ match e2 with [ xA ⇒ P → P | _ ⇒ P ]
- | xB ⇒ match e2 with [ xB ⇒ P → P | _ ⇒ P ]
- | xC ⇒ match e2 with [ xC ⇒ P → P | _ ⇒ P ]
- | xD ⇒ match e2 with [ xD ⇒ P → P | _ ⇒ P ]
- | xE ⇒ match e2 with [ xE ⇒ P → P | _ ⇒ P ]
- | xF ⇒ match e2 with [ xF ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition exadecim_destruct : exadecim_destruct_aux.
- #e1; ncases e1;
- ##[ ##1: napply exadecim_destruct1
- ##| ##2: napply exadecim_destruct2
- ##| ##3: napply exadecim_destruct3
- ##| ##4: napply exadecim_destruct4
- ##| ##5: napply exadecim_destruct5
- ##| ##6: napply exadecim_destruct6
- ##| ##7: napply exadecim_destruct7
- ##| ##8: napply exadecim_destruct8
- ##| ##9: napply exadecim_destruct9
- ##| ##10: napply exadecim_destruct10
- ##| ##11: napply exadecim_destruct11
- ##| ##12: napply exadecim_destruct12
- ##| ##13: napply exadecim_destruct13
- ##| ##14: napply exadecim_destruct14
- ##| ##15: napply exadecim_destruct15
- ##| ##16: napply exadecim_destruct16
- ##]
-nqed.
-
-nlemma symmetric_eqex : symmetricT exadecim bool eq_ex.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_andex : symmetricT exadecim exadecim and_ex.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_andex : ∀e1,e2,e3.(and_ex (and_ex e1 e2) e3) = (and_ex e1 (and_ex e2 e3)).
- #e1; #e2; #e3;
- nelim e1;
- ##[ ##1: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##2: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##3: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##4: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##5: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##6: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##7: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##8: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##9: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##10: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##11: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##12: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##13: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##14: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##15: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##16: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma symmetric_orex : symmetricT exadecim exadecim or_ex.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_orex : ∀e1,e2,e3.(or_ex (or_ex e1 e2) e3) = (or_ex e1 (or_ex e2 e3)).
- #e1; #e2; #e3;
- nelim e1;
- ##[ ##1: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##2: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##3: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##4: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##5: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##6: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##7: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##8: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##9: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##10: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##11: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##12: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##13: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##14: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##15: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##16: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma symmetric_xorex : symmetricT exadecim exadecim xor_ex.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_xorex : ∀e1,e2,e3.(xor_ex (xor_ex e1 e2) e3) = (xor_ex e1 (xor_ex e2 e3)).
- #e1; #e2; #e3;
- nelim e1;
- ##[ ##1: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##2: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##3: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##4: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##5: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##6: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##7: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##8: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##9: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##10: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##11: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##12: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##13: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##14: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##15: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##16: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma symmetric_plusex_dc_dc : ∀e1,e2,c.plus_ex_dc_dc e1 e2 c = plus_ex_dc_dc e2 e1 c.
- #e1; #e2; #c;
- nelim e1;
- nelim e2;
- nelim c;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_dc_dc_to_dc_d : ∀e1,e2,c.fst … (plus_ex_dc_dc e1 e2 c) = plus_ex_dc_d e1 e2 c.
- #e1; #e2; #c;
- nelim e1;
- nelim e2;
- nelim c;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_dc_dc_to_dc_c : ∀e1,e2,c.snd … (plus_ex_dc_dc e1 e2 c) = plus_ex_dc_c e1 e2 c.
- #e1; #e2; #c;
- nelim e1;
- nelim e2;
- nelim c;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_dc_dc_to_d_dc : ∀e1,e2.plus_ex_dc_dc e1 e2 false = plus_ex_d_dc e1 e2.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_dc_dc_to_d_d : ∀e1,e2.fst … (plus_ex_dc_dc e1 e2 false) = plus_ex_d_d e1 e2.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_dc_dc_to_d_c : ∀e1,e2.snd … (plus_ex_dc_dc e1 e2 false) = plus_ex_d_c e1 e2.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusex_dc_d : ∀e1,e2,c.plus_ex_dc_d e1 e2 c = plus_ex_dc_d e2 e1 c.
- #e1; #e2; #c;
- nelim e1;
- nelim e2;
- nelim c;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusex_dc_c : ∀e1,e2,c.plus_ex_dc_c e1 e2 c = plus_ex_dc_c e2 e1 c.
- #e1; #e2; #c;
- nelim e1;
- nelim e2;
- nelim c;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusex_d_dc : ∀e1,e2.plus_ex_d_dc e1 e2 = plus_ex_d_dc e2 e1.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_d_dc_to_d_d : ∀e1,e2.fst … (plus_ex_d_dc e1 e2) = plus_ex_d_d e1 e2.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma plusex_d_dc_to_d_c : ∀e1,e2.snd … (plus_ex_d_dc e1 e2) = plus_ex_d_c e1 e2.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusex_d_d : ∀e1,e2.plus_ex_d_d e1 e2 = plus_ex_d_d e2 e1.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma associative_plusex_d_d : ∀e1,e2,e3.(plus_ex_d_d (plus_ex_d_d e1 e2) e3) = (plus_ex_d_d e1 (plus_ex_d_d e2 e3)).
- #e1; #e2; #e3;
- nelim e1;
- ##[ ##1: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##2: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##3: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##4: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##5: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##6: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##7: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##8: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##9: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##10: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##11: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##12: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##13: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##14: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##15: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##| ##16: nelim e2; nelim e3; nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma symmetric_plusex_d_c : ∀e1,e2.plus_ex_d_c e1 e2 = plus_ex_d_c e2 e1.
- #e1; #e2;
- nelim e1;
- nelim e2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqex_to_eq : ∀e1,e2:exadecim.(eq_ex e1 e2 = true) → (e1 = e2).
- #e1; #e2;
- ncases e1;
- ncases e2;
- nnormalize;
- ##[ ##1,18,35,52,69,86,103,120,137,154,171,188,205,222,239,256: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqex : ∀e1,e2.e1 = e2 → eq_ex e1 e2 = true.
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,18,35,52,69,86,103,120,137,154,171,188,205,222,239,256: #H; napply refl_eq
- ##| ##*: #H; napply (exadecim_destruct … H)
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/model.ma".
-include "freescale/translation.ma".
-
-(* errori possibili nel fetch *)
-ninductive error_type : Type ≝
- ILL_OP: error_type
-| ILL_FETCH_AD: error_type
-| ILL_EX_AD: error_type.
-
-(* un tipo opzione ad hoc
- - errore: interessa solo l'errore
- - ok: interessa info e il nuovo pc
-*)
-ninductive fetch_result (A:Type) : Type ≝
- FetchERR : error_type → fetch_result A
-| FetchOK : A → word16 → fetch_result A.
-
-(* **************************** *)
-(* FETCH E ACCESSO ALLA MEMORIA *)
-(* **************************** *)
-
-(* ausialiaria per RS08 read *)
-(* come anticipato in status, nell'RS08 ci sono 2 registri importanti
- memory mapped, quindi bisona intercettare la lettura.
- NB: fare molta attenzione alle note sulle combinazioni possibili perche'
- il comportamento della memoria nell'RS08 e' strano e ci sono
- precise condizioni che impediscono una semantica circolare dell'accesso
- (divergenza=assenza di definizione) *)
-ndefinition RS08_memory_filter_read_aux ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.
-λT:Type.λfREG:byte8 → option T.λfMEM:aux_mem_type t → aux_chk_type t → word16 → option T.
-match s with
- [ mk_any_status alu mem chk _ ⇒ match alu with
- [ mk_alu_RS08 _ _ _ _ xm psm _ _ ⇒
-(*
- possibili accessi al registro X
- 1) addr=000F: diretto
- 2) addr=000E (X =0F): indiretto
- 3) addr=00CF (PS=00): paging
-
- [NB] altre combinazioni non funzionano perche' la MCU non e' un oggetto reattivo:
- non si possono combinare due effetti contemporaneamente!
- per esempio accesso addr=00CE (PS=00,X=0F) non puo' produrre 2 indirezioni
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x0,xF〉〉 ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 ⊗ eq_b8 xm 〈x0,xF〉) ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈xC,xF〉〉 ⊗ eq_b8 psm 〈x0,x0〉) with
- [ true ⇒ fREG xm
- | false ⇒
-(*
- possibili accessi al registro PS
- 1) addr=001F: diretto
- 2) addr=000E (X =1F): indiretto
- 3) addr=00DF (PS=00): paging
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x1,xF〉〉 ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 ⊗ eq_b8 xm 〈x1,xF〉) ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈xD,xF〉〉 ⊗ eq_b8 psm 〈x0,x0〉) with
- [ true ⇒ fREG psm
- | false ⇒
-(*
- accesso a D[X]: se accede a [00C0-00FF] e' la RAM fisica, non il paging
- altrimenti sarebbero 2 indirezioni
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 with
- [ true ⇒ fMEM mem chk 〈〈x0,x0〉:xm〉
- | false ⇒
-(*
- accesso al paging: [00pp pppp ppxx xxxx] con p=PS x=addr
-*)
- match in_range addr 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈xF,xF〉〉 with
- [ true ⇒ fMEM mem chk (or_w16 (fst … (shr_w16 (fst … (shr_w16 〈psm:〈x0,x0〉〉))))
- (and_w16 addr 〈〈x0,x0〉:〈x3,xF〉〉))
-(*
- accesso normale
-*)
- | false ⇒ fMEM mem chk addr ]]]]]].
-
-(* lettura RS08 di un byte *)
-ndefinition RS08_memory_filter_read ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.
- RS08_memory_filter_read_aux t s addr byte8
- (λb.Some byte8 b)
- (λm:aux_mem_type t.λc:aux_chk_type t.λa:word16.mem_read t m c a).
-
-(* lettura RS08 di un bit *)
-ndefinition RS08_memory_filter_read_bit ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.λsub:oct.
- RS08_memory_filter_read_aux t s addr bool
- (λb.Some bool (getn_array8T sub bool (bits_of_byte8 b)))
- (λm:aux_mem_type t.λc:aux_chk_type t.λa:word16.mem_read_bit t m c a sub).
-
-(* in caso di RS08 si dirotta sul filtro, altrimenti si legge direttamente *)
-ndefinition memory_filter_read ≝
-λm:mcu_type.λt:memory_impl.match m return λm:mcu_type.any_status m t → word16 → option byte8 with
- [ HC05 ⇒ λs:any_status HC05 t.λaddr:word16.
- mem_read t (mem_desc ? t s) (chk_desc ? t s) addr
- | HC08 ⇒ λs:any_status HC08 t.λaddr:word16.
- mem_read t (mem_desc ? t s) (chk_desc ? t s) addr
- | HCS08 ⇒ λs:any_status HCS08 t.λaddr:word16.
- mem_read t (mem_desc ? t s) (chk_desc ? t s) addr
- | RS08 ⇒ λs:any_status RS08 t.λaddr:word16.
- RS08_memory_filter_read t s addr
- ].
-
-ndefinition memory_filter_read_bit ≝
-λm:mcu_type.λt:memory_impl.match m return λm:mcu_type.any_status m t → word16 → oct → option bool with
- [ HC05 ⇒ λs:any_status HC05 t.λaddr:word16.λsub:oct.
- mem_read_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub
- | HC08 ⇒ λs:any_status HC08 t.λaddr:word16.λsub:oct.
- mem_read_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub
- | HCS08 ⇒ λs:any_status HCS08 t.λaddr:word16.λsub:oct.
- mem_read_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub
- | RS08 ⇒ λs:any_status RS08 t.λaddr:word16.λsub:oct.
- RS08_memory_filter_read_bit t s addr sub
- ].
-
-(* ausialiaria per RS08 write *)
-(* come anticipato in status, nell'RS08 ci sono 2 registri importanti
- memory mapped, quindi bisona intercettare la scrittura.
- NB: fare molta attenzione alle note sulle combinazioni possibili perche'
- il comportamento della memoria nell'RS08 e' strano e ci sono
- precise condizioni che impediscono una semantica circolare dell'accesso
- (divergenza=assenza di definizione) *)
-ndefinition RS08_memory_filter_write_aux ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.
-λfREG:byte8 → byte8.λfMEM:aux_mem_type t → aux_chk_type t → word16 → option (aux_mem_type t).
-match s with
- [ mk_any_status alu mem chk clk ⇒ match alu with
- [ mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl ⇒
-(*
- possibili accessi al registro X
- 1) addr=000F: diretto
- 2) addr=000E (X =0F): indiretto
- 3) addr=00CF (PS=00): paging
-
- [NB] altre combinazioni non funzionano perche' la MCU non e' un oggetto reattivo:
- non si possono combinare due effetti contemporaneamente!
- per esempio accesso addr=00CE (PS=00,X=0F) non puo' produrre 2 indirezioni
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x0,xF〉〉 ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 ⊗ eq_b8 xm 〈x0,xF〉) ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈xC,xF〉〉 ⊗ eq_b8 psm 〈x0,x0〉) with
- [ true ⇒ Some ? (mk_any_status RS08 t (mk_alu_RS08 acclow pc pcm spc (fREG xm) psm zfl cfl) mem chk clk)
- | false ⇒
-(*
- possibili accessi al registro PS
- 1) addr=001F: diretto
- 2) addr=000E (X =1F): indiretto
- 3) addr=00DF (PS=00): paging
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x1,xF〉〉 ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 ⊗ eq_b8 xm 〈x1,xF〉) ⊕
- (eq_w16 addr 〈〈x0,x0〉:〈xD,xF〉〉 ⊗ eq_b8 psm 〈x0,x0〉) with
- [ true ⇒ Some ? (mk_any_status RS08 t (mk_alu_RS08 acclow pc pcm spc xm (fREG psm) zfl cfl) mem chk clk)
- | false ⇒
-(*
- accesso a D[X]: se accede a [00C0-00FF] e' la RAM fisica, non il paging
- altrimenti sarebbero 2 indirezioni
-*)
- match eq_w16 addr 〈〈x0,x0〉:〈x0,xE〉〉 with
- [ true ⇒ opt_map … (fMEM mem chk 〈〈x0,x0〉:xm〉)
- (λmem'.Some ? (mk_any_status RS08 t (mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl) mem' chk clk))
-
- | false ⇒
-(*
- accesso al paging: [00pp pppp ppxx xxxx] con p=PS x=addr
-*)
- match in_range addr 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈xF,xF〉〉 with
- [ true ⇒ opt_map … (fMEM mem chk (or_w16 (fst … (shr_w16 (fst … (shr_w16 〈psm:〈x0,x0〉〉))))
- (and_w16 addr 〈〈x0,x0〉:〈x3,xF〉〉)))
- (λmem'.Some ? (mk_any_status RS08 t (mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl) mem' chk clk))
-(*
- accesso normale
-*)
- | false ⇒ opt_map … (fMEM mem chk addr)
- (λmem'.Some ? (mk_any_status RS08 t (mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl) mem' chk clk)) ]]]]]].
-
-(* scrittura RS08 di un byte *)
-ndefinition RS08_memory_filter_write ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.λval:byte8.
- RS08_memory_filter_write_aux t s addr
- (λb.val)
- (λm:aux_mem_type t.λc:aux_chk_type t.λa:word16.mem_update t m c a val).
-
-(* scrittura RS08 di un bit *)
-ndefinition RS08_memory_filter_write_bit ≝
-λt:memory_impl.λs:any_status RS08 t.λaddr:word16.λsub:oct.λval:bool.
- RS08_memory_filter_write_aux t s addr
- (λb.byte8_of_bits (setn_array8T sub bool (bits_of_byte8 b) val))
- (λm:aux_mem_type t.λc:aux_chk_type t.λa:word16.mem_update_bit t m c a sub val).
-
-(* in caso di RS08 si dirotta sul filtro, altrimenti si scrive direttamente *)
-ndefinition memory_filter_write ≝
-λm:mcu_type.λt:memory_impl.match m
- return λm:mcu_type.any_status m t → word16 → byte8 → option (any_status m t) with
- [ HC05 ⇒ λs:any_status HC05 t.λaddr:word16.λval:byte8.
- opt_map … (mem_update t (mem_desc ? t s) (chk_desc ? t s) addr val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | HC08 ⇒ λs:any_status HC08 t.λaddr:word16.λval:byte8.
- opt_map … (mem_update t (mem_desc ? t s) (chk_desc ? t s) addr val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | HCS08 ⇒ λs:any_status HCS08 t.λaddr:word16.λval:byte8.
- opt_map … (mem_update t (mem_desc ? t s) (chk_desc ? t s) addr val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | RS08 ⇒ λs:any_status RS08 t.λaddr:word16.λval:byte8.
- RS08_memory_filter_write t s addr val
- ].
-
-ndefinition memory_filter_write_bit ≝
-λm:mcu_type.λt:memory_impl.match m
- return λm:mcu_type.any_status m t → word16 → oct → bool → option (any_status m t) with
- [ HC05 ⇒ λs:any_status HC05 t.λaddr:word16.λsub:oct.λval:bool.
- opt_map … (mem_update_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | HC08 ⇒ λs:any_status HC08 t.λaddr:word16.λsub:oct.λval:bool.
- opt_map … (mem_update_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | HCS08 ⇒ λs:any_status HCS08 t.λaddr:word16.λsub:oct.λval:bool.
- opt_map … (mem_update_bit t (mem_desc ? t s) (chk_desc ? t s) addr sub val)
- (λmem.Some ? (set_mem_desc ? t s mem))
- | RS08 ⇒ λs:any_status RS08 t.λaddr:word16.λsub:oct.λval:bool.
- RS08_memory_filter_write_bit t s addr sub val
- ].
-
-(*
- Da utilizzarsi solo per gli aggiornamenti di PC (per il fetch),
- NON per il caricamento degli indiretti.
- - il caricamento degli immediati spetta al fetcher
- (incremento progressivo di PC ciclo per ciclo, e riempimento del prefetch
- che a questo punto DEVE poter indirizzare qualsiasi locazione puntata da PC)
- - il caricamento degli indiretti non spetta al fetcher
-*)
-ndefinition filtered_inc_w16 ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λw:word16.
- get_pc_reg m t (set_pc_reg m t s (succ_w16 w)).
-
-nlet rec filtered_plus_w16 (m:mcu_type) (t:memory_impl) (s:any_status m t) (w:word16) (n:nat) on n ≝
- match n with
- [ O ⇒ w
- | S n' ⇒ filtered_plus_w16 m t s (filtered_inc_w16 m t s w) n' ].
-
-(*
- errore1: non esiste traduzione ILL_OP
- errore2: non e' riuscito a leggere ILL_FETCH_AD
- altrimenti OK=info+new_pc
-*)
-ndefinition fetch ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- let pc ≝ get_pc_reg m t s in
- let pc_next1 ≝ filtered_inc_w16 m t s pc in
- let pc_next2 ≝ filtered_inc_w16 m t s pc_next1 in
- match memory_filter_read m t s pc with
- [ None ⇒ FetchERR ? ILL_FETCH_AD
- | Some bh ⇒ match full_info_of_word16 m (Byte bh) with
- (* non ha trovato una traduzione con 1 byte *)
- [ None ⇒ match m with
- (* HC05 non esistono op a 2 byte *)
- [ HC05 ⇒ FetchERR ? ILL_OP
- | HC08 ⇒ match eq_b8 bh 〈x9,xE〉 with
- (* HC08 se il primo byte e' 0x9E il secondo puo' avere senso *)
- [ true ⇒ match memory_filter_read m t s pc_next1 with
- [ None ⇒ FetchERR ? ILL_FETCH_AD | Some bl ⇒ match full_info_of_word16 m (Word (mk_word16 bh bl)) with
- [ None ⇒ FetchERR ? ILL_OP | Some info ⇒ FetchOK ? info pc_next2 ]]
- (* HC08 se il primo byte non e' 0x9E il secondo non puo' avere senso *)
- | false ⇒ FetchERR ? ILL_OP
- ]
- | HCS08 ⇒ match eq_b8 bh 〈x9,xE〉 with
- (* HCS08 se il primo byte e' 0x9E il secondo puo' avere senso *)
- [ true ⇒ match memory_filter_read m t s pc_next1 with
- [ None ⇒ FetchERR ? ILL_FETCH_AD | Some bl ⇒ match full_info_of_word16 m (Word (mk_word16 bh bl)) with
- [ None ⇒ FetchERR ? ILL_OP | Some info ⇒ FetchOK ? info pc_next2 ]]
- (* HCS08 se il primo byte non e' 0x9E il secondo non puo' avere senso *)
- | false ⇒ FetchERR ? ILL_OP
- ]
- (* RS08 non esistono op a 2 byte *)
- | RS08 ⇒ FetchERR ? ILL_OP
- ]
- (* ha trovato una traduzione con 1 byte *)
- | Some info ⇒ FetchOK ? info pc_next1 ]].
-
-(* ************************ *)
-(* MODALITA' INDIRIZZAMENTO *)
-(* ************************ *)
-
-(* mattoni base *)
-(* - incrementano l'indirizzo normalmente *)
-(* - incrementano PC attraverso il filtro *)
-
-(* lettura byte da addr *)
-ndefinition loadb_from ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λcur_pc:word16.λfetched:nat.
- opt_map … (memory_filter_read m t s addr)
- (λb.Some ? (triple … s b (filtered_plus_w16 m t s cur_pc fetched))).
-
-(* lettura bit da addr *)
-ndefinition loadbit_from ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λsub:oct.λcur_pc:word16.λfetched:nat.
- opt_map … (memory_filter_read_bit m t s addr sub)
- (λb.Some ? (triple … s b (filtered_plus_w16 m t s cur_pc fetched))).
-
-(* lettura word da addr *)
-ndefinition loadw_from ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λcur_pc:word16.λfetched:nat.
- opt_map … (memory_filter_read m t s addr)
- (λbh.opt_map … (memory_filter_read m t s (succ_w16 addr))
- (λbl.Some ? (triple … s (mk_word16 bh bl) (filtered_plus_w16 m t s cur_pc fetched)))).
-
-(* scrittura byte su addr *)
-ndefinition writeb_to ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λcur_pc:word16.λfetched:nat.λwriteb:byte8.
- opt_map … (memory_filter_write m t s addr writeb)
- (λtmps.Some ? (pair … tmps (filtered_plus_w16 m t s cur_pc fetched))).
-
-(* scrittura bit su addr *)
-ndefinition writebit_to ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λsub:oct.λcur_pc:word16.λfetched:nat.λwriteb:bool.
- opt_map … (memory_filter_write_bit m t s addr sub writeb)
- (λtmps.Some ? (pair … tmps (filtered_plus_w16 m t s cur_pc fetched))).
-
-(* scrittura word su addr *)
-ndefinition writew_to ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λaddr:word16.λcur_pc:word16.λfetched:nat.λwritew:word16.
- opt_map … (memory_filter_write m t s addr (w16h writew))
- (λtmps1.opt_map … (memory_filter_write m t tmps1 (succ_w16 addr) (w16l writew))
- (λtmps2.Some ? (pair … tmps2 (filtered_plus_w16 m t tmps2 cur_pc fetched)))).
-
-(* ausiliari per definire i tipi e la lettura/scrittura *)
-
-(* ausiliaria per definire il tipo di aux_load *)
-ndefinition aux_load_typing ≝
-λm:mcu_type.λt:memory_impl.λbyteflag:bool.
- any_status m t → word16 → word16 → nat →
- option (Prod3T (any_status m t) match byteflag with [ true ⇒ byte8 | false ⇒ word16 ] word16).
-
-(* per non dover ramificare i vari load in byte/word *)
-ndefinition aux_load ≝
-λm:mcu_type.λt:memory_impl.λbyteflag:bool.match byteflag return aux_load_typing m t with
- [ true ⇒ loadb_from m t | false ⇒ loadw_from m t ].
-
-(* ausiliaria per definire il tipo di aux_write *)
-ndefinition aux_write_typing ≝
-λm:mcu_type.λt:memory_impl.λbyteflag:bool.
- any_status m t → word16 → word16 → nat →
- match byteflag with [ true ⇒ byte8 | false ⇒ word16 ] →
- option (ProdT (any_status m t) word16).
-
-(* per non dover ramificare i vari load in byte/word *)
-ndefinition aux_write ≝
-λm:mcu_type.λt:memory_impl.λbyteflag:bool.match byteflag return aux_write_typing m t with
- [ true ⇒ writeb_to m t | false ⇒ writew_to m t ].
-
-(* modalita' vere e proprie *)
-
-(* lettura da [curpc]: IMM1 comportamento asimmetrico, quindi non si appoggia a loadb *)
-ndefinition mode_IMM1_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λb.Some ? (triple … s b (filtered_inc_w16 m t s cur_pc))).
-
-(* lettura da [curpc]: IMM1 + estensione a word *)
-ndefinition mode_IMM1EXT_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λb.Some ? (triple … s 〈〈x0,x0〉:b〉 (filtered_inc_w16 m t s cur_pc))).
-
-(* lettura da [curpc]: IMM2 comportamento asimmetrico, quindi non si appoggia a loadw *)
-ndefinition mode_IMM2_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λbh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λbl.Some ? (triple … s (mk_word16 bh bl) (filtered_plus_w16 m t s cur_pc 2)))).
-
-(* lettura da [byte [curpc]]: true=DIR1 loadb, false=DIR1 loadw *)
-ndefinition mode_DIR1_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddr.(aux_load m t byteflag) s 〈〈x0,x0〉:addr〉 cur_pc 1).
-
-(* lettura da [byte [curpc]]: loadbit *)
-ndefinition mode_DIR1n_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.λsub:oct.
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddr.loadbit_from m t s 〈〈x0,x0〉:addr〉 sub cur_pc 1).
-
-(* scrittura su [byte [curpc]]: true=DIR1 writeb, false=DIR1 writew *)
-ndefinition mode_DIR1_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddr.(aux_write m t byteflag) s 〈〈x0,x0〉:addr〉 cur_pc 1 writebw).
-
-(* scrittura su [byte [curpc]]: writebit *)
-ndefinition mode_DIR1n_write ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.λsub:oct.λwriteb:bool.
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddr.writebit_to m t s 〈〈x0,x0〉:addr〉 sub cur_pc 1 writeb).
-
-(* lettura da [word [curpc]]: true=DIR2 loadb, false=DIR2 loadw *)
-ndefinition mode_DIR2_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddrh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λaddrl.(aux_load m t byteflag) s 〈addrh:addrl〉 cur_pc 2)).
-
-(* scrittura su [word [curpc]]: true=DIR2 writeb, false=DIR2 writew *)
-ndefinition mode_DIR2_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (memory_filter_read m t s cur_pc)
- (λaddrh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λaddrl.(aux_write m t byteflag) s 〈addrh:addrl〉 cur_pc 2 writebw)).
-
-ndefinition get_IX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m with
- [ HC05 ⇒ opt_map … (get_indX_8_low_reg m t s) (λindx.Some ? 〈〈x0,x0〉:indx〉)
- | HC08 ⇒ opt_map … (get_indX_16_reg m t s) (λindx.Some ? indx)
- | HCS08 ⇒ opt_map … (get_indX_16_reg m t s) (λindx.Some ? indx)
- | RS08 ⇒ None ? ].
-
-(* lettura da [IX]: true=IX0 loadb, false=IX0 loadw *)
-ndefinition mode_IX0_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (get_IX m t s)
- (λaddr.(aux_load m t byteflag) s addr cur_pc 0).
-
-(* scrittura su [IX]: true=IX0 writeb, false=IX0 writew *)
-ndefinition mode_IX0_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (get_IX m t s)
- (λaddr.(aux_write m t byteflag) s addr cur_pc 0 writebw).
-
-(* lettura da [IX+byte [pc]]: true=IX1 loadb, false=IX1 loadw *)
-ndefinition mode_IX1_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (get_IX m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffs.(aux_load m t byteflag) s (plus_w16_d_d addr 〈〈x0,x0〉:offs〉) cur_pc 1)).
-
-(* lettura da X+[byte curpc] *)
-ndefinition mode_IX1ADD_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λb.opt_map … (get_IX m t s)
- (λaddr.Some ? (triple … s (plus_w16_d_d addr 〈〈x0,x0〉:b〉) (filtered_inc_w16 m t s cur_pc)))).
-
-(* scrittura su [IX+byte [pc]]: true=IX1 writeb, false=IX1 writew *)
-ndefinition mode_IX1_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (get_IX m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffs.(aux_write m t byteflag) s (plus_w16_d_d addr 〈〈x0,x0〉:offs〉) cur_pc 1 writebw)).
-
-(* lettura da [IX+word [pc]]: true=IX2 loadb, false=IX2 loadw *)
-ndefinition mode_IX2_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (get_IX m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffsh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λoffsl.(aux_load m t byteflag) s (plus_w16_d_d addr 〈offsh:offsl〉) cur_pc 2))).
-
-(* lettura da X+[word curpc] *)
-ndefinition mode_IX2ADD_load ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (memory_filter_read m t s cur_pc)
- (λbh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λbl.opt_map … (get_IX m t s)
- (λaddr.Some ? (triple … s (plus_w16_d_d addr 〈bh:bl〉) (filtered_plus_w16 m t s cur_pc 2))))).
-
-(* scrittura su [IX+word [pc]]: true=IX2 writeb, false=IX2 writew *)
-ndefinition mode_IX2_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (get_IX m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffsh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λoffsl.(aux_write m t byteflag) s (plus_w16_d_d addr 〈offsh:offsl〉) cur_pc 2 writebw))).
-
-(* lettura da [SP+byte [pc]]: true=SP1 loadb, false=SP1 loadw *)
-ndefinition mode_SP1_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (get_sp_reg m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffs.(aux_load m t byteflag) s (plus_w16_d_d addr 〈〈x0,x0〉:offs〉) cur_pc 1)).
-
-(* scrittura su [SP+byte [pc]]: true=SP1 writeb, false=SP1 writew *)
-ndefinition mode_SP1_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (get_sp_reg m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffs.(aux_write m t byteflag) s (plus_w16_d_d addr 〈〈x0,x0〉:offs〉) cur_pc 1 writebw)).
-
-(* lettura da [SP+word [pc]]: true=SP2 loadb, false=SP2 loadw *)
-ndefinition mode_SP2_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
- opt_map … (get_sp_reg m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffsh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λoffsl.(aux_load m t byteflag) s (plus_w16_d_d addr 〈offsh:offsl〉) cur_pc 2))).
-
-(* scrittura su [SP+word [pc]]: true=SP2 writeb, false=SP2 writew *)
-ndefinition mode_SP2_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.
-λwritebw:match byteflag with [ true ⇒ byte8 | false ⇒ word16 ].
- opt_map … (get_sp_reg m t s)
- (λaddr.opt_map … (memory_filter_read m t s cur_pc)
- (λoffsh.opt_map … (memory_filter_read m t s (filtered_inc_w16 m t s cur_pc))
- (λoffsl.(aux_write m t byteflag) s (plus_w16_d_d addr 〈offsh:offsl〉) cur_pc 2 writebw))).
-
-(* ************************************** *)
-(* raccordo di tutte le possibili letture *)
-(* ************************************** *)
-
-(* H:X++ *)
-ndefinition aux_inc_indX_16 ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- opt_map … (get_indX_16_reg m t s)
- (λX_op.opt_map … (set_indX_16_reg m t s (succ_w16 X_op))
- (λs_tmp.Some ? s_tmp)).
-
-(* tutte le modalita' di lettura: false=loadb true=loadw *)
-ndefinition multi_mode_load ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.
- match byteflag
- return λbyteflag:bool.any_status m t → word16 → instr_mode →
- option (Prod3T (any_status m t) match byteflag with [ true ⇒ byte8 | false ⇒ word16 ] word16)
- with
- (* lettura di un byte *)
- [ true ⇒ λs:any_status m t.λcur_pc:word16.λi:instr_mode.match i with
-(* NO: non ci sono indicazioni *)
- [ MODE_INH ⇒ None ?
-(* restituisce A *)
- | MODE_INHA ⇒ Some ? (triple … s (get_acc_8_low_reg m t s) cur_pc)
-(* restituisce X *)
- | MODE_INHX ⇒ opt_map … (get_indX_8_low_reg m t s)
- (λindx.Some ? (triple … s indx cur_pc))
-(* restituisce H *)
- | MODE_INHH ⇒ opt_map … (get_indX_8_high_reg m t s)
- (λindx.Some ? (triple … s indx cur_pc))
-
-(* NO: solo lettura word *)
- | MODE_INHX0ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX1ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX2ADD ⇒ None ?
-
-(* preleva 1 byte immediato *)
- | MODE_IMM1 ⇒ mode_IMM1_load m t s cur_pc
-(* NO: solo lettura word *)
- | MODE_IMM1EXT ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM2 ⇒ None ?
-(* preleva 1 byte da indirizzo diretto 1 byte *)
- | MODE_DIR1 ⇒ mode_DIR1_load true m t s cur_pc
-(* preleva 1 byte da indirizzo diretto 1 word *)
- | MODE_DIR2 ⇒ mode_DIR2_load true m t s cur_pc
-(* preleva 1 byte da H:X *)
- | MODE_IX0 ⇒ mode_IX0_load true m t s cur_pc
-(* preleva 1 byte da H:X+1 byte offset *)
- | MODE_IX1 ⇒ mode_IX1_load true m t s cur_pc
-(* preleva 1 byte da H:X+1 word offset *)
- | MODE_IX2 ⇒ mode_IX2_load true m t s cur_pc
-(* preleva 1 byte da SP+1 byte offset *)
- | MODE_SP1 ⇒ mode_SP1_load true m t s cur_pc
-(* preleva 1 byte da SP+1 word offset *)
- | MODE_SP2 ⇒ mode_SP2_load true m t s cur_pc
-
-(* come DIR1, chiamare scrittura per passo2: scrittura su DIR1 *)
- | MODE_DIR1_to_DIR1 ⇒ mode_DIR1_load true m t s cur_pc
-(* come IMM1, chiamare scrittura per passo2: scrittura su DIR1 *)
- | MODE_IMM1_to_DIR1 ⇒ mode_IMM1_load m t s cur_pc
-(* come IX0, chiamare scrittura per passo2: scrittura su DIR1 e X++ *)
- | MODE_IX0p_to_DIR1 ⇒ mode_IX0_load true m t s cur_pc
-(* come DIR1, chiamare scrittura per passo2: scrittura su IX0 e X++ *)
- | MODE_DIR1_to_IX0p ⇒ mode_DIR1_load true m t s cur_pc
-
-(* NO: solo lettura word/scrittura byte *)
- | MODE_INHA_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_INHX_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_DIR1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_IX0_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IX0p_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_IX1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IX1p_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_SP1_and_IMM1 ⇒ None ?
-
-(* NO: solo scrittura byte *)
- | MODE_DIRn _ ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_DIRn_and_IMM1 _ ⇒ None ?
-(* preleva 1 byte da 0000 0000 0000 xxxxb *)
- | MODE_TNY e ⇒ opt_map … (memory_filter_read m t s 〈〈x0,x0〉:〈x0,e〉〉)
- (λb.Some ? (triple … s b cur_pc))
-(* preleva 1 byte da 0000 0000 000x xxxxb *)
- | MODE_SRT e ⇒ opt_map … (memory_filter_read m t s 〈〈x0,x0〉:(byte8_of_bitrigesim e)〉)
- (λb.Some ? (triple … s b cur_pc))
- ]
-(* lettura di una word *)
- | false ⇒ λs:any_status m t.λcur_pc:word16.λi:instr_mode.match i with
-(* NO: non ci sono indicazioni *)
- [ MODE_INH ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHA ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHX ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHH ⇒ None ?
-
-(* preleva 1 word immediato *)
- | MODE_INHX0ADD ⇒ opt_map … (get_IX m t s)
- (λw.Some ? (triple … s w cur_pc))
-(* preleva 1 word immediato *)
- | MODE_INHX1ADD ⇒ mode_IX1ADD_load m t s cur_pc
-(* preleva 1 word immediato *)
- | MODE_INHX2ADD ⇒ mode_IX2ADD_load m t s cur_pc
-
-(* NO: solo lettura byte *)
- | MODE_IMM1 ⇒ None ?
-(* preleva 1 word immediato *)
- | MODE_IMM1EXT ⇒ mode_IMM1EXT_load m t s cur_pc
-(* preleva 1 word immediato *)
- | MODE_IMM2 ⇒ mode_IMM2_load m t s cur_pc
-(* preleva 1 word da indirizzo diretto 1 byte *)
- | MODE_DIR1 ⇒ mode_DIR1_load false m t s cur_pc
-(* preleva 1 word da indirizzo diretto 1 word *)
- | MODE_DIR2 ⇒ mode_DIR2_load false m t s cur_pc
-(* preleva 1 word da H:X *)
- | MODE_IX0 ⇒ mode_IX0_load false m t s cur_pc
-(* preleva 1 word da H:X+1 byte offset *)
- | MODE_IX1 ⇒ mode_IX1_load false m t s cur_pc
-(* preleva 1 word da H:X+1 word offset *)
- | MODE_IX2 ⇒ mode_IX2_load false m t s cur_pc
-(* preleva 1 word da SP+1 byte offset *)
- | MODE_SP1 ⇒ mode_SP1_load false m t s cur_pc
-(* preleva 1 word da SP+1 word offset *)
- | MODE_SP2 ⇒ mode_SP2_load false m t s cur_pc
-
-(* NO: solo lettura/scrittura byte *)
- | MODE_DIR1_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_IMM1_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_IX0p_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_DIR1_to_IX0p ⇒ None ?
-
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_INHA_and_IMM1 ⇒ opt_map … (mode_IMM1_load m t s cur_pc)
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc' ⇒
- Some ? (triple … s 〈(get_acc_8_low_reg m t s):immb〉 cur_pc')])
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_INHX_and_IMM1 ⇒ opt_map … (get_indX_8_low_reg m t s)
- (λX_op.opt_map … (mode_IMM1_load m t s cur_pc)
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc' ⇒
- Some ? (triple … s 〈X_op:immb〉 cur_pc')]))
-(* preleva 2 byte, NO possibilita' modificare Io argomento *)
- | MODE_IMM1_and_IMM1 ⇒ opt_map … (mode_IMM1_load m t s cur_pc)
- (λS_immb1_and_PC.match S_immb1_and_PC with
- [ triple _ immb1 cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb2_and_PC.match S_immb2_and_PC with
- [ triple _ immb2 cur_pc'' ⇒
- Some ? (triple … s 〈immb1:immb2〉 cur_pc'')])])
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_DIR1_and_IMM1 ⇒ opt_map … (mode_DIR1_load true m t s cur_pc)
- (λS_dirb_and_PC.match S_dirb_and_PC with
- [ triple _ dirb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- Some ? (triple … s 〈dirb:immb〉 cur_pc'')])])
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_IX0_and_IMM1 ⇒ opt_map … (mode_IX0_load true m t s cur_pc)
- (λS_ixb_and_PC.match S_ixb_and_PC with
- [ triple _ ixb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- Some ? (triple … s 〈ixb:immb〉 cur_pc'')])])
-(* preleva 2 byte, H:X++, NO possibilita' modificare Io argomento *)
- | MODE_IX0p_and_IMM1 ⇒ opt_map … (mode_IX0_load true m t s cur_pc)
- (λS_ixb_and_PC.match S_ixb_and_PC with
- [ triple _ ixb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- (* H:X++ *)
- opt_map … (aux_inc_indX_16 m t s)
- (λs'.Some ? (triple … s' 〈ixb:immb〉 cur_pc''))])])
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_IX1_and_IMM1 ⇒ opt_map … (mode_IX1_load true m t s cur_pc)
- (λS_ixb_and_PC.match S_ixb_and_PC with
- [ triple _ ixb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- Some ? (triple … s 〈ixb:immb〉 cur_pc'')])])
-(* preleva 2 byte, H:X++, NO possibilita' modificare Io argomento *)
- | MODE_IX1p_and_IMM1 ⇒ opt_map … (mode_IX1_load true m t s cur_pc)
- (λS_ixb_and_PC.match S_ixb_and_PC with
- [ triple _ ixb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- (* H:X++ *)
- opt_map … (aux_inc_indX_16 m t s)
- (λs'.Some ? (triple … s' 〈ixb:immb〉 cur_pc''))])])
-(* preleva 2 byte, possibilita' modificare Io argomento *)
- | MODE_SP1_and_IMM1 ⇒ opt_map … (mode_SP1_load true m t s cur_pc)
- (λS_spb_and_PC.match S_spb_and_PC with
- [ triple _ spb cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- Some ? (triple … s 〈spb:immb〉 cur_pc'')])])
-
-(* NO: solo scrittura byte *)
- | MODE_DIRn _ ⇒ None ?
-(* preleva 2 byte, il primo e' filtrato per azzerare tutti i bit tranne n-simo *)
- | MODE_DIRn_and_IMM1 msk ⇒ opt_map … (mode_DIR1n_load m t s cur_pc msk)
- (λS_dirbn_and_PC.match S_dirbn_and_PC with
- [ triple _ dirbn cur_pc' ⇒
- opt_map … (mode_IMM1_load m t s cur_pc')
- (λS_immb_and_PC.match S_immb_and_PC with
- [ triple _ immb cur_pc'' ⇒
- Some ? (triple … s 〈〈x0,match dirbn with [ true ⇒ x1 | false ⇒ x0 ]〉:immb〉 cur_pc'') ])])
-(* NO: solo lettura/scrittura byte *)
- | MODE_TNY _ ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_SRT _ ⇒ None ?
- ]
- ].
-
-(* **************************************** *)
-(* raccordo di tutte le possibili scritture *)
-(* **************************************** *)
-
-(* tutte le modalita' di scrittura: true=writeb, false=writew *)
-ndefinition multi_mode_write ≝
-λbyteflag:bool.λm:mcu_type.λt:memory_impl.match byteflag
- return λbyteflag:bool.any_status m t → word16 → instr_mode →
- match byteflag with [ true ⇒ byte8 | false ⇒ word16 ] →
- option (ProdT (any_status m t) word16) with
- (* scrittura di un byte *)
- [ true ⇒ λs:any_status m t.λcur_pc:word16.λi:instr_mode.λwriteb:byte8.match i with
-(* NO: non ci sono indicazioni *)
- [ MODE_INH ⇒ None ?
-(* scrive A *)
- | MODE_INHA ⇒ Some ? (pair … (set_acc_8_low_reg m t s writeb) cur_pc)
-(* scrive X *)
- | MODE_INHX ⇒ opt_map … (set_indX_8_low_reg m t s writeb)
- (λtmps.Some ? (pair … tmps cur_pc))
-(* scrive H *)
- | MODE_INHH ⇒ opt_map … (set_indX_8_high_reg m t s writeb)
- (λtmps.Some ? (pair … tmps cur_pc))
-
-(* NO: solo lettura word *)
- | MODE_INHX0ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX1ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX2ADD ⇒ None ?
-
-(* NO: solo lettura byte *)
- | MODE_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM1EXT ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM2 ⇒ None ?
-(* scrive 1 byte su indirizzo diretto 1 byte *)
- | MODE_DIR1 ⇒ mode_DIR1_write true m t s cur_pc writeb
-(* scrive 1 byte su indirizzo diretto 1 word *)
- | MODE_DIR2 ⇒ mode_DIR2_write true m t s cur_pc writeb
-(* scrive 1 byte su H:X *)
- | MODE_IX0 ⇒ mode_IX0_write true m t s cur_pc writeb
-(* scrive 1 byte su H:X+1 byte offset *)
- | MODE_IX1 ⇒ mode_IX1_write true m t s cur_pc writeb
-(* scrive 1 byte su H:X+1 word offset *)
- | MODE_IX2 ⇒ mode_IX2_write true m t s cur_pc writeb
-(* scrive 1 byte su SP+1 byte offset *)
- | MODE_SP1 ⇒ mode_SP1_write true m t s cur_pc writeb
-(* scrive 1 byte su SP+1 word offset *)
- | MODE_SP2 ⇒ mode_SP2_write true m t s cur_pc writeb
-
-(* passo2: scrittura su DIR1, passo1: lettura da DIR1 *)
- | MODE_DIR1_to_DIR1 ⇒ mode_DIR1_write true m t s cur_pc writeb
-(* passo2: scrittura su DIR1, passo1: lettura da IMM1 *)
- | MODE_IMM1_to_DIR1 ⇒ mode_DIR1_write true m t s cur_pc writeb
-(* passo2: scrittura su DIR1 e X++, passo1: lettura da IX0 *)
- | MODE_IX0p_to_DIR1 ⇒ opt_map … (mode_DIR1_write true m t s cur_pc writeb)
- (λS_and_PC.match S_and_PC with [ pair S_op PC_op ⇒
- (* H:X++ *)
- opt_map … (aux_inc_indX_16 m t S_op)
- (λS_op'.Some ? (pair … S_op' PC_op))])
-(* passo2: scrittura su IX0 e X++, passo1: lettura da DIR1 *)
- | MODE_DIR1_to_IX0p ⇒ opt_map … (mode_IX0_write true m t s cur_pc writeb)
- (λS_and_PC.match S_and_PC with [ pair S_op PC_op ⇒
- (* H:X++ *)
- opt_map … (aux_inc_indX_16 m t S_op)
- (λS_op'.Some ? (pair … S_op' PC_op))])
-
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = INHA *)
- | MODE_INHA_and_IMM1 ⇒ Some ? (pair … (set_acc_8_low_reg m t s writeb) cur_pc)
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = INHX *)
- | MODE_INHX_and_IMM1 ⇒ opt_map … (set_indX_8_low_reg m t s writeb)
- (λtmps.Some ? (pair … tmps cur_pc))
-(* NO: solo lettura word *)
- | MODE_IMM1_and_IMM1 ⇒ None ?
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = DIR1 *)
- | MODE_DIR1_and_IMM1 ⇒ mode_DIR1_write true m t s cur_pc writeb
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = IX0 *)
- | MODE_IX0_and_IMM1 ⇒ mode_IX0_write true m t s cur_pc writeb
-(* NO: solo lettura word *)
- | MODE_IX0p_and_IMM1 ⇒ None ?
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = IX1 *)
- | MODE_IX1_and_IMM1 ⇒ mode_IX1_write true m t s cur_pc writeb
-(* NO: solo lettura word *)
- | MODE_IX1p_and_IMM1 ⇒ None ?
-(* dopo aver prelevato 2 byte la possibilita' modificare Io argomento = SP1 *)
- | MODE_SP1_and_IMM1 ⇒ mode_SP1_write true m t s cur_pc writeb
-
-(* scrive 1 byte, ma la scrittura avviene solo per n-simo bit = leggi/modifica bit/scrivi *)
- | MODE_DIRn msk ⇒ mode_DIR1n_write m t s cur_pc msk (getn_array8T msk bool (bits_of_byte8 writeb))
-(* NO: solo lettura word *)
- | MODE_DIRn_and_IMM1 _ ⇒ None ?
-(* scrive 1 byte su 0000 0000 0000 xxxxb *)
- | MODE_TNY e ⇒ opt_map … (memory_filter_write m t s 〈〈x0,x0〉:〈x0,e〉〉 writeb)
- (λtmps.Some ? (pair … tmps cur_pc))
-(* scrive 1 byte su 0000 0000 000x xxxxb *)
- | MODE_SRT e ⇒ opt_map … (memory_filter_write m t s 〈〈x0,x0〉:(byte8_of_bitrigesim e)〉 writeb)
- (λtmps.Some ? (pair … tmps cur_pc)) ]
- (* scrittura di una word *)
- | false ⇒ λs:any_status m t.λcur_pc:word16.λi:instr_mode.λwritew:word16.match i with
-(* NO: non ci sono indicazioni *)
- [ MODE_INH ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHA ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHX ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_INHH ⇒ None ?
-
-(* NO: solo lettura word *)
- | MODE_INHX0ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX1ADD ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_INHX2ADD ⇒ None ?
-
-(* NO: solo lettura byte *)
- | MODE_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM1EXT ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM2 ⇒ None ?
-(* scrive 1 word su indirizzo diretto 1 byte *)
- | MODE_DIR1 ⇒ mode_DIR1_write false m t s cur_pc writew
-(* scrive 1 word su indirizzo diretto 1 word *)
- | MODE_DIR2 ⇒ mode_DIR2_write false m t s cur_pc writew
-(* scrive 1 word su H:X *)
- | MODE_IX0 ⇒ mode_IX0_write false m t s cur_pc writew
-(* scrive 1 word su H:X+1 byte offset *)
- | MODE_IX1 ⇒ mode_IX1_write false m t s cur_pc writew
-(* scrive 1 word su H:X+1 word offset *)
- | MODE_IX2 ⇒ mode_IX2_write false m t s cur_pc writew
-(* scrive 1 word su SP+1 byte offset *)
- | MODE_SP1 ⇒ mode_SP1_write false m t s cur_pc writew
-(* scrive 1 word su SP+1 word offset *)
- | MODE_SP2 ⇒ mode_SP2_write false m t s cur_pc writew
-
-(* NO: solo lettura/scrittura byte *)
- | MODE_DIR1_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_IMM1_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_IX0p_to_DIR1 ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_DIR1_to_IX0p ⇒ None ?
-
-(* NO: solo lettura word/scrittura byte *)
- | MODE_INHA_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_INHX_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IMM1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_DIR1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_IX0_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IX0p_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_IX1_and_IMM1 ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_IX1p_and_IMM1 ⇒ None ?
-(* NO: solo lettura word/scrittura byte *)
- | MODE_SP1_and_IMM1 ⇒ None ?
-
-(* NO: solo scrittura byte *)
- | MODE_DIRn _ ⇒ None ?
-(* NO: solo lettura word *)
- | MODE_DIRn_and_IMM1 _ ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_TNY _ ⇒ None ?
-(* NO: solo lettura/scrittura byte *)
- | MODE_SRT _ ⇒ None ?
- ]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/medium_tests_tools.ma".
-include "utility/utility.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*(nat_of_word16 (byte8_strlen string))+5*((nat_of_word16 (byte8_strlen 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 (nat_of_word16 (byte8_strlen 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*(nat_of_word16 (byte8_strlen string))+5*((nat_of_word16 (byte8_strlen 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*(nat_of_word16 (byte8_strlen string))+5*((nat_of_word16 (byte8_strlen 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 *)
- ((nat_of_word16 〈〈x6,x4〉:〈x6,x4〉〉)+(nat_of_byte8 〈x9,x6〉)*(nat_of_word16 (byte8_strlen 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))
- ((nat_of_word16 〈〈x6,x4〉:〈x6,x4〉〉)+(nat_of_byte8 〈x9,x6〉)*(nat_of_word16 (byte8_strlen 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_word16 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_word16 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〉〉.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/memory_func.ma".
-include "freescale/memory_trees.ma".
-include "freescale/memory_bits.ma".
-
-(* ********************************************* *)
-(* ASTRAZIONE DALL'IMPLEMENTAZIONE DELLA MEMORIA *)
-(* ********************************************* *)
-
-(* tipi di implementazione della memoria *)
-ninductive memory_impl : Type ≝
- MEM_FUNC: memory_impl
-| MEM_TREE: memory_impl
-| MEM_BITS: memory_impl.
-
-(* ausiliario per il tipo della memoria *)
-ndefinition aux_mem_type ≝
-λt:memory_impl.match t with
- [ MEM_FUNC ⇒ word16 → byte8
- | MEM_TREE ⇒ Array16T (Array16T (Array16T (Array16T byte8)))
- | MEM_BITS ⇒ Array16T (Array16T (Array16T (Array16T (Array8T bool))))
- ].
-
-(* ausiliario per il tipo del checker *)
-ndefinition aux_chk_type ≝
-λt:memory_impl.match t with
- [ MEM_FUNC ⇒ word16 → memory_type
- | MEM_TREE ⇒ Array16T (Array16T (Array16T (Array16T memory_type)))
- | MEM_BITS ⇒ Array16T (Array16T (Array16T (Array16T (Array8T memory_type))))
- ].
-
-(* unificazione di out_of_bound_memory *)
-ndefinition out_of_bound_memory ≝
-λt:memory_impl.
- match t
- return λt.aux_chk_type t
- with
- [ MEM_FUNC ⇒ mf_out_of_bound_memory
- | MEM_TREE ⇒ mt_out_of_bound_memory
- | MEM_BITS ⇒ mb_out_of_bound_memory
- ].
-
-(* unificazione di zero_memory *)
-ndefinition zero_memory ≝
-λt:memory_impl.
- match t
- return λt.aux_mem_type t
- with
- [ MEM_FUNC ⇒ mf_zero_memory
- | MEM_TREE ⇒ mt_zero_memory
- | MEM_BITS ⇒ mb_zero_memory
- ].
-
-(* unificazione della lettura senza chk: mem_read_abs mem addr *)
-ndefinition mem_read_abs ≝
-λt:memory_impl.
- match t
- return λt.aux_mem_type t → word16 → byte8
- with
- [ MEM_FUNC ⇒ λm:aux_mem_type MEM_FUNC.
- λaddr:word16.
- m addr
- | MEM_TREE ⇒ λm:aux_mem_type MEM_TREE.
- λaddr:word16.
- mt_visit byte8 m addr
- | MEM_BITS ⇒ λm:aux_mem_type MEM_BITS.
- λaddr:word16.
- byte8_of_bits (mt_visit (Array8T bool) m addr)
- ].
-
-(* unificazione del chk *)
-ndefinition chk_get ≝
-λt:memory_impl.λc:aux_chk_type t.λaddr:word16.
- match t
- return λt.aux_chk_type t → word16 → Array8T memory_type
- with
- [ MEM_FUNC ⇒ mf_chk_get
- | MEM_TREE ⇒ mt_chk_get
- | MEM_BITS ⇒ mb_chk_get
- ] c addr.
-
-(* unificazione della lettura con chk: mem_read mem chk addr *)
-ndefinition mem_read ≝
-λt:memory_impl.λm:aux_mem_type t.λc:aux_chk_type t.λaddr:word16.
- match t
- return λt.aux_mem_type t → aux_chk_type t → word16 → option byte8
- with
- [ MEM_FUNC ⇒ mf_mem_read
- | MEM_TREE ⇒ mt_mem_read
- | MEM_BITS ⇒ mb_mem_read
- ] m c addr.
-
-(* unificazione della lettura di bit con chk: mem_read mem chk addr sub *)
-ndefinition mem_read_bit ≝
-λt:memory_impl.
- match t
- return λt.aux_mem_type t → aux_chk_type t → word16 → oct → option bool
- with
- [ MEM_FUNC ⇒ λm:aux_mem_type MEM_FUNC.
- λc:aux_chk_type MEM_FUNC.
- λaddr:word16.
- λo:oct.
- opt_map … (mf_mem_read m c addr)
- (λb.Some ? (getn_array8T o bool (bits_of_byte8 b)))
- | MEM_TREE ⇒ λm:aux_mem_type MEM_TREE.
- λc:aux_chk_type MEM_TREE.
- λaddr:word16.
- λo:oct.
- opt_map … (mt_mem_read m c addr)
- (λb.Some ? (getn_array8T o bool (bits_of_byte8 b)))
- | MEM_BITS ⇒ λm:aux_mem_type MEM_BITS.
- λc:aux_chk_type MEM_BITS.
- λaddr:word16.
- λo:oct.
- mb_mem_read_bit m c addr o
- ].
-
-(* unificazione della scrittura con chk: mem_update mem chk addr val *)
-ndefinition mem_update ≝
-λt:memory_impl.λm:aux_mem_type t.λc:aux_chk_type t.λaddr:word16.λv:byte8.
- match t
- return λt.aux_mem_type t → Array8T memory_type → word16 → byte8 → option (aux_mem_type t)
- with
- [ MEM_FUNC ⇒ mf_mem_update
- | MEM_TREE ⇒ mt_mem_update
- | MEM_BITS ⇒ mb_mem_update
- ] m (chk_get t c addr) addr v.
-
-(* unificazione della scrittura di bit con chk: mem_update mem chk addr sub val *)
-ndefinition mem_update_bit ≝
-λt:memory_impl.
- match t
- return λt.aux_mem_type t → aux_chk_type t → word16 → oct → bool → option (aux_mem_type t)
- with
- [ MEM_FUNC ⇒ λm:aux_mem_type MEM_FUNC.
- λc:aux_chk_type MEM_FUNC.
- λaddr:word16.
- λo:oct.
- λv:bool.
- opt_map … (mf_mem_read m c addr)
- (λb.mf_mem_update m (chk_get MEM_FUNC c addr) addr (byte8_of_bits (setn_array8T o bool (bits_of_byte8 b) v)))
- | MEM_TREE ⇒ λm:aux_mem_type MEM_TREE.
- λc:aux_chk_type MEM_TREE.
- λaddr:word16.
- λo:oct.
- λv:bool.
- opt_map … (mt_mem_read m c addr)
- (λb.mt_mem_update m (chk_get MEM_TREE c addr) addr (byte8_of_bits (setn_array8T o bool (bits_of_byte8 b) v)))
- | MEM_BITS ⇒ λm:aux_mem_type MEM_BITS.
- λc:aux_chk_type MEM_BITS.
- λaddr:word16.
- λo:oct.
- λv:bool.
- mb_mem_update_bit m c addr o v
- ].
-
-(* unificazione del caricamento: load_from_source_at old_mem source addr *)
-ndefinition load_from_source_at ≝
-λt:memory_impl.λm:aux_mem_type t.λl:list byte8.λaddr:word16.
- match t
- return λt.aux_mem_type t → list byte8 → word16 → aux_mem_type t
- with
- [ MEM_FUNC ⇒ mf_load_from_source_at
- | MEM_TREE ⇒ mt_load_from_source_at
- | MEM_BITS ⇒ mb_load_from_source_at
- ] m l addr.
-
-(* unificazione dell'impostazione della memoria: chk_update_ranged chk inf sup v *)
-ndefinition check_update_ranged ≝
-λt:memory_impl.
- match t
- return λt.aux_chk_type t → word16 → word16 → memory_type → aux_chk_type t
- with
- [ MEM_FUNC ⇒ λc:aux_chk_type MEM_FUNC.
- λinf,sup:word16.
- λv:memory_type.
- mf_check_update_ranged c inf sup v
- | MEM_TREE ⇒ λc:aux_chk_type MEM_TREE.
- λinf,sup:word16.
- λv:memory_type.
- mt_update_ranged memory_type c inf sup v
- | MEM_BITS ⇒ λc:aux_chk_type MEM_BITS.
- λinf,sup:word16.
- λv:memory_type.
- mt_update_ranged (Array8T memory_type) c inf sup (array_8T memory_type v v v v v v v v)
- ].
-
-(* unificazione dell'impostazione dei bit: chk_update_bit chk addr sub v *)
-(* NB: dove non esiste la granularita' del bit, lascio inalterato *)
-ndefinition check_update_bit ≝
-λt:memory_impl.
- match t
- return λt.aux_chk_type t → word16 → oct → memory_type → aux_chk_type t
- with
- [ MEM_FUNC ⇒ λc:aux_chk_type MEM_FUNC.
- λaddr:word16.
- λo:oct.
- λv:memory_type.
- c
- | MEM_TREE ⇒ λc:aux_chk_type MEM_TREE.
- λaddr:word16.
- λo:oct.
- λv:memory_type.
- c
- | MEM_BITS ⇒ λc:aux_chk_type MEM_BITS.
- λaddr:word16.
- λo:oct.
- λv:memory_type.
- mb_chk_update_bit c addr o v
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/memory_trees.ma".
-
-(* ********************* *)
-(* MEMORIA E DESCRITTORE *)
-(* ********************* *)
-
-(* tutta la memoria non installata *)
-ndefinition mb_out_of_bound_memory ≝
-let base ≝ array_8T memory_type MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND in
-let lev4 ≝ array_16T ?
- base base base base base base base base
- base base base base base base base base
- in
-let lev3 ≝ array_16T ?
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- in
-let lev2 ≝ array_16T ?
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- in
-let lev1 ≝ array_16T ?
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- in
-lev1.
-
-(* tutta la memoria a 0 *)
-ndefinition mb_zero_memory ≝
-let base ≝ array_8T bool false false false false false false false false in
-let lev4 ≝ array_16T ?
- base base base base base base base base
- base base base base base base base base
- in
-let lev3 ≝ array_16T ?
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- in
-let lev2 ≝ array_16T ?
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- in
-let lev1 ≝ array_16T ?
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- in
-lev1.
-
-(* scrivi bit controllando il tipo di memoria *)
-ndefinition mb_mem_update_bit ≝
-λmem:Array16T (Array16T (Array16T (Array16T (Array8T bool)))).
-λchk:Array16T (Array16T (Array16T (Array16T (Array8T memory_type)))).
-λaddr:word16.λsub:oct.λv:bool.
- match getn_array8T sub memory_type (mt_visit (Array8T memory_type) chk addr) with
- (* ROM? ok, ma il valore viene perso *)
- [ MEM_READ_ONLY ⇒ Some ? mem
- (* RAM? ok *)
- | MEM_READ_WRITE ⇒ Some ? (mt_update (Array8T bool) mem addr (setn_array8T sub bool (mt_visit (Array8T bool) mem addr) v))
- (* NON INSTALLATA? no *)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-(* scrivi tipo di bit *)
-ndefinition mb_chk_update_bit ≝
-λchk:Array16T (Array16T (Array16T (Array16T (Array8T memory_type)))).
-λaddr:word16.λsub:oct.λv:memory_type.
- mt_update (Array8T memory_type) chk addr (setn_array8T sub memory_type (mt_visit (Array8T memory_type) chk addr) v).
-
-(* leggi bit controllando il tipo di memoria *)
-ndefinition mb_mem_read_bit ≝
-λmem:Array16T (Array16T (Array16T (Array16T (Array8T bool)))).
-λchk:Array16T (Array16T (Array16T (Array16T (Array8T memory_type)))).
-λaddr:word16.λsub:oct.
- match getn_array8T sub memory_type (mt_visit (Array8T memory_type) chk addr) with
- (* ROM? ok, ma il valore viene perso *)
- [ MEM_READ_ONLY ⇒ Some ? (getn_array8T sub bool (mt_visit (Array8T bool) mem addr))
- (* RAM? ok *)
- | MEM_READ_WRITE ⇒ Some ? (getn_array8T sub bool (mt_visit (Array8T bool) mem addr))
- (* NON INSTALLATA? no *)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-ndefinition mb_chk_get ≝
-λchk:Array16T (Array16T (Array16T (Array16T (Array8T memory_type)))).λaddr:word16.
-let c ≝ mt_visit (Array8T memory_type) chk addr in
-array_8T ? (getn_array8T o7 ? c) (getn_array8T o6 ? c)
- (getn_array8T o5 ? c) (getn_array8T o4 ? c)
- (getn_array8T o3 ? c) (getn_array8T o2 ? c)
- (getn_array8T o1 ? c) (getn_array8T o0 ? c).
-
-(* scrivi controllando il tipo di memoria *)
-(* NB: devono esistere tutti i bit *)
-ndefinition mb_mem_update ≝
-λmem:Array16T (Array16T (Array16T (Array16T (Array8T bool)))).
-λchk:Array8T memory_type.
-λaddr:word16.λv:byte8.
-let old_value ≝ mt_visit (Array8T bool) mem addr in
-let new_value ≝ bits_of_byte8 v in
-let newbit0 ≝ match getn_array8T o0 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o0 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o0 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit1 ≝ match getn_array8T o1 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o1 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o1 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit2 ≝ match getn_array8T o2 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o2 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o2 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit3 ≝ match getn_array8T o3 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o3 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o3 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit4 ≝ match getn_array8T o4 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o4 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o4 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit5 ≝ match getn_array8T o5 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o5 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o5 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit6 ≝ match getn_array8T o6 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o6 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o6 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit7 ≝ match getn_array8T o7 memory_type chk with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o7 bool old_value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o7 bool new_value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
- opt_map … newbit0
- (λnb0.opt_map … newbit1
- (λnb1.opt_map … newbit2
- (λnb2.opt_map … newbit3
- (λnb3.opt_map … newbit4
- (λnb4.opt_map … newbit5
- (λnb5.opt_map … newbit6
- (λnb6.opt_map … newbit7
- (λnb7.Some ? (mt_update (Array8T bool) mem addr (array_8T bool nb7 nb6 nb5 nb4 nb3 nb2 nb1 nb0)))))))))).
-
-(* leggi controllando il tipo di memoria *)
-(* NB: devono esistere tutti i bit *)
-ndefinition mb_mem_read ≝
-λmem:Array16T (Array16T (Array16T (Array16T (Array8T bool)))).
-λchk:Array16T (Array16T (Array16T (Array16T (Array8T memory_type)))).
-λaddr:word16.
-let bit_types ≝ mt_visit (Array8T memory_type) chk addr in
-let value ≝ mt_visit (Array8T bool) mem addr in
-let newbit0 ≝ match getn_array8T o0 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o0 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o0 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit1 ≝ match getn_array8T o1 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o1 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o1 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit2 ≝ match getn_array8T o2 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o2 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o2 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit3 ≝ match getn_array8T o3 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o3 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o3 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit4 ≝ match getn_array8T o4 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o4 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o4 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit5 ≝ match getn_array8T o5 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o5 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o5 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit6 ≝ match getn_array8T o6 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o6 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o6 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
-let newbit7 ≝ match getn_array8T o7 memory_type bit_types with
- [ MEM_READ_ONLY ⇒ Some bool (getn_array8T o7 bool value)
- | MEM_READ_WRITE ⇒ Some bool (getn_array8T o7 bool value)
- | MEM_OUT_OF_BOUND ⇒ None bool ] in
- opt_map … newbit0
- (λnb0.opt_map … newbit1
- (λnb1.opt_map … newbit2
- (λnb2.opt_map … newbit3
- (λnb3.opt_map … newbit4
- (λnb4.opt_map … newbit5
- (λnb5.opt_map … newbit6
- (λnb6.opt_map … newbit7
- (λnb7.Some ? (byte8_of_bits (array_8T bool nb7 nb6 nb5 nb4 nb3 nb2 nb1 nb0)))))))))).
-
-(* ************************** *)
-(* CARICAMENTO PROGRAMMA/DATI *)
-(* ************************** *)
-
-(* carica a paratire da addr, scartando source (pescando da old_mem) se si supera 0xFFFF... *)
-nlet rec mb_load_from_source_at (old_mem:Array16T (Array16T (Array16T (Array16T (Array8T bool)))))
- (source:list byte8) (addr:word16) on source ≝
-match source with
- (* fine di source: carica da old_mem *)
- [ nil ⇒ old_mem
- | cons hd tl ⇒ match lt_w16 addr 〈〈xF,xF〉:〈xF,xF〉〉 with
- (* non supera 0xFFFF, ricorsione *)
- [ true ⇒ mb_load_from_source_at (mt_update ? old_mem addr (bits_of_byte8 hd)) tl (plus_w16_d_d addr 〈〈x0,x0〉:〈x0,x1〉〉)
- (* supera 0xFFFF, niente ricorsione *)
- | false ⇒ mt_update ? old_mem addr (bits_of_byte8 hd)
- ]].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/memory_struct.ma".
-include "freescale/word16.ma".
-include "freescale/option.ma".
-include "freescale/theory.ma".
-
-(* ********************* *)
-(* MEMORIA E DESCRITTORE *)
-(* ********************* *)
-
-(* (mf_check_update_ranged chk inf sup mode) = setta tipo memoria *)
-ndefinition mf_check_update_ranged ≝
-λf:word16 → memory_type.λi.λs.λv.
- λx.match in_range x i s with
- [ true ⇒ v
- | false ⇒ f x ].
-
-(* tutta la memoria non installata *)
-ndefinition mf_out_of_bound_memory ≝ λ_:word16.MEM_OUT_OF_BOUND.
-
-ndefinition mf_chk_get ≝
-λc:word16 → memory_type.λa:word16.
- match c a with
- [ MEM_READ_ONLY ⇒ array_8T ? MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY
- | MEM_READ_WRITE ⇒ array_8T ? MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE
- | MEM_OUT_OF_BOUND ⇒ array_8T ? MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- ].
-
-(* (mf_mem_update mem checked addr val) = scrivi controllando il tipo di memoria *)
-ndefinition mf_mem_update ≝
-λf:word16 → byte8.λc:Array8T memory_type.λa:word16.λv:byte8.
- match getn_array8T o0 ? c with
- (* ROM? ok, ma il valore viene perso *)
- [ MEM_READ_ONLY ⇒ Some ? f
- (* RAM? ok *)
- | MEM_READ_WRITE ⇒ Some ? (λx.match eq_w16 x a with [ true ⇒ v | false ⇒ f x ])
- (* NON INSTALLATA? no *)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-(* tutta la memoria a 0 *)
-ndefinition mf_zero_memory ≝ λ_:word16.〈x0,x0〉.
-
-(* (mf_mem_read mem check addr) = leggi controllando il tipo di memoria *)
-ndefinition mf_mem_read ≝
-λf:word16 → byte8.λc:word16 → memory_type.λa.
- match c a with
- [ MEM_READ_ONLY ⇒ Some ? (f a)
- | MEM_READ_WRITE ⇒ Some ? (f a)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-(* ************************** *)
-(* CARICAMENTO PROGRAMMA/DATI *)
-(* ************************** *)
-
-(* carica a paratire da addr, scartando source (pescando da old_mem) se si supera 0xFFFF... *)
-nlet rec mf_load_from_source_at (old_mem:word16 → byte8) (source:list byte8) (addr:word16) on source ≝
-match source with
- (* fine di source: carica da old_mem *)
- [ nil ⇒ old_mem
- | cons hd tl ⇒ λx:word16.match lt_w16 x addr with
- (* e' prima di source: carica da old_mem *)
- [ true ⇒ old_mem x
- | false ⇒ match eq_w16 x addr with
- (* la locazione corrisponde al punto corrente di source *)
- [ true ⇒ hd
- (* la locazione e' piu' avanti: ricorsione *)
- | false ⇒ (mf_load_from_source_at old_mem tl (plus_w16_d_d addr 〈〈x0,x0〉:〈x0,x1〉〉)) x
- ]
- ]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/oct.ma".
-include "freescale/byte8.ma".
-
-(* **************************** *)
-(* TIPI PER I MODULI DI MEMORIA *)
-(* **************************** *)
-
-(* tipi di memoria:RAM/ROM/non installata *)
-ninductive memory_type : Type ≝
- MEM_READ_ONLY: memory_type
-| MEM_READ_WRITE: memory_type
-| MEM_OUT_OF_BOUND: memory_type.
-
-(* **************** *)
-(* TIPO ARRAY DA 16 *)
-(* **************** *)
-
-(* definizione di un array omogeneo di dimensione 16 *)
-ninductive Array16T (T:Type) : Type ≝
-array_16T : T → T → T → T → T → T → T → T →
- T → T → T → T → T → T → T → T →
- Array16T T.
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un getter a matrice sull'array *)
-ndefinition getn_array16T ≝
-λn:exadecim.λT:Type.λp:Array16T T.
- match p with
- [ array_16T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15 ⇒
- match n with
- [ x0 ⇒ e00 | x1 ⇒ e01 | x2 ⇒ e02 | x3 ⇒ e03 | x4 ⇒ e04 | x5 ⇒ e05 | x6 ⇒ e06 | x7 ⇒ e07
- | x8 ⇒ e08 | x9 ⇒ e09 | xA ⇒ e10 | xB ⇒ e11 | xC ⇒ e12 | xD ⇒ e13 | xE ⇒ e14 | xF ⇒ e15
- ]].
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un setter a matrice sull'array *)
-ndefinition setn_array16T ≝
-λn:exadecim.λT:Type.λp:Array16T T.λv:T.
- match p with
- [ array_16T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15 ⇒
- match n with
- [ x0 ⇒ array_16T T v e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x1 ⇒ array_16T T e00 v e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x2 ⇒ array_16T T e00 e01 v e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x3 ⇒ array_16T T e00 e01 e02 v e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x4 ⇒ array_16T T e00 e01 e02 e03 v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T e00 e01 e02 e03 e04 v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 e01 e02 e03 e04 e05 v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 v
- ]].
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un setter multiplo [m,n] a matrice sull'array *)
-ndefinition setmn_array16T ≝
-λm,n:exadecim.λT:Type.λp:Array16T T.λv:T.
- match p with
- [ array_16T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15 ⇒
- match m with
- [ x0 ⇒ match n with
- [ x0 ⇒ array_16T T v e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x1 ⇒ array_16T T v v e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x2 ⇒ array_16T T v v v e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x3 ⇒ array_16T T v v v v e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x4 ⇒ array_16T T v v v v v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T v v v v v v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T v v v v v v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T v v v v v v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T v v v v v v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T v v v v v v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T v v v v v v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T v v v v v v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T v v v v v v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T v v v v v v v v v v v v v v e14 e15
- | xE ⇒ array_16T T v v v v v v v v v v v v v v v e15
- | xF ⇒ array_16T T v v v v v v v v v v v v v v v v ]
- | x1 ⇒ match n with
- [ x0 ⇒ p
- | x1 ⇒ array_16T T e00 v e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x2 ⇒ array_16T T e00 v v e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x3 ⇒ array_16T T e00 v v v e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x4 ⇒ array_16T T e00 v v v v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T e00 v v v v v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 v v v v v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 v v v v v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 v v v v v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 v v v v v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 v v v v v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 v v v v v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 v v v v v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 v v v v v v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 v v v v v v v v v v v v v v e15
- | xF ⇒ array_16T T e00 v v v v v v v v v v v v v v v ]
- | x2 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p
- | x2 ⇒ array_16T T e00 e01 v e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x3 ⇒ array_16T T e00 e01 v v e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x4 ⇒ array_16T T e00 e01 v v v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T e00 e01 v v v v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 e01 v v v v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 v v v v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 v v v v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 v v v v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 v v v v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 v v v v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 v v v v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 v v v v v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 v v v v v v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 v v v v v v v v v v v v v v ]
- | x3 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p
- | x3 ⇒ array_16T T e00 e01 e02 v e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x4 ⇒ array_16T T e00 e01 e02 v v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T e00 e01 e02 v v v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 e01 e02 v v v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 e02 v v v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 v v v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 v v v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 v v v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 v v v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 v v v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 v v v v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 v v v v v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 v v v v v v v v v v v v v ]
- | x4 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p
- | x4 ⇒ array_16T T e00 e01 e02 e03 v e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x5 ⇒ array_16T T e00 e01 e02 e03 v v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 e01 e02 e03 v v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 e02 e03 v v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 e03 v v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 v v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 v v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 v v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 v v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 v v v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 v v v v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 v v v v v v v v v v v v ]
- | x5 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p
- | x5 ⇒ array_16T T e00 e01 e02 e03 e04 v e06 e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x6 ⇒ array_16T T e00 e01 e02 e03 e04 v v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 e02 e03 e04 v v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 e03 e04 v v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 v v v v v v v v v v v ]
- | x6 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p
- | x6 ⇒ array_16T T e00 e01 e02 e03 e04 e05 v e07 e08 e09 e10 e11 e12 e13 e14 e15
- | x7 ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 v v v v v v v v v v ]
- | x7 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p
- | x7 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v e08 e09 e10 e11 e12 e13 e14 e15
- | x8 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 v v v v v v v v v ]
- | x8 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v e09 e10 e11 e12 e13 e14 e15
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 v v v v v v v v ]
- | x9 ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p
- | x9 ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v e10 e11 e12 e13 e14 e15
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 v v v v v v v ]
- | xA ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p
- | xA ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v e11 e12 e13 e14 e15
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 v v v v v v ]
- | xB ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p | xA ⇒ p
- | xB ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v e12 e13 e14 e15
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 v v v v v ]
- | xC ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p | xA ⇒ p | xB ⇒ p
- | xC ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 v e13 e14 e15
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 v v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 v v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 v v v v ]
- | xD ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p | xA ⇒ p | xB ⇒ p | xC ⇒ p
- | xD ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 v e14 e15
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 v v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 v v v ]
- | xE ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p | xA ⇒ p | xB ⇒ p | xC ⇒ p | xD ⇒ p
- | xE ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 v e15
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 v v ]
- | xF ⇒ match n with
- [ x0 ⇒ p | x1 ⇒ p | x2 ⇒ p | x3 ⇒ p | x4 ⇒ p | x5 ⇒ p | x6 ⇒ p | x7 ⇒ p
- | x8 ⇒ p | x9 ⇒ p | xA ⇒ p | xB ⇒ p | xC ⇒ p | xD ⇒ p | xE ⇒ p
- | xF ⇒ array_16T T e00 e01 e02 e03 e04 e05 e06 e07 e08 e09 e10 e11 e12 e13 e14 v ]
- ]].
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un setter composto [m+1,n-1] a matrice sull'array *)
-(* NB: obbiettivo evitare l'overflow *)
-ndefinition setmn_array16T_succ_pred ≝
-λm,n:exadecim.λT:Type.λp:Array16T T.λv:T.
- match lt_ex m xF with
- [ true ⇒ match gt_ex n x0 with
- [ true ⇒ setmn_array16T (succ_ex m) (pred_ex n) T p v
- | false ⇒ p
- ]
- | false ⇒ p
- ].
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un setter composto [m+1,F] a matrice sull'array *)
-(* NB: obbiettivo evitare l'overflow *)
-ndefinition setmn_array16T_succ ≝
-λm:exadecim.λT:Type.λp:Array16T T.λv:T.
- match lt_ex m xF with
- [ true ⇒ setmn_array16T (succ_ex m) xF T p v
- | false ⇒ p
- ].
-
-(* abbiamo gia' gli esadecimali come tipo induttivo quindi: *)
-(* posso definire un setter composto [0,n-1] a matrice sull'array *)
-(* NB: obbiettivo evitare l'overflow *)
-ndefinition setmn_array16T_pred ≝
-λn:exadecim.λT:Type.λp:Array16T T.λv:T.
- match gt_ex n x0 with
- [ true ⇒ setmn_array16T x0 (pred_ex n) T p v
- | false ⇒ p
- ].
-
-(* ************************** *)
-(* TIPO BYTE COME INSIEME BIT *)
-(* ************************** *)
-
-(* definizione di un byte come 8 bit *)
-ninductive Array8T (T:Type) : Type ≝
-array_8T : T → T → T → T → T → T → T → T →
- Array8T T.
-
-(* abbiamo gia' gli ottali come tipo induttivo quindi: *)
-(* posso definire un getter a matrice sull'array *)
-ndefinition getn_array8T ≝
-λn:oct.λT:Type.λp:Array8T T.
- match p with
- [ array_8T e07 e06 e05 e04 e03 e02 e01 e00 ⇒
- match n with
- [ o0 ⇒ e00 | o1 ⇒ e01 | o2 ⇒ e02 | o3 ⇒ e03 | o4 ⇒ e04 | o5 ⇒ e05 | o6 ⇒ e06 | o7 ⇒ e07 ]].
-
-(* abbiamo gia' gli ottali come tipo induttivo quindi: *)
-(* posso definire un setter a matrice sull'array *)
-ndefinition setn_array8T ≝
-λn:oct.λT:Type.λp:Array8T T.λv:T.
- match p with
- [ array_8T e07 e06 e05 e04 e03 e02 e01 e00 ⇒
- match n with
- [ o0 ⇒ array_8T T e07 e06 e05 e04 e03 e02 e01 v
- | o1 ⇒ array_8T T e07 e06 e05 e04 e03 e02 v e00
- | o2 ⇒ array_8T T e07 e06 e05 e04 e03 v e01 e00
- | o3 ⇒ array_8T T e07 e06 e05 e04 v e02 e01 e00
- | o4 ⇒ array_8T T e07 e06 e05 v e03 e02 e01 e00
- | o5 ⇒ array_8T T e07 e06 v e04 e03 e02 e01 e00
- | o6 ⇒ array_8T T e07 v e05 e04 e03 e02 e01 e00
- | o7 ⇒ array_8T T v e06 e05 e04 e03 e02 e01 e00
- ]].
-
-(* lettura byte *)
-ndefinition byte8_of_bits ≝
-λp:Array8T bool.
- match p with
- [ array_8T e07 e06 e05 e04 e03 e02 e01 e00 ⇒
- mk_byte8
- (or_ex (match e07 with [ true ⇒ x8 | false ⇒ x0 ])
- (or_ex (match e06 with [ true ⇒ x4 | false ⇒ x0 ])
- (or_ex (match e05 with [ true ⇒ x2 | false ⇒ x0 ])
- (match e04 with [ true ⇒ x1 | false ⇒ x0 ]))))
- (or_ex (match e03 with [ true ⇒ x8 | false ⇒ x0 ])
- (or_ex (match e02 with [ true ⇒ x4 | false ⇒ x0 ])
- (or_ex (match e01 with [ true ⇒ x2 | false ⇒ x0 ])
- (match e00 with [ true ⇒ x1 | false ⇒ x0 ])))) ].
-
-(* scrittura byte *)
-ndefinition bits_of_byte8 ≝
-λp:byte8.
- match b8h p with
- [ x0 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false false false false false false false false
- | x1 ⇒ array_8T bool false false false false false false false true
- | x2 ⇒ array_8T bool false false false false false false true false
- | x3 ⇒ array_8T bool false false false false false false true true
- | x4 ⇒ array_8T bool false false false false false true false false
- | x5 ⇒ array_8T bool false false false false false true false true
- | x6 ⇒ array_8T bool false false false false false true true false
- | x7 ⇒ array_8T bool false false false false false true true true
- | x8 ⇒ array_8T bool false false false false true false false false
- | x9 ⇒ array_8T bool false false false false true false false true
- | xA ⇒ array_8T bool false false false false true false true false
- | xB ⇒ array_8T bool false false false false true false true true
- | xC ⇒ array_8T bool false false false false true true false false
- | xD ⇒ array_8T bool false false false false true true false true
- | xE ⇒ array_8T bool false false false false true true true false
- | xF ⇒ array_8T bool false false false false true true true true ]
- | x1 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false false false true false false false false
- | x1 ⇒ array_8T bool false false false true false false false true
- | x2 ⇒ array_8T bool false false false true false false true false
- | x3 ⇒ array_8T bool false false false true false false true true
- | x4 ⇒ array_8T bool false false false true false true false false
- | x5 ⇒ array_8T bool false false false true false true false true
- | x6 ⇒ array_8T bool false false false true false true true false
- | x7 ⇒ array_8T bool false false false true false true true true
- | x8 ⇒ array_8T bool false false false true true false false false
- | x9 ⇒ array_8T bool false false false true true false false true
- | xA ⇒ array_8T bool false false false true true false true false
- | xB ⇒ array_8T bool false false false true true false true true
- | xC ⇒ array_8T bool false false false true true true false false
- | xD ⇒ array_8T bool false false false true true true false true
- | xE ⇒ array_8T bool false false false true true true true false
- | xF ⇒ array_8T bool false false false true true true true true ]
- | x2 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false false true false false false false false
- | x1 ⇒ array_8T bool false false true false false false false true
- | x2 ⇒ array_8T bool false false true false false false true false
- | x3 ⇒ array_8T bool false false true false false false true true
- | x4 ⇒ array_8T bool false false true false false true false false
- | x5 ⇒ array_8T bool false false true false false true false true
- | x6 ⇒ array_8T bool false false true false false true true false
- | x7 ⇒ array_8T bool false false true false false true true true
- | x8 ⇒ array_8T bool false false true false true false false false
- | x9 ⇒ array_8T bool false false true false true false false true
- | xA ⇒ array_8T bool false false true false true false true false
- | xB ⇒ array_8T bool false false true false true false true true
- | xC ⇒ array_8T bool false false true false true true false false
- | xD ⇒ array_8T bool false false true false true true false true
- | xE ⇒ array_8T bool false false true false true true true false
- | xF ⇒ array_8T bool false false true false true true true true ]
- | x3 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false false true true false false false false
- | x1 ⇒ array_8T bool false false true true false false false true
- | x2 ⇒ array_8T bool false false true true false false true false
- | x3 ⇒ array_8T bool false false true true false false true true
- | x4 ⇒ array_8T bool false false true true false true false false
- | x5 ⇒ array_8T bool false false true true false true false true
- | x6 ⇒ array_8T bool false false true true false true true false
- | x7 ⇒ array_8T bool false false true true false true true true
- | x8 ⇒ array_8T bool false false true true true false false false
- | x9 ⇒ array_8T bool false false true true true false false true
- | xA ⇒ array_8T bool false false true true true false true false
- | xB ⇒ array_8T bool false false true true true false true true
- | xC ⇒ array_8T bool false false true true true true false false
- | xD ⇒ array_8T bool false false true true true true false true
- | xE ⇒ array_8T bool false false true true true true true false
- | xF ⇒ array_8T bool false false true true true true true true ]
- | x4 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false true false false false false false false
- | x1 ⇒ array_8T bool false true false false false false false true
- | x2 ⇒ array_8T bool false true false false false false true false
- | x3 ⇒ array_8T bool false true false false false false true true
- | x4 ⇒ array_8T bool false true false false false true false false
- | x5 ⇒ array_8T bool false true false false false true false true
- | x6 ⇒ array_8T bool false true false false false true true false
- | x7 ⇒ array_8T bool false true false false false true true true
- | x8 ⇒ array_8T bool false true false false true false false false
- | x9 ⇒ array_8T bool false true false false true false false true
- | xA ⇒ array_8T bool false true false false true false true false
- | xB ⇒ array_8T bool false true false false true false true true
- | xC ⇒ array_8T bool false true false false true true false false
- | xD ⇒ array_8T bool false true false false true true false true
- | xE ⇒ array_8T bool false true false false true true true false
- | xF ⇒ array_8T bool false true false false true true true true ]
- | x5 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false true false true false false false false
- | x1 ⇒ array_8T bool false true false true false false false true
- | x2 ⇒ array_8T bool false true false true false false true false
- | x3 ⇒ array_8T bool false true false true false false true true
- | x4 ⇒ array_8T bool false true false true false true false false
- | x5 ⇒ array_8T bool false true false true false true false true
- | x6 ⇒ array_8T bool false true false true false true true false
- | x7 ⇒ array_8T bool false true false true false true true true
- | x8 ⇒ array_8T bool false true false true true false false false
- | x9 ⇒ array_8T bool false true false true true false false true
- | xA ⇒ array_8T bool false true false true true false true false
- | xB ⇒ array_8T bool false true false true true false true true
- | xC ⇒ array_8T bool false true false true true true false false
- | xD ⇒ array_8T bool false true false true true true false true
- | xE ⇒ array_8T bool false true false true true true true false
- | xF ⇒ array_8T bool false true false true true true true true ]
- | x6 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false true true false false false false false
- | x1 ⇒ array_8T bool false true true false false false false true
- | x2 ⇒ array_8T bool false true true false false false true false
- | x3 ⇒ array_8T bool false true true false false false true true
- | x4 ⇒ array_8T bool false true true false false true false false
- | x5 ⇒ array_8T bool false true true false false true false true
- | x6 ⇒ array_8T bool false true true false false true true false
- | x7 ⇒ array_8T bool false true true false false true true true
- | x8 ⇒ array_8T bool false true true false true false false false
- | x9 ⇒ array_8T bool false true true false true false false true
- | xA ⇒ array_8T bool false true true false true false true false
- | xB ⇒ array_8T bool false true true false true false true true
- | xC ⇒ array_8T bool false true true false true true false false
- | xD ⇒ array_8T bool false true true false true true false true
- | xE ⇒ array_8T bool false true true false true true true false
- | xF ⇒ array_8T bool false true true false true true true true ]
- | x7 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool false true true true false false false false
- | x1 ⇒ array_8T bool false true true true false false false true
- | x2 ⇒ array_8T bool false true true true false false true false
- | x3 ⇒ array_8T bool false true true true false false true true
- | x4 ⇒ array_8T bool false true true true false true false false
- | x5 ⇒ array_8T bool false true true true false true false true
- | x6 ⇒ array_8T bool false true true true false true true false
- | x7 ⇒ array_8T bool false true true true false true true true
- | x8 ⇒ array_8T bool false true true true true false false false
- | x9 ⇒ array_8T bool false true true true true false false true
- | xA ⇒ array_8T bool false true true true true false true false
- | xB ⇒ array_8T bool false true true true true false true true
- | xC ⇒ array_8T bool false true true true true true false false
- | xD ⇒ array_8T bool false true true true true true false true
- | xE ⇒ array_8T bool false true true true true true true false
- | xF ⇒ array_8T bool false true true true true true true true ]
- | x8 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true false false false false false false false
- | x1 ⇒ array_8T bool true false false false false false false true
- | x2 ⇒ array_8T bool true false false false false false true false
- | x3 ⇒ array_8T bool true false false false false false true true
- | x4 ⇒ array_8T bool true false false false false true false false
- | x5 ⇒ array_8T bool true false false false false true false true
- | x6 ⇒ array_8T bool true false false false false true true false
- | x7 ⇒ array_8T bool true false false false false true true true
- | x8 ⇒ array_8T bool true false false false true false false false
- | x9 ⇒ array_8T bool true false false false true false false true
- | xA ⇒ array_8T bool true false false false true false true false
- | xB ⇒ array_8T bool true false false false true false true true
- | xC ⇒ array_8T bool true false false false true true false false
- | xD ⇒ array_8T bool true false false false true true false true
- | xE ⇒ array_8T bool true false false false true true true false
- | xF ⇒ array_8T bool true false false false true true true true ]
- | x9 ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true false false true false false false false
- | x1 ⇒ array_8T bool true false false true false false false true
- | x2 ⇒ array_8T bool true false false true false false true false
- | x3 ⇒ array_8T bool true false false true false false true true
- | x4 ⇒ array_8T bool true false false true false true false false
- | x5 ⇒ array_8T bool true false false true false true false true
- | x6 ⇒ array_8T bool true false false true false true true false
- | x7 ⇒ array_8T bool true false false true false true true true
- | x8 ⇒ array_8T bool true false false true true false false false
- | x9 ⇒ array_8T bool true false false true true false false true
- | xA ⇒ array_8T bool true false false true true false true false
- | xB ⇒ array_8T bool true false false true true false true true
- | xC ⇒ array_8T bool true false false true true true false false
- | xD ⇒ array_8T bool true false false true true true false true
- | xE ⇒ array_8T bool true false false true true true true false
- | xF ⇒ array_8T bool true false false true true true true true ]
- | xA ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true false true false false false false false
- | x1 ⇒ array_8T bool true false true false false false false true
- | x2 ⇒ array_8T bool true false true false false false true false
- | x3 ⇒ array_8T bool true false true false false false true true
- | x4 ⇒ array_8T bool true false true false false true false false
- | x5 ⇒ array_8T bool true false true false false true false true
- | x6 ⇒ array_8T bool true false true false false true true false
- | x7 ⇒ array_8T bool true false true false false true true true
- | x8 ⇒ array_8T bool true false true false true false false false
- | x9 ⇒ array_8T bool true false true false true false false true
- | xA ⇒ array_8T bool true false true false true false true false
- | xB ⇒ array_8T bool true false true false true false true true
- | xC ⇒ array_8T bool true false true false true true false false
- | xD ⇒ array_8T bool true false true false true true false true
- | xE ⇒ array_8T bool true false true false true true true false
- | xF ⇒ array_8T bool true false true false true true true true ]
- | xB ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true false true true false false false false
- | x1 ⇒ array_8T bool true false true true false false false true
- | x2 ⇒ array_8T bool true false true true false false true false
- | x3 ⇒ array_8T bool true false true true false false true true
- | x4 ⇒ array_8T bool true false true true false true false false
- | x5 ⇒ array_8T bool true false true true false true false true
- | x6 ⇒ array_8T bool true false true true false true true false
- | x7 ⇒ array_8T bool true false true true false true true true
- | x8 ⇒ array_8T bool true false true true true false false false
- | x9 ⇒ array_8T bool true false true true true false false true
- | xA ⇒ array_8T bool true false true true true false true false
- | xB ⇒ array_8T bool true false true true true false true true
- | xC ⇒ array_8T bool true false true true true true false false
- | xD ⇒ array_8T bool true false true true true true false true
- | xE ⇒ array_8T bool true false true true true true true false
- | xF ⇒ array_8T bool true false true true true true true true ]
- | xC ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true true false false false false false false
- | x1 ⇒ array_8T bool true true false false false false false true
- | x2 ⇒ array_8T bool true true false false false false true false
- | x3 ⇒ array_8T bool true true false false false false true true
- | x4 ⇒ array_8T bool true true false false false true false false
- | x5 ⇒ array_8T bool true true false false false true false true
- | x6 ⇒ array_8T bool true true false false false true true false
- | x7 ⇒ array_8T bool true true false false false true true true
- | x8 ⇒ array_8T bool true true false false true false false false
- | x9 ⇒ array_8T bool true true false false true false false true
- | xA ⇒ array_8T bool true true false false true false true false
- | xB ⇒ array_8T bool true true false false true false true true
- | xC ⇒ array_8T bool true true false false true true false false
- | xD ⇒ array_8T bool true true false false true true false true
- | xE ⇒ array_8T bool true true false false true true true false
- | xF ⇒ array_8T bool true true false false true true true true ]
- | xD ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true true false true false false false false
- | x1 ⇒ array_8T bool true true false true false false false true
- | x2 ⇒ array_8T bool true true false true false false true false
- | x3 ⇒ array_8T bool true true false true false false true true
- | x4 ⇒ array_8T bool true true false true false true false false
- | x5 ⇒ array_8T bool true true false true false true false true
- | x6 ⇒ array_8T bool true true false true false true true false
- | x7 ⇒ array_8T bool true true false true false true true true
- | x8 ⇒ array_8T bool true true false true true false false false
- | x9 ⇒ array_8T bool true true false true true false false true
- | xA ⇒ array_8T bool true true false true true false true false
- | xB ⇒ array_8T bool true true false true true false true true
- | xC ⇒ array_8T bool true true false true true true false false
- | xD ⇒ array_8T bool true true false true true true false true
- | xE ⇒ array_8T bool true true false true true true true false
- | xF ⇒ array_8T bool true true false true true true true true ]
- | xE ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true true true false false false false false
- | x1 ⇒ array_8T bool true true true false false false false true
- | x2 ⇒ array_8T bool true true true false false false true false
- | x3 ⇒ array_8T bool true true true false false false true true
- | x4 ⇒ array_8T bool true true true false false true false false
- | x5 ⇒ array_8T bool true true true false false true false true
- | x6 ⇒ array_8T bool true true true false false true true false
- | x7 ⇒ array_8T bool true true true false false true true true
- | x8 ⇒ array_8T bool true true true false true false false false
- | x9 ⇒ array_8T bool true true true false true false false true
- | xA ⇒ array_8T bool true true true false true false true false
- | xB ⇒ array_8T bool true true true false true false true true
- | xC ⇒ array_8T bool true true true false true true false false
- | xD ⇒ array_8T bool true true true false true true false true
- | xE ⇒ array_8T bool true true true false true true true false
- | xF ⇒ array_8T bool true true true false true true true true ]
- | xF ⇒ match b8l p with
- [ x0 ⇒ array_8T bool true true true true false false false false
- | x1 ⇒ array_8T bool true true true true false false false true
- | x2 ⇒ array_8T bool true true true true false false true false
- | x3 ⇒ array_8T bool true true true true false false true true
- | x4 ⇒ array_8T bool true true true true false true false false
- | x5 ⇒ array_8T bool true true true true false true false true
- | x6 ⇒ array_8T bool true true true true false true true false
- | x7 ⇒ array_8T bool true true true true false true true true
- | x8 ⇒ array_8T bool true true true true true false false false
- | x9 ⇒ array_8T bool true true true true true false false true
- | xA ⇒ array_8T bool true true true true true false true false
- | xB ⇒ array_8T bool true true true true true false true true
- | xC ⇒ array_8T bool true true true true true true false false
- | xD ⇒ array_8T bool true true true true true true false true
- | xE ⇒ array_8T bool true true true true true true true false
- | xF ⇒ array_8T bool true true true true true true true true ]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/memory_struct.ma".
-include "freescale/word16.ma".
-include "freescale/option.ma".
-include "freescale/theory.ma".
-
-(* ********************* *)
-(* MEMORIA E DESCRITTORE *)
-(* ********************* *)
-
-(* tutta la memoria non installata *)
-ndefinition mt_out_of_bound_memory ≝
-let lev4 ≝ array_16T ?
- MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- in
-let lev3 ≝ array_16T ?
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- in
-let lev2 ≝ array_16T ?
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- in
-let lev1 ≝ array_16T ?
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- in
-lev1.
-
-(* tutta la memoria a 0 *)
-ndefinition mt_zero_memory ≝
-let lev4 ≝ array_16T ?
- (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0)
- (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0)
- (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0)
- (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0) (mk_byte8 x0 x0)
- in
-let lev3 ≝ array_16T ?
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- lev4 lev4 lev4 lev4 lev4 lev4 lev4 lev4
- in
-let lev2 ≝ array_16T ?
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- lev3 lev3 lev3 lev3 lev3 lev3 lev3 lev3
- in
-let lev1 ≝ array_16T ?
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- lev2 lev2 lev2 lev2 lev2 lev2 lev2 lev2
- in
-lev1.
-
-(* visita di un albero da 64KB di elementi: ln16(65536)=4 passaggi *)
-ndefinition mt_visit ≝
-λT:Type.λdata:Array16T (Array16T (Array16T (Array16T T))).λaddr:word16.
- match addr with
- [ mk_word16 wh wl ⇒
- getn_array16T (b8l wl) ?
- (getn_array16T (b8h wl) ?
- (getn_array16T (b8l wh) ?
- (getn_array16T (b8h wh) ? data))) ].
-
-(* scrittura di un elemento in un albero da 64KB *)
-ndefinition mt_update ≝
-λT:Type.λdata:Array16T (Array16T (Array16T (Array16T T))).λaddr:word16.λv:T.
- match addr with
- [ mk_word16 wh wl ⇒
- let lev2 ≝ getn_array16T (b8h wh) ? data in
- let lev3 ≝ getn_array16T (b8l wh) ? lev2 in
- let lev4 ≝ getn_array16T (b8h wl) ? lev3 in
- setn_array16T (b8h wh) ? data
- (setn_array16T (b8l wh) ? lev2
- (setn_array16T (b8h wl) ? lev3
- (setn_array16T (b8l wl) T lev4 v))) ].
-
-(* scrittura di un range in un albero da 64KB *)
-ndefinition mt_update_ranged ≝
-λT:Type.λdata:Array16T (Array16T (Array16T (Array16T T))).λi,s:word16.λv:T.
- (* ok i≤s *)
- match le_w16 i s with
- [ true ⇒
- match i with
- [ mk_word16 ih il ⇒
- match s with
- [ mk_word16 sh sl ⇒
- let aux_4 ≝ Array16T T in
- let aux_3 ≝ Array16T (Array16T T) in
- let aux_2 ≝ Array16T (Array16T (Array16T T)) in
-
- let ilev2 ≝ getn_array16T (b8h ih) aux_2 data in
- let ilev3 ≝ getn_array16T (b8l ih) aux_3 ilev2 in
- let ilev4 ≝ getn_array16T (b8h il) aux_4 ilev3 in
-
- let slev2 ≝ getn_array16T (b8h sh) aux_2 data in
- let slev3 ≝ getn_array16T (b8l sh) aux_3 slev2 in
- let slev4 ≝ getn_array16T (b8h sl) aux_4 slev3 in
-
- let vlev4 ≝ array_16T T v v v v v v v v v v v v v v v v in
- let vlev3 ≝ array_16T aux_4 vlev4 vlev4 vlev4 vlev4 vlev4 vlev4 vlev4 vlev4
- vlev4 vlev4 vlev4 vlev4 vlev4 vlev4 vlev4 vlev4 in
- let vlev2 ≝ array_16T aux_3 vlev3 vlev3 vlev3 vlev3 vlev3 vlev3 vlev3 vlev3
- vlev3 vlev3 vlev3 vlev3 vlev3 vlev3 vlev3 vlev3 in
-
- match eq_ex (b8h ih) (b8h sh) with
- [ true ⇒ match eq_ex (b8l ih) (b8l sh) with
- [ true ⇒ match eq_ex (b8h il) (b8h sl) with
- (* caso 0x...(X) a 0x...(Y) *)
- [ true ⇒ setn_array16T (b8h ih) aux_2 data
- (setn_array16T (b8l ih) aux_3 ilev2
- (setn_array16T (b8h il) aux_4 ilev3
- (* cambio a partire da livello 4 *)
- (setmn_array16T (b8l il) (b8l sl) T ilev4 v))) (* ...X,...Y *)
- (* caso 0x..(X1)(X2) a 0x..(Y1)(Y2) *)
- | false ⇒ setn_array16T (b8h ih) aux_2 data
- (setn_array16T (b8l ih) aux_3 ilev2
- (* cambio a partire da livello 3 *)
- (setn_array16T (b8h sl) aux_4 (* ..(Y1)0,..(Y1)(Y2) *)
- (setmn_array16T_succ_pred (b8h il) (b8h sl) aux_4 (* ..(X1+1).,..(Y1-1). *)
- (setn_array16T (b8h il) aux_4 ilev3
- (setmn_array16T (b8l il) xF T ilev4 v)) (* ..(X1)(X2),..(X1)F *)
- vlev4)
- (setmn_array16T x0 (b8l sl) T slev4 v))) ]
- (* caso 0x.(X1)(X2)(X3) a 0x..(Y1)(Y2)(Y3) *)
- | false ⇒ setn_array16T (b8h ih) aux_2 data
- (* cambio a partire da livello 2 *)
- (setn_array16T (b8l sh) aux_3
- (setmn_array16T_succ_pred (b8l ih) (b8l sh) aux_3 (* .(X1+1)..,.(Y1-1).. *)
- (setn_array16T (b8l ih) aux_3 ilev2
- (setmn_array16T_succ (b8h il) aux_4 (* .(X1)(X2+1).,.(X1)F. *)
- (setn_array16T (b8h il) aux_4 ilev3
- (setmn_array16T (b8l il) xF T ilev4 v)) (* .(X1)(X2)(X3),.(X1)(X2)F *)
- vlev4))
- vlev3)
- (setmn_array16T_pred (b8h sl) aux_4 (* .(Y1)0.,.(Y1)(Y2-1). *)
- (setn_array16T (b8h sl) aux_4 slev3
- (setmn_array16T x0 (b8l sl) T slev4 v)) (* .(Y1)(Y2)0,.(Y1)(Y2)(Y3) *)
- vlev4))
- ]
- (* caso 0x(X1)(X2)(X3)(X4) a 0x(Y1)(Y2)(Y3)(Y4) *)
- | false ⇒ setn_array16T (b8h sh) aux_2
- (setmn_array16T_succ_pred (b8h ih) (b8h sh) aux_2 (* (X+1)...,(Y-1)... *)
- (setn_array16T (b8h ih) aux_2 data
- (setmn_array16T_succ (b8l ih) aux_3 (* (X1)(X2+1)..,(X1)F.. *)
- (setn_array16T (b8l ih) aux_3 ilev2
- (setmn_array16T_succ (b8h il) aux_4 (* (X1)(X2)(X3+1).,(X1)(X2)F. *)
- (setn_array16T (b8h il) aux_4 ilev3
- (setmn_array16T (b8l il) xF T ilev4 v)) (* (X1)(X2)(X3)(X4),(X1)(X2)(X3)F *)
- vlev4))
- vlev3))
- vlev2)
- (setmn_array16T_pred (b8l sh) aux_3 (* (Y1)0..,(Y1)(Y2-1).. *)
- (setn_array16T (b8l sh) aux_3 slev2
- (setmn_array16T_pred (b8h sl) aux_4 (* (Y1)(Y2)0.,(Y1)(Y2)(Y3-1). *)
- (setn_array16T (b8h sl) aux_4 slev3
- (setmn_array16T x0 (b8l sl) T slev4 v)) (* (Y1)(Y2)(Y3)0,(Y1)(Y2)(Y3)(Y4) *)
- vlev4))
- vlev3) ]]]
- (* no i>s *)
- | false ⇒ data
- ].
-
-ndefinition mt_chk_get ≝
-λchk:Array16T (Array16T (Array16T (Array16T memory_type))).λaddr:word16.
- match mt_visit ? chk addr with
- [ MEM_READ_ONLY ⇒ array_8T ? MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY MEM_READ_ONLY
- | MEM_READ_WRITE ⇒ array_8T ? MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE MEM_READ_WRITE
- | MEM_OUT_OF_BOUND ⇒ array_8T ? MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND MEM_OUT_OF_BOUND
- ].
-
-(* scrivi controllando il tipo di memoria *)
-ndefinition mt_mem_update ≝
-λmem:Array16T (Array16T (Array16T (Array16T byte8))).
-λchk:Array8T memory_type.
-λaddr:word16.λv:byte8.
- match getn_array8T o0 ? chk with
- (* ROM? ok, ma il valore viene perso *)
- [ MEM_READ_ONLY ⇒ Some ? mem
- (* RAM? ok *)
- | MEM_READ_WRITE ⇒ Some ? (mt_update ? mem addr v)
- (* NON INSTALLATA? no *)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-(* leggi controllando il tipo di memoria *)
-ndefinition mt_mem_read ≝
-λmem:Array16T (Array16T (Array16T (Array16T byte8))).
-λchk:Array16T (Array16T (Array16T (Array16T memory_type))).
-λaddr:word16.
- match mt_visit ? chk addr with
- [ MEM_READ_ONLY ⇒ Some ? (mt_visit ? mem addr)
- | MEM_READ_WRITE ⇒ Some ? (mt_visit ? mem addr)
- | MEM_OUT_OF_BOUND ⇒ None ? ].
-
-(* ************************** *)
-(* CARICAMENTO PROGRAMMA/DATI *)
-(* ************************** *)
-
-(* carica a paratire da addr, scartando source (pescando da old_mem) se si supera 0xFFFF... *)
-nlet rec mt_load_from_source_at (old_mem:Array16T (Array16T (Array16T (Array16T byte8))))
- (source:list byte8) (addr:word16) on source ≝
-match source with
- (* fine di source: carica da old_mem *)
- [ nil ⇒ old_mem
- | cons hd tl ⇒ match lt_w16 addr 〈〈xF,xF〉:〈xF,xF〉〉 with
- (* non supera 0xFFFF, ricorsione *)
- [ true ⇒ mt_load_from_source_at (mt_update ? old_mem addr hd) tl (plus_w16_d_d addr 〈〈x0,x0〉:〈x0,x1〉〉)
- (* supera 0xFFFF, niente ricorsione *)
- | false ⇒ mt_update ? old_mem addr hd
- ]].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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.
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/status.ma".
-
-(* *********************************** *)
-(* IMPOSTAZIONI SPECIFICHE DEI MODELLI *)
-(* *********************************** *)
-
-(* modelli di HC05 *)
-ninductive HC05_mcu_model : Type ≝
- MC68HC05J5A: HC05_mcu_model
- (*..*).
-
-(* modelli di HC08 *)
-ninductive HC08_mcu_model : Type ≝
- MC68HC08AB16A: HC08_mcu_model
- (*..*).
-
-(* modelli di HCS08 *)
-ninductive HCS08_mcu_model : Type ≝
- MC9S08AW60 : HCS08_mcu_model
-| MC9S08GB60 : HCS08_mcu_model
- (*..*).
-
-(* modelli di RS08 *)
-ninductive RS08_mcu_model : Type ≝
- MC9RS08KA1 : RS08_mcu_model
-| MC9RS08KA2 : RS08_mcu_model.
-
-(* raggruppamento dei modelli *)
-ninductive any_mcu_model : Type ≝
- FamilyHC05 : HC05_mcu_model → any_mcu_model
-| FamilyHC08 : HC08_mcu_model → any_mcu_model
-| FamilyHCS08 : HCS08_mcu_model → any_mcu_model
-| FamilyRS08 : RS08_mcu_model → any_mcu_model.
-
-(*
-condizioni errore interne alla MCU
-(Il programma viene caricato dal produttore in ROM o impostato in EEPROM)
-HC05: +illegal address during opcode fetch
-HC08: +illegal address duting opcode fetch (ILAD mascherabile)
- +illegal opcode (ILOP mascherabile)
-
-(Il programma viene programmato nella FLASH)
-HCS08: +illegal address during opcode fetch (ILAD mascherabile)
- +illegal opcode (ILOP mascherabile)
- +security = accesso a RAM e zone FLASH dichiarate sicure da zone sicure
- da' 0 in lettura e ignore in scrittura, [FLASH]SEC00:SEC01 (1,0)
- corrisponde a OFF, altre ON, disattivabile solo da modalita' sicura se
- opzione [FLASH]KEYEN e' 1 passando chiave a 8byte da modalita' sicura.
- Altrimenti disattivabile solo con FLASH mass erase. Obbiettivo
- e' impedire duplicazione di software di controllo, dato che esiste
- modalita' debugging. A restart viene ricaricata da FLASH impostazione
- sicurezza!
-RS08: +illegal address durting opcode fetch (ILAD) mascherabile
- +illegal opcode (ILOP mascherabile)
- +security = solo la FLASH e' considerata sicura. Stesso meccanismo di HCS08
- ma governato solo da [FLASH]SECD (0) OFF.Una volta attivato l'unica
- disattivazione e' la cancellazione della FLASH.
-*)
-
-(* memoria degli HC05 *)
-ndefinition memory_type_of_FamilyHC05 ≝
-λm:HC05_mcu_model.match m with
- [ MC68HC05J5A ⇒
- [
- (* astraggo molto *)
- (* 0x0000-0x001F,0x0FF0: sarebbe memory mapped IO *)
-
- triple … 〈〈x0,x0〉:〈x8,x0〉〉 〈〈x0,x0〉:〈xF,xF〉〉 MEM_READ_WRITE (* 128B RAM+STACK *)
- ; triple … 〈〈x0,x3〉:〈x0,x0〉〉 〈〈x0,xC〉:〈xF,xF〉〉 MEM_READ_ONLY (* 2560B USER ROM *)
- ; triple … 〈〈x0,xE〉:〈x0,x0〉〉 〈〈x0,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 512B INTERNAL ROM *)
- ]
- (*..*)
- ].
-
-(* memoria degli HC08 *)
-ndefinition memory_type_of_FamilyHC08 ≝
-λm:HC08_mcu_model.match m with
- [ MC68HC08AB16A ⇒
- [
- (* astraggo molto *)
- (* 0x0000-0x004F,0xFE00-0xFE01,0xFE03,
- 0xFE0C-0xFE11,0xFE1A-0xFE1D,0xFE1F: sarebbe memory mapped IO *)
- (* 0x0500-0x057F,0xFE02,0xFE04-0xFE07,
- 0xFE09-0xFE0B,0xFE12-0xFE19,0xFE1E,0xFFC0-0xFFCF : sarebbe reserved *)
-
- triple … 〈〈x0,x0〉:〈x5,x0〉〉 〈〈x0,x2〉:〈x4,xF〉〉 MEM_READ_WRITE (* 512B RAM *)
- ; triple … 〈〈x0,x8〉:〈x0,x0〉〉 〈〈x0,x9〉:〈xF,xF〉〉 MEM_READ_ONLY (* 512B EEPROM *)
- ; triple … 〈〈xB,xE〉:〈x0,x0〉〉 〈〈xF,xD〉:〈xF,xF〉〉 MEM_READ_ONLY (* 16384B ROM *)
- ; triple … 〈〈xF,xE〉:〈x2,x0〉〉 〈〈xF,xF〉:〈x5,x2〉〉 MEM_READ_ONLY (* 307B ROM *)
- ; triple … 〈〈xF,xF〉:〈xD,x0〉〉 〈〈xF,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 48B ROM *) ]
- (*..*)
- ].
-
-(* memoria degli HCS08 *)
-ndefinition memory_type_of_FamilyHCS08 ≝
-λm:HCS08_mcu_model.match m with
- [ MC9S08AW60 ⇒
- [
- (* astraggo molto *)
- (* 0x0000-0x006F,0x1800-0x185F: sarebbe memory mapped IO *)
-
- triple … 〈〈x0,x0〉:〈x7,x0〉〉 〈〈x0,x8〉:〈x6,xF〉〉 MEM_READ_WRITE (* 2048B RAM *)
- ; triple … 〈〈x0,x8〉:〈x7,x0〉〉 〈〈x1,x7〉:〈xF,xF〉〉 MEM_READ_ONLY (* 3984B FLASH *)
- ; triple … 〈〈x1,x8〉:〈x6,x0〉〉 〈〈xF,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 59296B FLASH *) ]
- | MC9S08GB60 ⇒
- [
- (* astraggo molto *)
- (* 0x0000-0x006F,0x1800-0x185F: sarebbe memory mapped IO *)
-
- triple … 〈〈x0,x0〉:〈x8,x0〉〉 〈〈x1,x0〉:〈x7,xF〉〉 MEM_READ_WRITE (* 4096B RAM *)
- ; triple … 〈〈x1,x0〉:〈x8,x0〉〉 〈〈x1,x7〉:〈xF,xF〉〉 MEM_READ_ONLY (* 1920B FLASH *)
- ; triple … 〈〈x1,x8〉:〈x2,xC〉〉 〈〈xF,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 59348B FLASH *) ]
- ].
-
-(* memoria dei RS08 *)
-ndefinition memory_type_of_FamilyRS08 ≝
-λm:RS08_mcu_model.match m with
- [ MC9RS08KA1 ⇒
- [
- triple … 〈〈x0,x0〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x0,xE〉〉 MEM_READ_WRITE (* 15B RAM *)
- (* [000F] e' il registro X *)
- (* 0x0010-0x001E sarebbe memory mapped IO, proviamo per completezza con RAM *)
- ; triple … 〈〈x0,x0〉:〈x1,x0〉〉 〈〈x0,x0〉:〈x1,xE〉〉 MEM_READ_WRITE (* 15B MEMORY MAPPED IO *)
- (* [001F] e' il registro PAGESEL *)
- ; triple … 〈〈x0,x0〉:〈x2,x0〉〉 〈〈x0,x0〉:〈x4,xF〉〉 MEM_READ_WRITE (* 48B RAM *)
- (* [00C0-00FF] mappato da PAGESEL su [00pp pppp ppxx xxxx] *)
- ; triple … 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈xF,xF〉〉 MEM_READ_WRITE (* 64B RAM PAGING *)
- (* 0x0200-0x023F sarebbe memory mapped IO, proviamo per completezza con RAM *)
- ; triple … 〈〈x0,x2〉:〈x0,x0〉〉 〈〈x0,x2〉:〈x3,xF〉〉 MEM_READ_WRITE (* 64B MEMORY MAPPED IO *)
- ; triple … 〈〈x3,xC〉:〈x0,x0〉〉 〈〈x3,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 1024B FLASH *) ]
- | MC9RS08KA2 ⇒
- [
- triple … 〈〈x0,x0〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x0,xE〉〉 MEM_READ_WRITE (* 15B RAM *)
- (* [000F] e' il registro X *)
- (* 0x0010-0x001E sarebbe memory mapped IO, proviamo per completezza con RAM *)
- ; triple … 〈〈x0,x0〉:〈x1,x0〉〉 〈〈x0,x0〉:〈x1,xE〉〉 MEM_READ_WRITE (* 15B MEMORY MAPPED IO *)
- (* [001F] e' il registro PAGESEL *)
- ; triple … 〈〈x0,x0〉:〈x2,x0〉〉 〈〈x0,x0〉:〈x4,xF〉〉 MEM_READ_WRITE (* 48B RAM *)
- (* [00C0-00FF] mappato da PAGESEL su [00pp pppp ppxx xxxx] *)
- ; triple … 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈xF,xF〉〉 MEM_READ_WRITE (* 64B RAM PAGING *)
- (* 0x0200-0x023F sarebbe memory mapped IO, proviamo per completezza con RAM *)
- ; triple … 〈〈x0,x2〉:〈x0,x0〉〉 〈〈x0,x2〉:〈x3,xF〉〉 MEM_READ_WRITE (* 64B MEMORY MAPPED IO *)
- ; triple … 〈〈x3,x8〉:〈x0,x0〉〉 〈〈x3,xF〉:〈xF,xF〉〉 MEM_READ_ONLY (* 2048B FLASH *) ]
- ].
-
-(* ∀modello.descrizione della memoria installata *)
-ndefinition memory_type_of_mcu_version ≝
-λmcu:any_mcu_model.match mcu with
- [ FamilyHC05 m ⇒ memory_type_of_FamilyHC05 m
- | FamilyHC08 m ⇒ memory_type_of_FamilyHC08 m
- | FamilyHCS08 m ⇒ memory_type_of_FamilyHCS08 m
- | FamilyRS08 m ⇒ memory_type_of_FamilyRS08 m
- ].
-
-(* dato un modello costruisce un descrittore a partire dalla lista precedente *)
-nlet rec build_memory_type_of_mcu_version_aux t param (result:aux_chk_type t) on param ≝
- match param with
- [ nil ⇒ result
- | cons hd tl ⇒
- build_memory_type_of_mcu_version_aux t tl
- (check_update_ranged t result (fst3T ??? hd) (snd3T ??? hd) (thd3T ??? hd)) ].
-
-ndefinition build_memory_type_of_mcu_version ≝
-λmcu:any_mcu_model.λt:memory_impl.
- build_memory_type_of_mcu_version_aux t (memory_type_of_mcu_version mcu) (out_of_bound_memory t).
-
-(* sarebbe programma da caricare/zero_memory, ora test *)
-ndefinition memory_of_mcu_version ≝
-λmcu:any_mcu_model.λt:memory_impl.match mcu with
- [ FamilyHC05 m ⇒ match m with
- [ MC68HC05J5A ⇒ zero_memory t
- (*..*)
- ]
- | FamilyHC08 m ⇒ match m with
- [ MC68HC08AB16A ⇒ zero_memory t
- (*..*)
- ]
- (* tralascio l'enumerazione dei casi, per ora e' tutto 0 *)
- | FamilyHCS08 _ ⇒ zero_memory t
- | FamilyRS08 _ ⇒ zero_memory t
- ].
-
-(*
- parametrizzati i non deterministici rispetto a tutti i valori casuali
- che verranno dati dall'esterno di tipo byte8 (ndby1-2) e bool (ndbo1-5).
- l'ACCENSIONE e' totalmente equivalente ad un reset causato da calo di tensione
- (reset V-low), la memoria ed il check puo' essere passata, per esempio da
- - (memory_of_mcu_version MC68HC05J5A)
- - (build_memory_type_of_mcu_version MC68HC05J5A)
-*)
-ndefinition start_of_mcu_version_HC05 ≝
-λmcu:HC05_mcu_model.λt:memory_impl.
-λmem:aux_mem_type t.λchk:aux_chk_type t.
-λndby1,ndby2:byte8.λirqfl,ndbo1,ndbo2,ndbo3,ndbo4,ndbo5:bool.
- let build ≝ λspm,spf,pcm:word16.
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem (and_w16 〈〈xF,xF〉:〈xF,xE〉〉 pcm))
- (mem_read_abs t mem (and_w16 〈〈xF,xF〉:〈xF,xF〉〉 pcm)) in
- mk_any_status HC05 t
- (mk_alu_HC05
- (* acc_low: ? *) ndby1 (* indx_low: ? *) ndby2
- (* sp: reset *) (or_w16 (and_w16 〈〈x0,x0〉:〈xF,xF〉〉 spm) spf) spm spf
- (* pc: reset+fetch *) (and_w16 fetched_pc pcm) pcm
- (* H: ? *) ndbo1 (* I: reset *) true (* N: ? *) ndbo2
- (* Z: ? *) ndbo3 (* C: ? *) ndbo4 (* IRQ: ? *) irqfl)
- (* mem *) mem
- (* chk *) chk
- (* clk: reset *) (None ?) in
- match mcu with
- [ MC68HC05J5A ⇒ build 〈〈x0,x0〉:〈x3,xF〉〉 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,xF〉:〈xF,xF〉〉
- (*..*)
- ].
-
-ndefinition start_of_mcu_version_HC08 ≝
-λmcu:HC08_mcu_model.λt:memory_impl.
-λmem:aux_mem_type t.λchk:aux_chk_type t.
-λndby1,ndby2:byte8.λirqfl,ndbo1,ndbo2,ndbo3,ndbo4,ndbo5:bool.
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem 〈〈xF,xF〉:〈xF,xE〉〉)
- (mem_read_abs t mem 〈〈xF,xF〉:〈xF,xF〉〉) in
- mk_any_status HC08 t
- (mk_alu_HC08
- (* acc_low: ? *) ndby1 (* indw_low: ? *) ndby2 (* indx_high: reset *) 〈x0,x0〉
- (* sp: reset *) 〈〈x0,x0〉:〈xF,xF〉〉 (* pc: reset+fetch *) fetched_pc
- (* V: ? *) ndbo1 (* H: ? *) ndbo2 (* I: reset *) true
- (* N: ? *) ndbo3 (* Z: ? *) ndbo4 (* C: ? *) ndbo5 (* IRQ: ? *) irqfl)
- (* mem *) mem
- (* chk *) chk
- (* clk: reset *) (None ?).
-
-ndefinition start_of_mcu_version_HCS08 ≝
-λmcu:HCS08_mcu_model.λt:memory_impl.
-λmem:aux_mem_type t.λchk:aux_chk_type t.
-λndby1,ndby2:byte8.λirqfl,ndbo1,ndbo2,ndbo3,ndbo4,ndbo5:bool.
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem 〈〈xF,xF〉:〈xF,xE〉〉)
- (mem_read_abs t mem 〈〈xF,xF〉:〈xF,xF〉〉) in
- mk_any_status HCS08 t
- (mk_alu_HC08
- (* acc_low: ? *) ndby1 (* indw_low: ? *) ndby2 (* indx_high: reset *) 〈x0,x0〉
- (* sp: reset *) 〈〈x0,x0〉:〈xF,xF〉〉 (* pc: reset+fetch *) fetched_pc
- (* V: ? *) ndbo1 (* H: ? *) ndbo2 (* I: reset *) true
- (* N: ? *) ndbo3 (* Z: ? *) ndbo4 (* C: ? *) ndbo5 (* IRQ: ? *) irqfl)
- (* mem *) mem
- (* chk *) chk
- (* clk: reset *) (None ?).
-
-ndefinition start_of_mcu_version_RS08 ≝
-λmcu:RS08_mcu_model.λt:memory_impl.
-λmem:aux_mem_type t.λchk:aux_chk_type t.
-λndby1,ndby2:byte8.λirqfl,ndbo1,ndbo2,ndbo3,ndbo4,ndbo5:bool.
- let build ≝ λpcm.
- mk_any_status RS08 t
- (mk_alu_RS08
- (* acc_low: reset *) 〈x0,x0〉
- (* pc: reset *) (and_w16 〈〈xF,xF〉:〈xF,xD〉〉 pcm) pcm
- (* spc: reset *) (and_w16 〈〈xF,xF〉:〈xF,xD〉〉 pcm)
- (* xm: reset *) 〈x0,x0〉 (* psm: *) 〈x8,x0〉
- (* Z: reset *) false (* C: reset *) false)
- (* mem *) mem
- (* chk *) chk
- (* clk: reset *) (None ?) in
- (* tralascio l'enumerazione dei casi, tanto i valori sono uguali *)
- build 〈〈x3,xF〉:〈xF,xF〉〉.
-
-(*
- cio' che non viene resettato mantiene il valore precedente: nella documentazione
- viene riportato come "unaffected"/"indeterminate"/"unpredictable"
- il soft RESET e' diverso da un calo di tensione e la ram non variera'
-*)
-ndefinition reset_of_mcu ≝
-λm:mcu_type.λt:memory_impl.
-let pc_reset_h ≝ 〈〈xF,xF〉:〈xF,xE〉〉 in
-let pc_reset_l ≝ 〈〈xF,xF〉:〈xF,xF〉〉 in
-let pc_RS08_reset ≝ 〈〈xF,xF〉:〈xF,xD〉〉 in
-let sp_reset ≝ 〈〈x0,x0〉:〈xF,xF〉〉 in
- match m return λm:mcu_type.(any_status m t) → (any_status m t) with
-(* HC05: parzialmente non deterministico *)
- [ HC05 ⇒ λs:any_status HC05 t.match s with
- [ mk_any_status alu mem chk clk ⇒ match alu with
- [ mk_alu_HC05 acclow indxlow _ spm spf _ pcm hfl _ nfl zfl cfl irqfl ⇒
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem (and_w16 pc_reset_h pcm))
- (mem_read_abs t mem (and_w16 pc_reset_l pcm)) in
- mk_any_status HC05 t
- (mk_alu_HC05
- (* acc_low: inv. *) acclow (* indx_low: inv. *) indxlow
- (* sp: reset *) (or_w16 (and_w16 sp_reset spm) spf) spm spf
- (* pc: reset+fetch *) (and_w16 fetched_pc pcm) pcm
- (* H: inv. *) hfl (* I: reset *) true (* N: inv. *) nfl
- (* Z: inv. *) zfl (* C: inv. *) cfl (* IRQ: inv *) irqfl)
- (* mem: inv. *) mem
- (* chk: inv. *) chk
- (* clk: reset *) (None ?) ]]
-(* HC08: parzialmente non deterministico *)
- | HC08 ⇒ λs:any_status HC08 t.match s with
- [ mk_any_status alu mem chk clk ⇒ match alu with
- [ mk_alu_HC08 acclow indxlow _ _ _ vfl hfl _ nfl zfl cfl irqfl ⇒
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem pc_reset_h)
- (mem_read_abs t mem pc_reset_l) in
- mk_any_status HC08 t
- (mk_alu_HC08
- (* acc_low: inv. *) acclow (* indx_low: inv. *) indxlow (* indx_high: reset *) 〈x0,x0〉
- (* sp: reset *) sp_reset (* pc: reset+fetch *) fetched_pc
- (* V: inv. *) vfl (* H: inv. *) hfl (* I: reset *) true
- (* N: inv. *) nfl (* Z: inv. *) zfl (* C: inv. *) cfl (* IRQ: inv *) irqfl)
- (* mem: inv. *) mem
- (* chk: inv. *) chk
- (* clk: reset *) (None ?) ]]
-(* HCS08: parzialmente non deterministico *)
- | HCS08 ⇒ λs:any_status HCS08 t.match s with
- [ mk_any_status alu mem chk clk ⇒ match alu with
- [ mk_alu_HC08 acclow indxlow _ _ _ vfl hfl _ nfl zfl cfl irqfl ⇒
- let fetched_pc ≝ mk_word16 (mem_read_abs t mem pc_reset_h)
- (mem_read_abs t mem pc_reset_l) in
- mk_any_status HCS08 t
- (mk_alu_HC08
- (* acc_low: inv. *) acclow (* indx_low: inv. *) indxlow (* indx_high: reset *) 〈x0,x0〉
- (* sp: reset *) sp_reset (* pc: reset+fetch *) fetched_pc
- (* V: inv. *) vfl (* H: inv. *) hfl (* I: reset *) true
- (* N: inv. *) nfl (* Z: inv. *) zfl (* C: inv. *) cfl (* IRQ: inv *) irqfl)
- (* mem: inv. *) mem
- (* chk: inv. *) chk
- (* clk: reset *) (None ?) ]]
-(* RS08: deterministico *)
- | RS08 ⇒ λs:any_status RS08 t.match s with
- [ mk_any_status alu mem chk clk ⇒ match alu with
- [ mk_alu_RS08 _ _ pcm _ _ _ _ _ ⇒
- mk_any_status RS08 t
- (mk_alu_RS08
- (* acc_low: reset *) 〈x0,x0〉
- (* pc: reset *) (and_w16 pc_RS08_reset pcm) pcm
- (* spc: reset *) (and_w16 pc_RS08_reset pcm)
- (* xm: reset *) 〈x0,x0〉 (* psm: reset *) 〈x8,x0〉
- (* Z: reset *) false (* C: reset *) false)
- (* mem: inv. *) mem
- (* chk: inv. *) chk
- (* clk: reset *) (None ?) ]]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/load_write.ma".
-
-(* ************************************************ *)
-(* LOGICHE AUSILIARE CHE ACCOMUNANO PIU' OPERAZIONI *)
-(* ************************************************ *)
-
-(* NB: dentro il codice i commenti cercano di spiegare la logica
- secondo quanto riportato dalle specifiche delle mcu *)
-
-(* NB: notare che tranne nei casi in cui PC viene modificato esplicitamente
- il suo avanzamento viene delegato totalmente agli strati inferiori
- I) avanzamento dovuto al decode degli op (fetch)
- II) avanzamento dovuto al caricamento degli argomenti (multi_mode_load/write)
- la modifica effettiva avviene poi centralizzata in tick *)
-
-(* A = [true] fAMC(A,M,C), [false] A *)
-(* cioe' in caso di false l'operazione viene eseguita ma modifica solo i flag *)
-(* fAMC e' la logica da applicare: somma con/senza carry *)
-ndefinition execute_ADC_ADD_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λsetflag:bool.
-λfAMC:byte8 → byte8 → bool → ProdT byte8 bool.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- let A_op ≝ get_acc_8_low_reg m t s_tmp1 in
- match fAMC A_op M_op (get_c_flag m t s_tmp1) with
- [ pair R_op carry ⇒
- let A7 ≝ MSB_b8 A_op in let M7 ≝ MSB_b8 M_op in let R7 ≝ MSB_b8 R_op in
- let A3 ≝ MSB_ex (b8l A_op) in let M3 ≝ MSB_ex (b8l M_op) in let R3 ≝ MSB_ex (b8l R_op) in
- (* A = [true] fAMC(A,M,C), [false] A *)
- let s_tmp2 ≝ match setflag with [ true ⇒ set_acc_8_low_reg m t s_tmp1 R_op | false ⇒ s_tmp1 ] in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 R_op 〈x0,x0〉) in
- (* C = A7&M7 | M7&nR7 | nR7&A7 *)
- let s_tmp4 ≝ set_c_flag m t s_tmp3 ((A7⊗M7) ⊕ (M7⊗(⊖R7)) ⊕ ((⊖R7)⊗A7)) in
- (* N = R7 *)
- let s_tmp5 ≝ setweak_n_flag m t s_tmp4 R7 in
- (* H = A3&M3 | M3&nR3 | nR3&A3 *)
- let s_tmp6 ≝ setweak_h_flag m t s_tmp5 ((A3⊗M3) ⊕ (M3⊗(⊖R3)) ⊕ ((⊖R3)⊗A3)) in
- (* V = A7&M7&nR7 | nA7&nM7&R7 *)
- let s_tmp7 ≝ setweak_v_flag m t s_tmp6 ((A7⊗M7⊗(⊖R7)) ⊕ ((⊖A7)⊗(⊖M7)⊗R7)) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp7 new_pc) ]]).
-
-(* A = [true] fAM(A,M), [false] A *)
-(* cioe' in caso di false l'operazione viene eseguita ma modifica solo i flag *)
-(* fAM e' la logica da applicare: and/xor/or *)
-ndefinition execute_AND_BIT_EOR_ORA_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λsetflag:bool.
-λfAM:byte8 → byte8 → byte8.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- let R_op ≝ fAM (get_acc_8_low_reg m t s_tmp1) M_op in
- (* A = [true] fAM(A,M), [false] A *)
- let s_tmp2 ≝ match setflag with [ true ⇒ set_acc_8_low_reg m t s_tmp1 R_op | false ⇒ s_tmp1 ] in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 R_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_b8 R_op) in
- (* V = 0 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc) ]).
-
-(* M = fMC(M,C) *)
-(* fMC e' la logica da applicare: rc_/ro_/sh_ *)
-ndefinition execute_ASL_ASR_LSR_ROL_ROR_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
-λfMC:byte8 → bool → ProdT byte8 bool.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op _ ⇒
- match fMC M_op (get_c_flag m t s_tmp1) with [ pair R_op carry ⇒
- (* M = fMC(M,C) *)
- opt_map … (multi_mode_write true m t s_tmp1 cur_pc i R_op)
- (λS_PC.match S_PC with
- [ pair s_tmp2 new_pc ⇒
- (* C = carry *)
- let s_tmp3 ≝ set_c_flag m t s_tmp2 carry in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp4 ≝ set_z_flag m t s_tmp3 (eq_b8 R_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp5 ≝ setweak_n_flag m t s_tmp4 (MSB_b8 R_op) in
- (* V = R7 ⊙ carry *)
- let s_tmp6 ≝ setweak_v_flag m t s_tmp5 ((MSB_b8 R_op) ⊙ carry) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp6 new_pc) ])]]).
-
-(* estensione del segno byte → word *)
-ndefinition byte_extension ≝
-λb:byte8.〈match MSB_b8 b with [ true ⇒ 〈xF,xF〉 | false ⇒ 〈x0,x0〉 ]:b〉.
-
-(* branch con byte+estensione segno *)
-ndefinition branched_pc ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcur_pc:word16.λb:byte8.
- get_pc_reg m t (set_pc_reg m t s (plus_w16_d_d cur_pc (byte_extension b))).
-
-(* if COND=1 branch *)
-(* tutti i branch calcoleranno la condizione e la passeranno qui *)
-ndefinition execute_any_BRANCH ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λfCOND:bool.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- (* if true, branch *)
- match fCOND with
- (* newpc = nextpc + rel *)
- [ true ⇒ Some ? (pair … s_tmp1 (branched_pc m t s_tmp1 new_pc M_op))
- (* newpc = nextpc *)
- | false ⇒ Some ? (pair … s_tmp1 new_pc) ]]).
-
-(* Mn = filtered optval *)
-(* il chiamante passa 0x00 per azzerare, 0xFF per impostare il bit di M *)
-ndefinition execute_BCLRn_BSETn_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λoptval:byte8.
- (* Mn = filtered optval *)
- opt_map … (multi_mode_write true m t s cur_pc i optval)
- (λS_PC.match S_PC with
- (* newpc = nextpc *)
- [ pair s_tmp1 new_pc ⇒ Some ? (pair … s_tmp1 new_pc) ]).
-
-(* if COND(Mn) branch *)
-(* il chiamante passa la logica da testare (0x00,¬0x00) e poi si salta *)
-ndefinition execute_BRCLRn_BRSETn_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λfCOND:byte8 → bool.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒ match M_op with
- [ mk_word16 MH_op ML_op ⇒
- (* if COND(Mn) branch *)
- match fCOND MH_op with
- (* newpc = nextpc + rel *)
- [ true ⇒ Some ? (pair … s_tmp1 (branched_pc m t s_tmp1 new_pc ML_op))
- (* newpc = nextpc *)
- | false ⇒ Some ? (pair … s_tmp1 new_pc) ]]]).
-
-(* M = fM(M) *)
-(* fM e' la logica da applicare: not/neg/++/-- *)
-ndefinition execute_COM_DEC_INC_NEG_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
-λfM:byte8 → byte8.λfV:bool → bool → bool.λfC:bool → byte8 → bool.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op _ ⇒
- let R_op ≝ fM M_op in
- (* M = fM(M) *)
- opt_map … (multi_mode_write true m t s_tmp1 cur_pc i R_op)
- (λS_PC.match S_PC with
- [ pair s_tmp2 new_pc ⇒
- (* C = fCR (C,R) *)
- let s_tmp3 ≝ set_c_flag m t s_tmp2 (fC (get_c_flag m t s_tmp2) R_op) in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp4 ≝ set_z_flag m t s_tmp3 (eq_b8 R_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp5 ≝ setweak_n_flag m t s_tmp4 (MSB_b8 R_op) in
- (* V = fV (M7,R7) *)
- let s_tmp6 ≝ setweak_v_flag m t s_tmp5 (fV (MSB_b8 M_op) (MSB_b8 R_op)) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp6 new_pc) ])]).
-
-(* A = [true] fAMC(A,M,C), [false] A *)
-(* cioe' in caso di false l'operazione viene eseguita ma modifica solo i flag *)
-(* fAMC e' la logica da applicare: sottrazione con/senza carry *)
-ndefinition execute_SBC_SUB_aux ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.λsetflag:bool.
-λfAMC:byte8 → byte8 → bool → ProdT byte8 bool.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- let A_op ≝ get_acc_8_low_reg m t s_tmp1 in
- match fAMC A_op M_op (get_c_flag m t s_tmp1) with
- [ pair R_op carry ⇒
- let A7 ≝ MSB_b8 A_op in let M7 ≝ MSB_b8 M_op in let R7 ≝ MSB_b8 R_op in
- (* A = [true] fAMC(A,M,C), [false] A *)
- let s_tmp2 ≝ match setflag with [ true ⇒ set_acc_8_low_reg m t s_tmp1 R_op | false ⇒ s_tmp1 ] in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 R_op 〈x0,x0〉) in
- (* C = nA7&M7 | M7&R7 | R7&nA7 *)
- let s_tmp4 ≝ set_c_flag m t s_tmp3 (((⊖A7)⊗M7) ⊕ (M7⊗R7) ⊕ (R7⊗(⊖A7))) in
- (* N = R7 *)
- let s_tmp5 ≝ setweak_n_flag m t s_tmp4 R7 in
- (* V = A7&nM7&nR7 | nA7&M7&R7 *)
- let s_tmp6 ≝ setweak_v_flag m t s_tmp5 ((A7⊗(⊖M7)⊗(⊖R7)) ⊕ ((⊖A7)⊗M7⊗R7)) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp6 new_pc) ]]).
-
-(* il classico push *)
-ndefinition aux_push ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λval:byte8.
- opt_map … (get_sp_reg m t s)
- (* [SP] = val *)
- (λSP_op.opt_map … (memory_filter_write m t s SP_op val)
- (* SP -- *)
- (λs_tmp1.opt_map … (set_sp_reg m t s_tmp1 (pred_w16 SP_op))
- (λs_tmp2.Some ? s_tmp2))).
-
-(* il classico pop *)
-(* NB: l'incremento di SP deve essere filtrato dalla ALU, quindi get(set(SP)) *)
-ndefinition aux_pop ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- opt_map … (get_sp_reg m t s)
- (* SP ++ *)
- (λSP_op.opt_map … (set_sp_reg m t s (succ_w16 SP_op))
- (λs_tmp1.opt_map … (get_sp_reg m t s_tmp1)
- (* val = [SP] *)
- (λSP_op'.opt_map … (memory_filter_read m t s_tmp1 SP_op')
- (λval.Some ? (pair … s_tmp1 val))))).
-
-(* CCR corrisponde a V11HINZC e cmq 1 se un flag non esiste *)
-(* i flag mantengono posizione costante nelle varie ALU, e se non sono
- implementati corrispondono a 1 *)
-ndefinition aux_get_CCR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
-let V_comp ≝ match get_v_flag m t s with
- [ None ⇒ 〈x8,x0〉 | Some V_val ⇒ match V_val with [ true ⇒ 〈x8,x0〉 | false ⇒ 〈x0,x0〉 ]] in
-let H_comp ≝ match get_h_flag m t s with
- [ None ⇒ 〈x1,x0〉 | Some H_val ⇒ match H_val with [ true ⇒ 〈x1,x0〉 | false ⇒ 〈x0,x0〉 ]] in
-let I_comp ≝ match get_i_flag m t s with
- [ None ⇒ 〈x0,x8〉 | Some I_val ⇒ match I_val with [ true ⇒ 〈x0,x8〉 | false ⇒ 〈x0,x0〉 ]] in
-let N_comp ≝ match get_n_flag m t s with
- [ None ⇒ 〈x0,x4〉 | Some N_val ⇒ match N_val with [ true ⇒ 〈x0,x4〉 | false ⇒ 〈x0,x0〉 ]] in
-let Z_comp ≝ match get_z_flag m t s with
- [ true ⇒ 〈x0,x2〉 | false ⇒ 〈x0,x0〉 ] in
-let C_comp ≝ match get_c_flag m t s with
- [ true ⇒ 〈x0,x1〉 | false ⇒ 〈x0,x0〉 ] in
-or_b8 〈x6,x0〉 (or_b8 V_comp (or_b8 H_comp (or_b8 I_comp (or_b8 N_comp (or_b8 Z_comp C_comp))))).
-
-(* CCR corrisponde a V11HINZC *)
-(* i flag mantengono posizione costante nelle varie ALU, e se non sono
- implementati si puo' usare tranquillamente setweak *)
-ndefinition aux_set_CCR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λCCR:byte8.
- let s_tmp1 ≝ set_c_flag m t s (eq_b8 〈x0,x1〉 (and_b8 〈x0,x1〉 CCR)) in
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 〈x0,x2〉 (and_b8 〈x0,x2〉 CCR)) in
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 (eq_b8 〈x0,x4〉 (and_b8 〈x0,x4〉 CCR)) in
- let s_tmp4 ≝ setweak_i_flag m t s_tmp3 (eq_b8 〈x0,x8〉 (and_b8 〈x0,x8〉 CCR)) in
- let s_tmp5 ≝ setweak_h_flag m t s_tmp4 (eq_b8 〈x1,x0〉 (and_b8 〈x1,x0〉 CCR)) in
- let s_tmp6 ≝ setweak_v_flag m t s_tmp5 (eq_b8 〈x8,x0〉 (and_b8 〈x8,x0〉 CCR)) in
- s_tmp6.
-
-(* **************** *)
-(* LOGICA DELLA ALU *)
-(* **************** *)
-
-(* A = A + M + C *)
-ndefinition execute_ADC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ADC_ADD_aux m t s i cur_pc true (λA_op.λM_op.λC_op.plus_b8_dc_dc A_op M_op C_op).
-
-(* A = A + M *)
-ndefinition execute_ADD ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ADC_ADD_aux m t s i cur_pc true (λA_op.λM_op.λC_op.plus_b8_dc_dc A_op M_op false).
-
-(* SP += extended M *)
-ndefinition execute_AIS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (get_sp_reg m t s_tmp1)
- (* SP += extended M *)
- (λSP_op.opt_map … (set_sp_reg m t s_tmp1 (plus_w16_d_d SP_op (byte_extension M_op)))
- (λs_tmp2.Some ? (pair … s_tmp2 new_pc))) ]).
-
-(* H:X += extended M *)
-ndefinition execute_AIX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (get_indX_16_reg m t s_tmp1)
- (* H:X += extended M *)
- (λHX_op.opt_map … (set_indX_16_reg m t s_tmp1 (plus_w16_d_d HX_op (byte_extension M_op)))
- (λs_tmp2.Some ? (pair … s_tmp2 new_pc))) ]).
-
-(* A = A & M *)
-ndefinition execute_AND ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_AND_BIT_EOR_ORA_aux m t s i cur_pc true and_b8.
-
-(* M = C' <- rcl M <- 0 *)
-ndefinition execute_ASL ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ASL_ASR_LSR_ROL_ROR_aux m t s i cur_pc (λM_op.λC_op.rcl_b8 M_op false).
-
-(* M = M7 -> rcr M -> C' *)
-ndefinition execute_ASR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ASL_ASR_LSR_ROL_ROR_aux m t s i cur_pc (λM_op.λC_op.rcr_b8 M_op (MSB_b8 M_op)).
-
-(* if C=0, branch *)
-ndefinition execute_BCC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc (⊖(get_c_flag m t s)).
-
-(* Mn = 0 *)
-ndefinition execute_BCLRn ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_BCLRn_BSETn_aux m t s i cur_pc 〈x0,x0〉.
-
-(* if C=1, branch *)
-ndefinition execute_BCS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc (get_c_flag m t s).
-
-(* if Z=1, branch *)
-ndefinition execute_BEQ ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc (get_z_flag m t s).
-
-(* if N⊙V=0, branch *)
-ndefinition execute_BGE ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.opt_map … (get_v_flag m t s)
- (λV_op.execute_any_BRANCH m t s i cur_pc (⊖(N_op ⊙ V_op)))).
-
-(* BGND mode *)
-ndefinition execute_BGND ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … s cur_pc).
-
-(* if Z|N⊙V=0, branch *)
-ndefinition execute_BGT ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.opt_map … (get_v_flag m t s)
- (λV_op.execute_any_BRANCH m t s i cur_pc (⊖((get_z_flag m t s) ⊕ (N_op ⊙ V_op))))).
-
-(* if H=0, branch *)
-ndefinition execute_BHCC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_h_flag m t s)
- (λH_op.execute_any_BRANCH m t s i cur_pc (⊖H_op)).
-
-(* if H=1, branch *)
-ndefinition execute_BHCS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_h_flag m t s)
- (λH_op.execute_any_BRANCH m t s i cur_pc H_op).
-
-(* if C|Z=0, branch *)
-ndefinition execute_BHI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc (⊖((get_c_flag m t s) ⊕ (get_z_flag m t s))).
-
-(* if nIRQ=1, branch NB: irqflag e' un negato del pin *)
-ndefinition execute_BIH ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_irq_flag m t s)
- (λIRQ_op.execute_any_BRANCH m t s i cur_pc (⊖IRQ_op)).
-
-(* if nIRQ=0, branch NB: irqflag e' un negato del pin *)
-ndefinition execute_BIL ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_irq_flag m t s)
- (λIRQ_op.execute_any_BRANCH m t s i cur_pc IRQ_op).
-
-(* flags = A & M *)
-ndefinition execute_BIT ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_AND_BIT_EOR_ORA_aux m t s i cur_pc false and_b8.
-
-(* if Z|N⊙V=1, branch *)
-ndefinition execute_BLE ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.opt_map … (get_v_flag m t s)
- (λV_op.execute_any_BRANCH m t s i cur_pc ((get_z_flag m t s) ⊕ (N_op ⊙ V_op)))).
-
-(* if C|Z=1, branch *)
-ndefinition execute_BLS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc ((get_c_flag m t s) ⊕ (get_z_flag m t s)).
-
-(* if N⊙V=1, branch *)
-ndefinition execute_BLT ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.opt_map … (get_v_flag m t s)
- (λV_op.execute_any_BRANCH m t s i cur_pc (N_op ⊙ V_op))).
-
-(* if I=0, branch *)
-ndefinition execute_BMC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_i_flag m t s)
- (λI_op.execute_any_BRANCH m t s i cur_pc (⊖I_op)).
-
-(* if N=1, branch *)
-ndefinition execute_BMI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.execute_any_BRANCH m t s i cur_pc N_op).
-
-(* if I=1, branch *)
-ndefinition execute_BMS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_i_flag m t s)
- (λI_op.execute_any_BRANCH m t s i cur_pc I_op).
-
-(* if Z=0, branch *)
-ndefinition execute_BNE ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc (⊖(get_z_flag m t s)).
-
-(* if N=0, branch *)
-ndefinition execute_BPL ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_n_flag m t s)
- (λN_op.execute_any_BRANCH m t s i cur_pc (⊖N_op)).
-
-(* branch always *)
-ndefinition execute_BRA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc true.
-
-(* if Mn=0 branch *)
-ndefinition execute_BRCLRn ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_BRCLRn_BRSETn_aux m t s i cur_pc
- (λMn_op.eq_b8 Mn_op 〈x0,x0〉).
-
-(* branch never... come se fosse un nop da 2 byte *)
-ndefinition execute_BRN ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_any_BRANCH m t s i cur_pc false.
-
-(* if Mn=1 branch *)
-ndefinition execute_BRSETn ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_BRCLRn_BRSETn_aux m t s i cur_pc
- (λMn_op.⊖(eq_b8 Mn_op 〈x0,x0〉)).
-
-(* Mn = 1 *)
-ndefinition execute_BSETn ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_BCLRn_BSETn_aux m t s i cur_pc 〈xF,xF〉.
-
-(* branch to subroutine *)
-(* HC05/HC08/HCS08 si appoggiano allo stack, RS08 a SPC *)
-ndefinition execute_BSR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t .λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒ let aux ≝
- (* push (new_pc low) *)
- opt_map … (aux_push m t s_tmp1 (w16l new_pc))
- (* push (new_pc high) *)
- (λs_tmp2.opt_map … (aux_push m t s_tmp2 (w16h new_pc))
- (* new_pc = new_pc + rel *)
- (λs_tmp3.Some ? (pair … s_tmp3 (branched_pc m t s_tmp3 new_pc M_op))))
- in match m with
- [ HC05 ⇒ aux | HC08 ⇒ aux | HCS08 ⇒ aux
- | RS08 ⇒
- (* SPC = new_pc *)
- opt_map … (set_spc_reg m t s_tmp1 new_pc)
- (* new_pc = new_pc + rel *)
- (λs_tmp2.Some ? (pair … s_tmp2 (branched_pc m t s_tmp2 new_pc M_op)))
- ]]).
-
-(* if A=M, branch *)
-ndefinition execute_CBEQA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- match M_op with
- [ mk_word16 MH_op ML_op ⇒
- (* if A=M, branch *)
- match eq_b8 (get_acc_8_low_reg m t s_tmp1) MH_op with
- (* new_pc = new_pc + rel *)
- [ true ⇒ Some ? (pair … s_tmp1 (branched_pc m t s_tmp1 new_pc ML_op))
- (* new_pc = new_pc *)
- | false ⇒ Some ? (pair … s_tmp1 new_pc)
- ]]]).
-
-(* if X=M, branch *)
-ndefinition execute_CBEQX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- match M_op with
- [ mk_word16 MH_op ML_op ⇒
- opt_map … (get_indX_8_low_reg m t s_tmp1)
- (* if X=M, branch *)
- (λX_op.match eq_b8 X_op MH_op with
- (* new_pc = new_pc + rel *)
- [ true ⇒ Some ? (pair … s_tmp1 (branched_pc m t s_tmp1 new_pc ML_op))
- (* new_pc = new_pc *)
- | false ⇒ Some ? (pair … s_tmp1 new_pc)
- ])]]).
-
-(* C = 0 *)
-ndefinition execute_CLC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (set_c_flag m t s false) cur_pc).
-
-(* I = 0 *)
-ndefinition execute_CLI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (set_i_flag m t s false)
- (λs_tmp.Some ? (pair … s_tmp cur_pc)).
-
-(* M = 0 *)
-ndefinition execute_CLR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* M = 0 *)
- opt_map … (multi_mode_write true m t s cur_pc i 〈x0,x0〉)
- (λS_PC.match S_PC with
- [ pair s_tmp1 new_pc ⇒
- (* Z = 1 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 true in
- (* N = 0 *)
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 false in
- (* V = 0 *)
- let s_tmp4 ≝ setweak_v_flag m t s_tmp3 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp4 new_pc) ]).
-
-(* flags = A - M *)
-ndefinition execute_CMP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_SBC_SUB_aux m t s i cur_pc false (λA_op.λM_op.λC_op.plus_b8_dc_dc A_op (compl_b8 M_op) false).
-
-(* M = not M *)
-ndefinition execute_COM ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_COM_DEC_INC_NEG_aux m t s i cur_pc not_b8
- (* fV = 0 *)
- (λM7.λR7.false)
- (* fC = 1 *)
- (λC_op.λR_op.true).
-
-(* flags = H:X - M *)
-ndefinition execute_CPHX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (get_indX_16_reg m t s_tmp1)
- (λX_op.
- match plus_w16_dc_dc X_op (compl_w16 M_op) false with
- [ pair R_op carry ⇒
- let X15 ≝ MSB_w16 X_op in let M15 ≝ MSB_w16 M_op in let R15 ≝ MSB_w16 R_op in
- (* Z = nR15&nR14&nR13&nR12&nR11&nR10&nR9&nR8&nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_w16 R_op 〈〈x0,x0〉:〈x0,x0〉〉) in
- (* C = nX15&M15 | M15&R15 | R15&nX15 *)
- let s_tmp3 ≝ set_c_flag m t s_tmp2 (((⊖X15)⊗M15) ⊕ (M15⊗R15) ⊕ (R15⊗(⊖X15))) in
- (* N = R15 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 R15 in
- (* V = X15&nM15&nR15 | nX15&M15&R15 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 ((X15⊗(⊖M15)⊗(⊖R15)) ⊕ ((⊖X15)⊗M15⊗R15)) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc) ] ) ]).
-
-(* flags = X - M *)
-ndefinition execute_CPX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (get_indX_8_low_reg m t s_tmp1)
- (λX_op.
- match plus_b8_dc_dc X_op (compl_b8 M_op) false with
- [ pair R_op carry ⇒
- let X7 ≝ MSB_b8 X_op in let M7 ≝ MSB_b8 M_op in let R7 ≝ MSB_b8 R_op in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 R_op 〈x0,x0〉) in
- (* C = nX7&M7 | M7&R7 | R7&nX7 *)
- let s_tmp3 ≝ set_c_flag m t s_tmp2 (((⊖X7)⊗M7) ⊕ (M7⊗R7) ⊕ (R7⊗(⊖X7))) in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 R7 in
- (* V = X7&nM7&nR7 | nX7&M7&R7 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 ((X7⊗(⊖M7)⊗(⊖R7)) ⊕ ((⊖X7)⊗M7⊗R7)) in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc) ] ) ]).
-
-(* decimal adjiust A *)
-(* per i dettagli vedere daa_b8 (modulo byte8) *)
-ndefinition execute_DAA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_h_flag m t s)
- (λH.
- let M_op ≝ get_acc_8_low_reg m t s in
- match daa_b8 H (get_c_flag m t s) M_op with
- [ pair R_op carry ⇒
- (* A = R *)
- let s_tmp1 ≝ set_acc_8_low_reg m t s R_op in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 R_op 〈x0,x0〉) in
- (* C = carry *)
- let s_tmp3 ≝ set_c_flag m t s_tmp2 carry in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_b8 R_op) in
- (* V = M7 ⊙ R7 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 ((MSB_b8 M_op) ⊙ (MSB_b8 R_op)) in
- (* newpc = curpc *)
- Some ? (pair … s_tmp5 cur_pc) ]).
-
-(* if (--M)≠0, branch *)
-ndefinition execute_DBNZ ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- match M_op with
- [ mk_word16 MH_op ML_op ⇒
- (* --M *)
- let MH_op' ≝ pred_b8 MH_op in
- opt_map … (multi_mode_write true m t s_tmp1 cur_pc i MH_op')
- (λS_PC.match S_PC with
- [ pair s_tmp2 _ ⇒
- (* if (--M)≠0, branch *)
- match eq_b8 MH_op' 〈x0,x0〉 with
- (* new_pc = new_pc *)
- [ true ⇒ Some ? (pair … s_tmp2 new_pc)
- (* new_pc = new_pc + rel *)
- | false ⇒ Some ? (pair … s_tmp2 (branched_pc m t s_tmp2 new_pc ML_op)) ]])]]).
-
-(* M = M - 1 *)
-ndefinition execute_DEC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_COM_DEC_INC_NEG_aux m t s i cur_pc pred_b8
- (* fV = M7&nR7 *)
- (λM7.λR7.M7⊗(⊖R7))
- (* fC = C *)
- (λC_op.λR_op.C_op).
-
-(* A = H:A/X, H = H:AmodX se non c'e' overflow, altrimenti invariati *)
-(* per i dettagli vedere div_b8 (modulo word16) *)
-ndefinition execute_DIV ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_8_high_reg m t s)
- (λH_op.opt_map … (get_indX_8_low_reg m t s)
- (λX_op.match div_b8 〈H_op:(get_acc_8_low_reg m t s)〉 X_op with
- [ triple quoz rest overflow ⇒
- (* C = overflow *)
- let s_tmp1 ≝ set_c_flag m t s overflow in
- (* A = A o H:A/X *)
- let s_tmp2 ≝ match overflow with
- [ true ⇒ s_tmp1
- | false ⇒ set_acc_8_low_reg m t s_tmp1 quoz ] in
- (* Z = nA7&nA6&nA5&nA4&nA3&nA2&nA1&nA0 *)
- (* NB: che A sia cambiato o no, lo testa *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 (get_acc_8_low_reg m t s_tmp2) 〈x0,x0〉) in
- (* H = H o H:AmodX *)
- opt_map … (match overflow with
- [ true ⇒ Some ? s_tmp3
- | false ⇒ set_indX_8_high_reg m t s_tmp3 rest])
- (λs_tmp4.Some ? (pair … s_tmp4 cur_pc)) ])).
-
-(* A = A ⊙ M *)
-ndefinition execute_EOR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_AND_BIT_EOR_ORA_aux m t s i cur_pc true xor_b8.
-
-(* M = M + 1 *)
-ndefinition execute_INC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_COM_DEC_INC_NEG_aux m t s i cur_pc succ_b8
- (* fV = nM7&R7 *)
- (λM7.λR7.(⊖M7)⊗R7)
- (* fC = C *)
- (λC_op.λR_op.C_op).
-
-(* jmp, il nuovo indirizzo e' una WORD *)
-ndefinition execute_JMP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.
- (* newpc = M_op *)
- Some ? (pair … (fst3T ??? S_M_PC) (snd3T ??? S_M_PC))).
-
-(* jump to subroutine *)
-(* HC05/HC08/HCS08 si appoggiano allo stack, RS08 a SPC *)
-ndefinition execute_JSR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒ let aux ≝
- (* push (new_pc low) *)
- opt_map … (aux_push m t s_tmp1 (w16l new_pc))
- (* push (new_pc high) *)
- (λs_tmp2.opt_map … (aux_push m t s_tmp2 (w16h new_pc))
- (* newpc = M_op *)
- (λs_tmp3.Some ? (pair … s_tmp3 M_op)))
- in match m with
- [ HC05 ⇒ aux | HC08 ⇒ aux | HCS08 ⇒ aux
- | RS08 ⇒
- (* SPC = new_pc *)
- opt_map … (set_spc_reg m t s_tmp1 new_pc)
- (* newpc = M_op *)
- (λs_tmp2.Some ? (pair … s_tmp2 M_op))
- ]]).
-
-(* A = M *)
-ndefinition execute_LDA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- (* A = M *)
- let s_tmp2 ≝ set_acc_8_low_reg m t s_tmp1 M_op in
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 M_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_b8 M_op) in
- (* V = 0 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc) ]).
-
-(* H:X = M *)
-ndefinition execute_LDHX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load false m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (set_indX_16_reg m t s_tmp1 M_op)
- (λs_tmp2.
- (* Z = nR15&nR14&nR13nR12&nR11&nR10&nR9&nR8nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_w16 M_op 〈〈x0,x0〉:〈x0,x0〉〉) in
- (* N = R15 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_w16 M_op) in
- (* V = 0 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc)) ]).
-
-(* X = M *)
-ndefinition execute_LDX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- opt_map … (set_indX_8_low_reg m t s_tmp1 M_op)
- (λs_tmp2.
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 M_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_b8 M_op) in
- (* V = 0 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc)) ]).
-
-(* M = 0 -> rcr M -> C' *)
-ndefinition execute_LSR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ASL_ASR_LSR_ROL_ROR_aux m t s i cur_pc (λM_op.λC_op.rcr_b8 M_op false).
-
-(* M2 = M1 *)
-ndefinition execute_MOV ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* R_op = M1 *)
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_R_PC.match S_R_PC with
- [ triple s_tmp1 R_op tmp_pc ⇒
- (* M2 = R_op *)
- opt_map … (multi_mode_write true m t s_tmp1 tmp_pc i R_op)
- (λS_PC.match S_PC with
- [ pair s_tmp2 new_pc ⇒
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp3 ≝ set_z_flag m t s_tmp2 (eq_b8 R_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp4 ≝ setweak_n_flag m t s_tmp3 (MSB_b8 R_op) in
- (* V = 0 *)
- let s_tmp5 ≝ setweak_v_flag m t s_tmp4 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp5 new_pc)])]).
-
-(* X:A = X * A *)
-ndefinition execute_MUL ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_8_low_reg m t s)
- (λX_op.let R_op ≝ mul_b8 X_op (get_acc_8_low_reg m t s) in
- opt_map … (set_indX_8_low_reg m t s (w16h R_op))
- (λs_tmp.Some ? (pair … (set_acc_8_low_reg m t s_tmp (w16l R_op)) cur_pc))).
-
-(* M = compl M *)
-ndefinition execute_NEG ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_COM_DEC_INC_NEG_aux m t s i cur_pc compl_b8
- (* fV = M7&R7 *)
- (λM7.λR7.M7⊗R7)
- (* fC = R7|R6|R5|R4|R3|R2|R1|R0 *)
- (λC_op.λR_op.⊖(eq_b8 R_op 〈x0,x0〉)).
-
-(* nulla *)
-ndefinition execute_NOP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … s cur_pc).
-
-(* A = (mk_byte8 (b8l A) (b8h A)) *)
-(* cioe' swap del nibble alto/nibble basso di A *)
-ndefinition execute_NSA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- match get_acc_8_low_reg m t s with [ mk_byte8 ah al ⇒
- (* A = (mk_byte8 (b8l A) (b8h A)) *)
- Some ? (pair … (set_acc_8_low_reg m t s 〈al,ah〉) cur_pc) ].
-
-(* A = A | M *)
-ndefinition execute_ORA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_AND_BIT_EOR_ORA_aux m t s i cur_pc true or_b8.
-
-(* push A *)
-ndefinition execute_PSHA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (aux_push m t s (get_acc_8_low_reg m t s))
- (λs_tmp1.Some ? (pair … s_tmp1 cur_pc)).
-
-(* push H *)
-ndefinition execute_PSHH ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_8_high_reg m t s)
- (λH_op.opt_map … (aux_push m t s H_op)
- (λs_tmp1.Some ? (pair … s_tmp1 cur_pc))).
-
-(* push X *)
-ndefinition execute_PSHX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_8_low_reg m t s)
- (λH_op.opt_map … (aux_push m t s H_op)
- (λs_tmp1.Some ? (pair … s_tmp1 cur_pc))).
-
-(* pop A *)
-ndefinition execute_PULA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (aux_pop m t s)
- (λS_and_A.match S_and_A with [ pair s_tmp1 A_op ⇒
- Some ? (pair … (set_acc_8_low_reg m t s_tmp1 A_op) cur_pc) ]).
-
-(* pop H *)
-ndefinition execute_PULH ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (aux_pop m t s)
- (λS_and_H.match S_and_H with [ pair s_tmp1 H_op ⇒
- opt_map … (set_indX_8_high_reg m t s_tmp1 H_op)
- (λs_tmp2.Some ? (pair … s_tmp2 cur_pc))]).
-
-(* pop X *)
-ndefinition execute_PULX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (aux_pop m t s)
- (λS_and_X.match S_and_X with [ pair s_tmp1 X_op ⇒
- opt_map … (set_indX_8_low_reg m t s_tmp1 X_op)
- (λs_tmp2.Some ? (pair … s_tmp2 cur_pc))]).
-
-(* M = C' <- rcl M <- C *)
-ndefinition execute_ROL ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ASL_ASR_LSR_ROL_ROR_aux m t s i cur_pc (λM_op.λC_op.rcl_b8 M_op C_op).
-
-(* M = C -> rcr M -> C' *)
-ndefinition execute_ROR ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_ASL_ASR_LSR_ROL_ROR_aux m t s i cur_pc (λM_op.λC_op.rcr_b8 M_op C_op).
-
-(* SP = 0xuuFF *)
-(* lascia inalterato il byte superiore di SP *)
-ndefinition execute_RSP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_sp_reg m t s)
- (λSP_op.match SP_op with [ mk_word16 sph spl ⇒
- opt_map … (set_sp_reg m t s 〈sph:〈xF,xF〉〉)
- (λs_tmp.Some ? (pair … s_tmp cur_pc))]).
-
-(* return from interrupt *)
-ndefinition execute_RTI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* pop (CCR) *)
- opt_map … (aux_pop m t s)
- (λS_and_CCR.match S_and_CCR with [ pair s_tmp1 CCR_op ⇒
- let s_tmp2 ≝ aux_set_CCR m t s_tmp1 CCR_op in
- (* pop (A) *)
- opt_map … (aux_pop m t s_tmp2)
- (λS_and_A.match S_and_A with [ pair s_tmp3 A_op ⇒
- let s_tmp4 ≝ set_acc_8_low_reg m t s_tmp3 A_op in
- (* pop (X) *)
- opt_map … (aux_pop m t s_tmp4)
- (λS_and_X.match S_and_X with [ pair s_tmp5 X_op ⇒
- opt_map … (set_indX_8_low_reg m t s_tmp5 X_op)
- (* pop (PC high) *)
- (λs_tmp6.opt_map … (aux_pop m t s_tmp6)
- (λS_and_PCH.match S_and_PCH with [ pair s_tmp7 PCH_op ⇒
- (* pop (PC low) *)
- opt_map … (aux_pop m t s_tmp7)
- (λS_and_PCL.match S_and_PCL with [ pair s_tmp8 PCL_op ⇒
- Some ? (pair … s_tmp8 〈PCH_op:PCL_op〉)])]))])])]).
-
-(* return from subroutine *)
-(* HC05/HC08/HCS08 si appoggia allo stack, RS08 si appoggia a SPC *)
-ndefinition execute_RTS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- let aux ≝
- (* pop (PC high) *)
- opt_map … (aux_pop m t s)
- (λS_and_PCH.match S_and_PCH with [ pair s_tmp1 PCH_op ⇒
- (* pop (PC low) *)
- opt_map … (aux_pop m t s_tmp1)
- (λS_and_PCL.match S_and_PCL with [ pair s_tmp2 PCL_op ⇒
- Some ? (pair … s_tmp2 〈PCH_op:PCL_op〉)])])
- in match m with
- [ HC05 ⇒ aux | HC08 ⇒ aux | HCS08 ⇒ aux
- | RS08 ⇒
- (* new_pc = SPC *)
- opt_map … (get_spc_reg m t s)
- (λSPC_op.Some ? (pair … s SPC_op))
- ].
-
-(* A = A - M - C *)
-ndefinition execute_SBC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_SBC_SUB_aux m t s i cur_pc true
- (λA_op.λM_op.λC_op.match plus_b8_dc_dc A_op (compl_b8 M_op) false with
- [ pair resb resc ⇒ match C_op with
- [ true ⇒ plus_b8_dc_dc resb 〈xF,xF〉 false
- | false ⇒ pair … resb resc ]]).
-
-(* C = 1 *)
-ndefinition execute_SEC ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (set_c_flag m t s true) cur_pc).
-
-(* I = 1 *)
-ndefinition execute_SEI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (set_i_flag m t s true)
- (λs_tmp.Some ? (pair … s_tmp cur_pc)).
-
-(* swap SPCh,A *)
-(* senso: nell'RS08 SPC non e' accessibile direttamente e come si possono
- fare subroutine annidate se RA (return address) e' salvato sempre in SPC?
- occore accedere a SPC e salvarne il contenuto *)
-ndefinition execute_SHA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_spc_reg m t s)
- (λSPC_op.opt_map … (set_spc_reg m t s 〈(get_acc_8_low_reg m t s):(w16l SPC_op)〉)
- (λs_tmp1.Some ? (pair … (set_acc_8_low_reg m t s_tmp1 (w16h SPC_op)) cur_pc))).
-
-(* swap SPCl,A *)
-(* senso: nell'RS08 SPC non e' accessibile direttamente e come si possono
- fare subroutine annidate se RA (return address) e' salvato sempre in SPC?
- occore accedere a SPC e salvarne il contenuto *)
-ndefinition execute_SLA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_spc_reg m t s)
- (λSPC_op.opt_map … (set_spc_reg m t s 〈(w16h SPC_op):(get_acc_8_low_reg m t s)〉)
- (λs_tmp1.Some ? (pair … (set_acc_8_low_reg m t s_tmp1 (w16l SPC_op)) cur_pc))).
-
-(* M = A *)
-ndefinition execute_STA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* M = A *)
- let A_op ≝ (get_acc_8_low_reg m t s) in
- opt_map … (multi_mode_write true m t s cur_pc i A_op)
- (λS_op_and_PC.match S_op_and_PC with
- [ pair s_tmp1 new_pc ⇒
- (* Z = nA7&nA6&nA5&nA4&nA3&nA2&nA1&nA0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 A_op 〈x0,x0〉) in
- (* N = A7 *)
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 (MSB_b8 A_op) in
- (* V = 0 *)
- let s_tmp4 ≝ setweak_v_flag m t s_tmp3 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp4 new_pc) ]).
-
-(* M = H:X *)
-ndefinition execute_STHX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* M = H:X *)
- opt_map … (get_indX_16_reg m t s)
- (λX_op.opt_map … (multi_mode_write false m t s cur_pc i X_op)
- (λS_op_and_PC.match S_op_and_PC with
- [ pair s_tmp1 new_pc ⇒
- (* Z = nR15&nR14&nR13nR12&nR11&nR10&nR9&nR8nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_w16 X_op 〈〈x0,x0〉:〈x0,x0〉〉) in
- (* N = R15 *)
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 (MSB_w16 X_op) in
- (* V = 0 *)
- let s_tmp4 ≝ setweak_v_flag m t s_tmp3 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp4 new_pc) ])).
-
-(* I = 0 *)
-ndefinition execute_STOP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (setweak_i_flag m t s false) cur_pc).
-
-(* M = X *)
-ndefinition execute_STX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* M = X *)
- opt_map … (get_indX_8_low_reg m t s)
- (λX_op.opt_map … (multi_mode_write true m t s cur_pc i X_op)
- (λS_op_and_PC.match S_op_and_PC with
- [ pair s_tmp1 new_pc ⇒
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 X_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 (MSB_b8 X_op) in
- (* V = 0 *)
- let s_tmp4 ≝ setweak_v_flag m t s_tmp3 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp4 new_pc) ])).
-
-(* A = A - M *)
-ndefinition execute_SUB ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- execute_SBC_SUB_aux m t s i cur_pc true (λA_op.λM_op.λC_op.plus_b8_dc_dc A_op (compl_b8 M_op) false).
-
-(* software interrupt *)
-ndefinition execute_SWI ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- (* indirizzo da cui caricare il nuovo pc *)
- let vector ≝ get_pc_reg m t (set_pc_reg m t s 〈〈xF,xF〉:〈xF,xC〉〉) in
- (* push (cur_pc low) *)
- opt_map … (aux_push m t s (w16l cur_pc))
- (* push (cur_pc high *)
- (λs_tmp1.opt_map … (aux_push m t s_tmp1 (w16h cur_pc))
- (λs_tmp2.opt_map … (get_indX_8_low_reg m t s_tmp2)
- (* push (X) *)
- (λX_op.opt_map … (aux_push m t s_tmp2 X_op)
- (* push (A) *)
- (λs_tmp3.opt_map … (aux_push m t s_tmp3 (get_acc_8_low_reg m t s_tmp3))
- (* push (CCR) *)
- (λs_tmp4.opt_map … (aux_push m t s_tmp4 (aux_get_CCR m t s_tmp4))
- (* I = 1 *)
- (λs_tmp5.opt_map … (set_i_flag m t s_tmp5 true)
- (* load from vector high *)
- (λs_tmp6.opt_map … (memory_filter_read m t s_tmp6 vector)
- (* load from vector low *)
- (λaddrh.opt_map … (memory_filter_read m t s_tmp6 (succ_w16 vector))
- (* newpc = [vector] *)
- (λaddrl.Some ? (pair … s_tmp6 〈addrh:addrl〉)))))))))).
-
-(* flags = A *)
-ndefinition execute_TAP ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (aux_set_CCR m t s (get_acc_8_low_reg m t s)) cur_pc).
-
-(* X = A *)
-ndefinition execute_TAX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (set_indX_8_low_reg m t s (get_acc_8_low_reg m t s))
- (λs_tmp.Some ? (pair … s_tmp cur_pc)).
-
-(* A = flags *)
-ndefinition execute_TPA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (set_acc_8_low_reg m t s (aux_get_CCR m t s)) cur_pc).
-
-(* flags = M - 0 *)
-(* implementata senza richiamare la sottrazione, la modifica dei flag
- e' immediata *)
-ndefinition execute_TST ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (multi_mode_load true m t s cur_pc i)
- (λS_M_PC.match S_M_PC with
- [ triple s_tmp1 M_op new_pc ⇒
- (* Z = nR7&nR6&nR5&nR4&nR3&nR2&nR1&nR0 *)
- let s_tmp2 ≝ set_z_flag m t s_tmp1 (eq_b8 M_op 〈x0,x0〉) in
- (* N = R7 *)
- let s_tmp3 ≝ setweak_n_flag m t s_tmp2 (MSB_b8 M_op) in
- (* V = 0 *)
- let s_tmp4 ≝ setweak_v_flag m t s_tmp3 false in
- (* newpc = nextpc *)
- Some ? (pair … s_tmp4 new_pc) ]).
-
-(* H:X = SP + 1 *)
-ndefinition execute_TSX ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_sp_reg m t s )
- (λSP_op.opt_map … (set_indX_16_reg m t s (succ_w16 SP_op))
- (* H:X = SP + 1 *)
- (λs_tmp.Some ? (pair … s_tmp cur_pc))).
-
-(* A = X *)
-ndefinition execute_TXA ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_8_low_reg m t s)
- (λX_op.Some ? (pair … (set_acc_8_low_reg m t s X_op) cur_pc)).
-
-(* SP = H:X - 1 *)
-ndefinition execute_TXS ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- opt_map … (get_indX_16_reg m t s )
- (λX_op.opt_map … (set_sp_reg m t s (pred_w16 X_op))
- (* SP = H:X - 1 *)
- (λs_tmp.Some ? (pair … s_tmp cur_pc))).
-
-(* I = 0 *)
-ndefinition execute_WAIT ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λi:instr_mode.λcur_pc:word16.
- Some ? (pair … (setweak_i_flag m t s false) cur_pc).
-
-(* **** *)
-(* TICK *)
-(* **** *)
-
-(* enumerazione delle possibili modalita' di sospensione *)
-ninductive susp_type : Type ≝
- BGND_MODE: susp_type
-| STOP_MODE: susp_type
-| WAIT_MODE: susp_type.
-
-(* un tipo opzione ad hoc
- - errore: errore+stato (seguira' reset o …, cmq lo stato non va buttato)
- - sospensione: sospensione+stato (seguira' resume o …)
- - ok: stato
-*)
-ninductive tick_result (A:Type) : Type ≝
- TickERR : A → error_type → tick_result A
-| TickSUSP : A → susp_type → tick_result A
-| TickOK : A → tick_result A.
-
-(* sostanazialmente simula
- - fetch/decode/execute
- - l'esecuzione e' considerata atomica quindi nel caso di un'instruzione
- da 3 cicli la successione sara'
- ([fetch/decode] s,clk:None) →
- ( s,clk:Some 1,pseudo,mode,3,cur_pc) →
- ( s,clk:Some 2,pseudo,mode,3,cur_pc) →
- ([execute] s',clk:None) *)
-
-ndefinition tick_execute ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
-λpseudo:any_opcode m.λmode:instr_mode.λcur_pc:word16.
- let abs_pseudo ≝ match pseudo with [ anyOP pseudo' ⇒ pseudo' ] in
- let a_status_and_fetch ≝ match abs_pseudo with
- [ ADC ⇒ execute_ADC m t s mode cur_pc (* add with carry *)
- | ADD ⇒ execute_ADD m t s mode cur_pc (* add *)
- | AIS ⇒ execute_AIS m t s mode cur_pc (* add immediate to SP *)
- | AIX ⇒ execute_AIX m t s mode cur_pc (* add immediate to X *)
- | AND ⇒ execute_AND m t s mode cur_pc (* and *)
- | ASL ⇒ execute_ASL m t s mode cur_pc (* aritmetic shift left *)
- | ASR ⇒ execute_ASR m t s mode cur_pc (* aritmetic shift right *)
- | BCC ⇒ execute_BCC m t s mode cur_pc (* branch if C=0 *)
- | BCLRn ⇒ execute_BCLRn m t s mode cur_pc (* clear bit n *)
- | BCS ⇒ execute_BCS m t s mode cur_pc (* branch if C=1 *)
- | BEQ ⇒ execute_BEQ m t s mode cur_pc (* branch if Z=1 *)
- | BGE ⇒ execute_BGE m t s mode cur_pc (* branch if N⊙V=0 (great or equal) *)
- | BGND ⇒ execute_BGND m t s mode cur_pc (* !!background mode!!*)
- | BGT ⇒ execute_BGT m t s mode cur_pc (* branch if Z|N⊙V=0 clear (great) *)
- | BHCC ⇒ execute_BHCC m t s mode cur_pc (* branch if H=0 *)
- | BHCS ⇒ execute_BHCS m t s mode cur_pc (* branch if H=1 *)
- | BHI ⇒ execute_BHI m t s mode cur_pc (* branch if C|Z=0, (higher) *)
- | BIH ⇒ execute_BIH m t s mode cur_pc (* branch if nIRQ=1 *)
- | BIL ⇒ execute_BIL m t s mode cur_pc (* branch if nIRQ=0 *)
- | BIT ⇒ execute_BIT m t s mode cur_pc (* flag = and (bit test) *)
- | BLE ⇒ execute_BLE m t s mode cur_pc (* branch if Z|N⊙V=1 (less or equal) *)
- | BLS ⇒ execute_BLS m t s mode cur_pc (* branch if C|Z=1 (lower or same) *)
- | BLT ⇒ execute_BLT m t s mode cur_pc (* branch if N⊙1=1 (less) *)
- | BMC ⇒ execute_BMC m t s mode cur_pc (* branch if I=0 (interrupt mask clear) *)
- | BMI ⇒ execute_BMI m t s mode cur_pc (* branch if N=1 (minus) *)
- | BMS ⇒ execute_BMS m t s mode cur_pc (* branch if I=1 (interrupt mask set) *)
- | BNE ⇒ execute_BNE m t s mode cur_pc (* branch if Z=0 *)
- | BPL ⇒ execute_BPL m t s mode cur_pc (* branch if N=0 (plus) *)
- | BRA ⇒ execute_BRA m t s mode cur_pc (* branch always *)
- | BRCLRn ⇒ execute_BRCLRn m t s mode cur_pc (* branch if bit n clear *)
- | BRN ⇒ execute_BRN m t s mode cur_pc (* branch never (nop) *)
- | BRSETn ⇒ execute_BRSETn m t s mode cur_pc (* branch if bit n set *)
- | BSETn ⇒ execute_BSETn m t s mode cur_pc (* set bit n *)
- | BSR ⇒ execute_BSR m t s mode cur_pc (* branch to subroutine *)
- | CBEQA ⇒ execute_CBEQA m t s mode cur_pc (* compare (A) and BEQ *)
- | CBEQX ⇒ execute_CBEQX m t s mode cur_pc (* compare (X) and BEQ *)
- | CLC ⇒ execute_CLC m t s mode cur_pc (* C=0 *)
- | CLI ⇒ execute_CLI m t s mode cur_pc (* I=0 *)
- | CLR ⇒ execute_CLR m t s mode cur_pc (* operand=0 *)
- | CMP ⇒ execute_CMP m t s mode cur_pc (* flag = sub (compare A) *)
- | COM ⇒ execute_COM m t s mode cur_pc (* not (1 complement) *)
- | CPHX ⇒ execute_CPHX m t s mode cur_pc (* flag = sub (compare H:X) *)
- | CPX ⇒ execute_CPX m t s mode cur_pc (* flag = sub (compare X) *)
- | DAA ⇒ execute_DAA m t s mode cur_pc (* decimal adjust A *)
- | DBNZ ⇒ execute_DBNZ m t s mode cur_pc (* dec and BNE *)
- | DEC ⇒ execute_DEC m t s mode cur_pc (* operand=operand-1 (decrement) *)
- | DIV ⇒ execute_DIV m t s mode cur_pc (* div *)
- | EOR ⇒ execute_EOR m t s mode cur_pc (* xor *)
- | INC ⇒ execute_INC m t s mode cur_pc (* operand=operand+1 (increment) *)
- | JMP ⇒ execute_JMP m t s mode cur_pc (* jmp word [operand] *)
- | JSR ⇒ execute_JSR m t s mode cur_pc (* jmp to subroutine *)
- | LDA ⇒ execute_LDA m t s mode cur_pc (* load in A *)
- | LDHX ⇒ execute_LDHX m t s mode cur_pc (* load in H:X *)
- | LDX ⇒ execute_LDX m t s mode cur_pc (* load in X *)
- | LSR ⇒ execute_LSR m t s mode cur_pc (* logical shift right *)
- | MOV ⇒ execute_MOV m t s mode cur_pc (* move *)
- | MUL ⇒ execute_MUL m t s mode cur_pc (* mul *)
- | NEG ⇒ execute_NEG m t s mode cur_pc (* neg (2 complement) *)
- | NOP ⇒ execute_NOP m t s mode cur_pc (* nop *)
- | NSA ⇒ execute_NSA m t s mode cur_pc (* nibble swap A (al:ah <- ah:al) *)
- | ORA ⇒ execute_ORA m t s mode cur_pc (* or *)
- | PSHA ⇒ execute_PSHA m t s mode cur_pc (* push A *)
- | PSHH ⇒ execute_PSHH m t s mode cur_pc (* push H *)
- | PSHX ⇒ execute_PSHX m t s mode cur_pc (* push X *)
- | PULA ⇒ execute_PULA m t s mode cur_pc (* pop A *)
- | PULH ⇒ execute_PULH m t s mode cur_pc (* pop H *)
- | PULX ⇒ execute_PULX m t s mode cur_pc (* pop X *)
- | ROL ⇒ execute_ROL m t s mode cur_pc (* rotate left *)
- | ROR ⇒ execute_ROR m t s mode cur_pc (* rotate right *)
- | RSP ⇒ execute_RSP m t s mode cur_pc (* reset SP (0x00FF) *)
- | RTI ⇒ execute_RTI m t s mode cur_pc (* return from interrupt *)
- | RTS ⇒ execute_RTS m t s mode cur_pc (* return from subroutine *)
- | SBC ⇒ execute_SBC m t s mode cur_pc (* sub with carry*)
- | SEC ⇒ execute_SEC m t s mode cur_pc (* C=1 *)
- | SEI ⇒ execute_SEI m t s mode cur_pc (* I=1 *)
- | SHA ⇒ execute_SHA m t s mode cur_pc (* swap spc_high,A *)
- | SLA ⇒ execute_SLA m t s mode cur_pc (* swap spc_low,A *)
- | STA ⇒ execute_STA m t s mode cur_pc (* store from A *)
- | STHX ⇒ execute_STHX m t s mode cur_pc (* store from H:X *)
- | STOP ⇒ execute_STOP m t s mode cur_pc (* !!stop mode!! *)
- | STX ⇒ execute_STX m t s mode cur_pc (* store from X *)
- | SUB ⇒ execute_SUB m t s mode cur_pc (* sub *)
- | SWI ⇒ execute_SWI m t s mode cur_pc (* software interrupt *)
- | TAP ⇒ execute_TAP m t s mode cur_pc (* flag=A (transfer A to process status byte *)
- | TAX ⇒ execute_TAX m t s mode cur_pc (* X=A (transfer A to X) *)
- | TPA ⇒ execute_TPA m t s mode cur_pc (* A=flag (transfer process status byte to A) *)
- | TST ⇒ execute_TST m t s mode cur_pc (* flag = sub (test) *)
- | TSX ⇒ execute_TSX m t s mode cur_pc (* X:H=SP (transfer SP to H:X) *)
- | TXA ⇒ execute_TXA m t s mode cur_pc (* A=X (transfer X to A) *)
- | TXS ⇒ execute_TXS m t s mode cur_pc (* SP=X:H (transfer H:X to SP) *)
- | WAIT ⇒ execute_WAIT m t s mode cur_pc (* !!wait mode!!*)
- ] in match a_status_and_fetch with
-(* errore nell'execute (=caricamento argomenti)? riportato in output *)
-(* nessun avanzamento e clk a None *)
- [ None ⇒ TickERR ? (set_clk_desc m t s (None ?)) ILL_EX_AD
- | Some status_and_newpc ⇒
-(* aggiornamento centralizzato di pc e clk *)
- match status_and_newpc with
- [ pair s_tmp1 new_pc ⇒
- let s_tmp2 ≝ set_pc_reg m t s_tmp1 new_pc in
- let s_tmp3 ≝ set_clk_desc m t s_tmp2 (None ?) in
-(* distinzione fra le 4 modalita' possibili, normale/BGND/STOP/WAIT *)
- match eq_op abs_pseudo BGND with
- [ true ⇒ TickSUSP ? s_tmp3 BGND_MODE
- | false ⇒ match eq_op abs_pseudo STOP with
- [ true ⇒ TickSUSP ? s_tmp3 STOP_MODE
- | false ⇒ match eq_op abs_pseudo WAIT with
- [ true ⇒ TickSUSP ? s_tmp3 WAIT_MODE
- | false ⇒ TickOK ? s_tmp3
- ]]]]].
-
-ndefinition tick ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- let opt_info ≝ clk_desc m t s in
- match opt_info with
- (* e' il momento del fetch *)
- [ None ⇒ match fetch m t s with
- (* errore nel fetch/decode? riportato in output, nessun avanzamento *)
- [ FetchERR err ⇒ TickERR ? s err
- (* nessun errore nel fetch *)
- | FetchOK fetch_info cur_pc ⇒ match fetch_info with
- [ quadruple pseudo mode _ tot_clk ⇒
- match eq_b8 〈x0,x1〉 tot_clk with
- (* un solo clk, execute subito *)
- [ true ⇒ tick_execute m t s pseudo mode cur_pc
- (* piu' clk, execute rimandata *)
- | false ⇒ TickOK ? (set_clk_desc m t s (Some ? (quintuple … 〈x0,x1〉 pseudo mode tot_clk cur_pc)))
- ]
- ]
- ]
- (* il fetch e' gia' stato eseguito, e' il turno di execute? *)
- | Some info ⇒ match info with [ quintuple cur_clk pseudo mode tot_clk cur_pc ⇒
- match eq_b8 (succ_b8 cur_clk) tot_clk with
- (* si *)
- [ true ⇒ tick_execute m t s pseudo mode cur_pc
- (* no, avanzamento cur_clk *)
- | false ⇒ TickOK ? (set_clk_desc m t s (Some ? (quintuple … (succ_b8 cur_clk) pseudo mode tot_clk cur_pc)))
- ]
- ]
- ].
-
-(* ********** *)
-(* ESECUZIONE *)
-(* ********** *)
-
-nlet rec execute (m:mcu_type) (t:memory_impl) (s:tick_result (any_status m t)) (n: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' ⇒ execute m t (tick m t s') n' ]
- ].
-
-nlemma breakpoint_err : ∀m,t,s,err,n.execute m t (TickERR ? s err) n = TickERR ? s err.
- #m; #t; #s; #err; #n;
- ncases n;
- ##[ ##2: #n1 ##]
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma breakpoint_susp : ∀m,t,s,susp,n.execute m t (TickSUSP ? s susp) n = TickSUSP ? s susp.
- #m; #t; #s; #susp; #n;
- ncases n;
- ##[ ##2: #n1 ##]
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma breakpoint :
- ∀m,t,n1,n2,s. execute m t s (n1 + n2) = execute m t (execute m t s n1) n2.
- #m; #t; #n1;
- nelim n1;
- ##[ ##1: nnormalize; #n2; #s; ncases s; nnormalize; ##[ ##1,2: #x ##] #y; napply refl_eq
- ##| ##2: #n3; #H; #n2; #s; ncases s;
- ##[ ##1: #x; #y; nnormalize; nrewrite > (breakpoint_err m t x y n2); napply refl_eq
- ##| ##2: #x; #y; nnormalize; nrewrite > (breakpoint_susp m t x y n2); napply refl_eq
- ##| ##3: #x; nrewrite > (Sn_p_n_to_S_npn n3 n2);
- nchange with ((execute m t (tick m t x) (n3+n2)) =
- (execute m t (execute m t (tick m t x) n3) n2));
- nrewrite > (H n2 (tick m t x));
- napply refl_eq
- ##]
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ****** *)
-(* OTTALI *)
-(* ****** *)
-
-ninductive oct : Type ≝
- o0: oct
-| o1: oct
-| o2: oct
-| o3: oct
-| o4: oct
-| o5: oct
-| o6: oct
-| o7: oct.
-
-(* operatore = *)
-ndefinition eq_oct ≝
-λn1,n2:oct.
- match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ true | _ ⇒ false ]
- | o1 ⇒ match n2 with [ o1 ⇒ true | _ ⇒ false ]
- | o2 ⇒ match n2 with [ o2 ⇒ true | _ ⇒ false ]
- | o3 ⇒ match n2 with [ o3 ⇒ true | _ ⇒ false ]
- | o4 ⇒ match n2 with [ o4 ⇒ true | _ ⇒ false ]
- | o5 ⇒ match n2 with [ o5 ⇒ true | _ ⇒ false ]
- | o6 ⇒ match n2 with [ o6 ⇒ true | _ ⇒ false ]
- | o7 ⇒ match n2 with [ o7 ⇒ true | _ ⇒ false ]
- ].
-
-(* iteratore sugli ottali *)
-ndefinition forall_oct ≝ λP.
- P o0 ⊗ P o1 ⊗ P o2 ⊗ P o3 ⊗ P o4 ⊗ P o5 ⊗ P o6 ⊗ P o7.
-
-(* operatore successore *)
-ndefinition succ_oct ≝
-λn.match n with
- [ o0 ⇒ o1 | o1 ⇒ o2 | o2 ⇒ o3 | o3 ⇒ o4 | o4 ⇒ o5 | o5 ⇒ o6 | o6 ⇒ o7 | o7 ⇒ o0 ].
-
-(* ottali ricorsivi *)
-ninductive rec_oct : oct → Type ≝
- oc_O : rec_oct o0
-| oc_S : ∀n.rec_oct n → rec_oct (succ_oct n).
-
-(* ottali → ottali ricorsivi *)
-ndefinition oct_to_recoct ≝
-λn.match n return λx.rec_oct x with
- [ o0 ⇒ oc_O
- | o1 ⇒ oc_S ? oc_O
- | o2 ⇒ oc_S ? (oc_S ? oc_O)
- | o3 ⇒ oc_S ? (oc_S ? (oc_S ? oc_O))
- | o4 ⇒ oc_S ? (oc_S ? (oc_S ? (oc_S ? oc_O)))
- | o5 ⇒ oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? oc_O))))
- | o6 ⇒ oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? oc_O)))))
- | o7 ⇒ oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? (oc_S ? oc_O))))))
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/oct.ma".
-
-(* ****** *)
-(* OTTALI *)
-(* ****** *)
-
-ndefinition oct_destruct_aux ≝
-Πn1,n2:oct.ΠP:Prop.n1 = n2 →
- match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ]
- | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
- | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ]
- | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
- | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ]
- | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
- | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ]
- | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition oct_destruct : oct_destruct_aux.
- #n1; #n2; #P;
- nelim n1;
- ##[ ##1: nelim n2; nnormalize; #H;
- ##[ ##1: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o0 with [ o0 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##2: nelim n2; nnormalize; #H;
- ##[ ##2: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o1 with [ o1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##3: nelim n2; nnormalize; #H;
- ##[ ##3: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o2 with [ o2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##4: nelim n2; nnormalize; #H;
- ##[ ##4: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o3 with [ o3 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##5: nelim n2; nnormalize; #H;
- ##[ ##5: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o4 with [ o4 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##6: nelim n2; nnormalize; #H;
- ##[ ##6: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o5 with [ o5 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##7: nelim n2; nnormalize; #H;
- ##[ ##7: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o6 with [ o6 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##8: nelim n2; nnormalize; #H;
- ##[ ##8: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match o7 with [ o7 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##]
-nqed.
-
-nlemma symmetric_eqoct : symmetricT oct bool eq_oct.
- #n1; #n2;
- nelim n1;
- nelim n2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqoct_to_eq : ∀n1,n2.eq_oct n1 n2 = true → n1 = n2.
- #n1; #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,10,19,28,37,46,55,64: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqoct : ∀n1,n2.n1 = n2 → eq_oct n1 n2 = true.
- #n1; #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,10,19,28,37,46,55,64: #H; napply refl_eq
- ##| ##*: #H; napply (oct_destruct … H)
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode_base.ma".
-
-(* ********************************************* *)
-(* STRUMENTI PER LE DIMOSTRAZIONI DI CORRETTEZZA *)
-(* ********************************************* *)
-
-(* su tutta la lista quante volte compare il byte *)
-nlet rec get_byte_count (m:mcu_type) (b:byte8) (c:nat)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
- [ nil ⇒ c
- | cons hd tl ⇒ match thd4T … hd with
- [ Byte b' ⇒ match eq_b8 b b' with
- [ true ⇒ get_byte_count m b (S c) tl
- | false ⇒ get_byte_count m b c tl
- ]
- | Word _ ⇒ get_byte_count m b c tl
- ]
- ].
-
-(* su tutta la lista quante volte compare la word (0x9E+byte) *)
-nlet rec get_word_count (m:mcu_type) (b:byte8) (c:nat)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
- [ nil ⇒ c
- | cons hd tl ⇒ match thd4T … hd with
- [ Byte _ ⇒ get_word_count m b c tl
- | Word w ⇒ match eq_w16 〈〈x9,xE〉:b〉 w with
- [ true ⇒ get_word_count m b (S c) tl
- | false ⇒ get_word_count m b c tl
- ]
- ]
- ].
-
-(* su tutta la lista quante volte compare lo pseudocodice *)
-nlet rec get_pseudo_count (m:mcu_type) (o:opcode) (c:nat)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
- [ nil ⇒ c
- | cons hd tl ⇒ match fst4T … hd with
- [ anyOP o' ⇒ match eq_op o o' with
- [ true ⇒ get_pseudo_count m o (S c) tl
- | false ⇒ get_pseudo_count m o c tl
- ]
- ]
- ].
-
-(* su tutta la lista quante volte compare la modalita' *)
-nlet rec get_mode_count (m:mcu_type) (i:instr_mode) (c:nat)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
- [ nil ⇒ c
- | cons hd tl ⇒ match eq_instrmode (snd4T … hd) i with
- [ true ⇒ get_mode_count m i (S c) tl
- | false ⇒ get_mode_count m i c tl
- ]
- ].
-
-(* b e' non implementato? *)
-nlet rec test_not_impl_byte (b:byte8) (l:list byte8) on l ≝
- match l with
- [ nil ⇒ false
- | cons hd tl ⇒ match eq_b8 b hd with
- [ true ⇒ true
- | false ⇒ test_not_impl_byte b tl
- ]
- ].
-
-(* o e' non implementato? *)
-nlet rec test_not_impl_pseudo (o:opcode) (l:list opcode) on l ≝
- match l with
- [ nil ⇒ false
- | cons hd tl ⇒ match eq_op o hd with
- [ true ⇒ true
- | false ⇒ test_not_impl_pseudo o tl
- ]
- ].
-
-(* i e' non implementato? *)
-nlet rec test_not_impl_mode (i:instr_mode) (l:list instr_mode) on l ≝
- match l with
- [ nil ⇒ false
- | cons hd tl ⇒ match eq_instrmode i hd with
- [ true ⇒ true
- | false ⇒ test_not_impl_mode i tl
- ]
- ].
-
-(* su tutta la lista quante volte compare la coppia opcode,instr_mode *)
-nlet rec get_OpIm_count (m:mcu_type) (o:any_opcode m) (i:instr_mode) (c:nat)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
- [ nil ⇒ c
- | cons hd tl ⇒
- match (eq_anyop m o (fst4T … hd)) ⊗
- (eq_instrmode i (snd4T … hd)) with
- [ true ⇒ get_OpIm_count m o i (S c) tl
- | false ⇒ get_OpIm_count m o i c tl
- ]
- ].
-
-(* iteratore sugli opcode *)
-ndefinition forall_opcode ≝ λP.
- P ADC ⊗ P ADD ⊗ P AIS ⊗ P AIX ⊗ P AND ⊗ P ASL ⊗ P ASR ⊗ P BCC ⊗
- P BCLRn ⊗ P BCS ⊗ P BEQ ⊗ P BGE ⊗ P BGND ⊗ P BGT ⊗ P BHCC ⊗ P BHCS ⊗
- P BHI ⊗ P BIH ⊗ P BIL ⊗ P BIT ⊗ P BLE ⊗ P BLS ⊗ P BLT ⊗ P BMC ⊗
- P BMI ⊗ P BMS ⊗ P BNE ⊗ P BPL ⊗ P BRA ⊗ P BRCLRn ⊗ P BRN ⊗ P BRSETn ⊗
- P BSETn ⊗ P BSR ⊗ P CBEQA ⊗ P CBEQX ⊗ P CLC ⊗ P CLI ⊗ P CLR ⊗ P CMP ⊗
- P COM ⊗ P CPHX ⊗ P CPX ⊗ P DAA ⊗ P DBNZ ⊗ P DEC ⊗ P DIV ⊗ P EOR ⊗
- P INC ⊗ P JMP ⊗ P JSR ⊗ P LDA ⊗ P LDHX ⊗ P LDX ⊗ P LSR ⊗ P MOV ⊗
- P MUL ⊗ P NEG ⊗ P NOP ⊗ P NSA ⊗ P ORA ⊗ P PSHA ⊗ P PSHH ⊗ P PSHX ⊗
- P PULA ⊗ P PULH ⊗ P PULX ⊗ P ROL ⊗ P ROR ⊗ P RSP ⊗ P RTI ⊗ P RTS ⊗
- P SBC ⊗ P SEC ⊗ P SEI ⊗ P SHA ⊗ P SLA ⊗ P STA ⊗ P STHX ⊗ P STOP ⊗
- P STX ⊗ P SUB ⊗ P SWI ⊗ P TAP ⊗ P TAX ⊗ P TPA ⊗ P TST ⊗ P TSX ⊗
- P TXA ⊗ P TXS ⊗ P WAIT.
-
-(* iteratore sulle modalita' *)
-ndefinition forall_instr_mode ≝ λP.
- P MODE_INH
-⊗ P MODE_INHA
-⊗ P MODE_INHX
-⊗ P MODE_INHH
-
-⊗ P MODE_INHX0ADD
-⊗ P MODE_INHX1ADD
-⊗ P MODE_INHX2ADD
-
-⊗ P MODE_IMM1
-⊗ P MODE_IMM1EXT
-⊗ P MODE_IMM2
-⊗ P MODE_DIR1
-⊗ P MODE_DIR2
-⊗ P MODE_IX0
-⊗ P MODE_IX1
-⊗ P MODE_IX2
-⊗ P MODE_SP1
-⊗ P MODE_SP2
-
-⊗ P MODE_DIR1_to_DIR1
-⊗ P MODE_IMM1_to_DIR1
-⊗ P MODE_IX0p_to_DIR1
-⊗ P MODE_DIR1_to_IX0p
-
-⊗ P MODE_INHA_and_IMM1
-⊗ P MODE_INHX_and_IMM1
-⊗ P MODE_IMM1_and_IMM1
-⊗ P MODE_DIR1_and_IMM1
-⊗ P MODE_IX0_and_IMM1
-⊗ P MODE_IX0p_and_IMM1
-⊗ P MODE_IX1_and_IMM1
-⊗ P MODE_IX1p_and_IMM1
-⊗ P MODE_SP1_and_IMM1
-
-⊗ forall_oct (λo. P (MODE_DIRn o))
-⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o))
-⊗ forall_exadecim (λe. P (MODE_TNY e))
-⊗ forall_bitrigesim (λt. P (MODE_SRT t)).
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/oct.ma".
-include "freescale/bitrigesim.ma".
-include "freescale/word16.ma".
-include "freescale/theory.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-(* enumerazione delle ALU *)
-ninductive mcu_type: Type ≝
- HC05 : mcu_type
-| HC08 : mcu_type
-| HCS08 : mcu_type
-| RS08 : mcu_type.
-
-ndefinition eq_mcutype ≝
-λm1,m2:mcu_type.
- match m1 with
- [ HC05 ⇒ match m2 with [ HC05 ⇒ true | _ ⇒ false ]
- | HC08 ⇒ match m2 with [ HC08 ⇒ true | _ ⇒ false ]
- | HCS08 ⇒ match m2 with [ HCS08 ⇒ true | _ ⇒ false ]
- | RS08 ⇒ match m2 with [ RS08 ⇒ true | _ ⇒ false ]
- ].
-
-(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
-ninductive instr_mode: Type ≝
- (* INHERENT = nessun operando *)
- MODE_INH : instr_mode
- (* INHERENT = nessun operando (A implicito) *)
-| MODE_INHA : instr_mode
- (* INHERENT = nessun operando (X implicito) *)
-| MODE_INHX : instr_mode
- (* INHERENT = nessun operando (H implicito) *)
-| MODE_INHH : instr_mode
-
- (* INHERENT_ADDRESS = nessun operando (HX implicito) *)
-| MODE_INHX0ADD : instr_mode
- (* INHERENT_ADDRESS = nessun operando (HX implicito+0x00bb) *)
-| MODE_INHX1ADD : instr_mode
- (* INHERENT_ADDRESS = nessun operando (HX implicito+0xwwww) *)
-| MODE_INHX2ADD : instr_mode
-
- (* IMMEDIATE = operando valore immediato byte = 0xbb *)
-| MODE_IMM1 : instr_mode
- (* IMMEDIATE_EXT = operando valore immediato byte = 0xbb -> esteso a word *)
-| MODE_IMM1EXT : instr_mode
- (* IMMEDIATE = operando valore immediato word = 0xwwww *)
-| MODE_IMM2 : instr_mode
- (* DIRECT = operando offset byte = [0x00bb] *)
-| MODE_DIR1 : instr_mode
- (* DIRECT = operando offset word = [0xwwww] *)
-| MODE_DIR2 : instr_mode
- (* INDEXED = nessun operando (implicito [X] *)
-| MODE_IX0 : instr_mode
- (* INDEXED = operando offset relativo byte = [X+0x00bb] *)
-| MODE_IX1 : instr_mode
- (* INDEXED = operando offset relativo word = [X+0xwwww] *)
-| MODE_IX2 : instr_mode
- (* INDEXED = operando offset relativo byte = [SP+0x00bb] *)
-| MODE_SP1 : instr_mode
- (* INDEXED = operando offset relativo word = [SP+0xwwww] *)
-| MODE_SP2 : instr_mode
-
- (* DIRECT → DIRECT = carica da diretto/scrive su diretto *)
-| MODE_DIR1_to_DIR1 : instr_mode
- (* IMMEDIATE → DIRECT = carica da immediato/scrive su diretto *)
-| MODE_IMM1_to_DIR1 : instr_mode
- (* INDEXED++ → DIRECT = carica da [X]/scrive su diretto/H:X++ *)
-| MODE_IX0p_to_DIR1 : instr_mode
- (* DIRECT → INDEXED++ = carica da diretto/scrive su [X]/H:X++ *)
-| MODE_DIR1_to_IX0p : instr_mode
-
- (* INHERENT(A) + IMMEDIATE *)
-| MODE_INHA_and_IMM1 : instr_mode
- (* INHERENT(X) + IMMEDIATE *)
-| MODE_INHX_and_IMM1 : instr_mode
- (* IMMEDIATE + IMMEDIATE *)
-| MODE_IMM1_and_IMM1 : instr_mode
- (* DIRECT + IMMEDIATE *)
-| MODE_DIR1_and_IMM1 : instr_mode
- (* INDEXED + IMMEDIATE *)
-| MODE_IX0_and_IMM1 : instr_mode
- (* INDEXED++ + IMMEDIATE *)
-| MODE_IX0p_and_IMM1 : instr_mode
- (* INDEXED + IMMEDIATE *)
-| MODE_IX1_and_IMM1 : instr_mode
- (* INDEXED++ + IMMEDIATE *)
-| MODE_IX1p_and_IMM1 : instr_mode
- (* INDEXED + IMMEDIATE *)
-| MODE_SP1_and_IMM1 : instr_mode
-
- (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
- (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
-| MODE_DIRn : oct → instr_mode
- (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
- (* + operando valore immediato byte *)
- (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
-| MODE_DIRn_and_IMM1 : oct → instr_mode
- (* TINY = nessun operando (diretto implicito 4bit = [0x00000000:0000iiii]) *)
-| MODE_TNY : exadecim → instr_mode
- (* SHORT = nessun operando (diretto implicito 5bit = [0x00000000:000iiiii]) *)
-| MODE_SRT : bitrigesim → instr_mode
-.
-
-ndefinition eq_im ≝
-λi1,i2:instr_mode.
- match i1 with
- [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
- | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
- | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ true | _ ⇒ false ]
- | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ true | _ ⇒ false ]
- | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ true | _ ⇒ false ]
- | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ true | _ ⇒ false ]
- | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ true | _ ⇒ false ]
- | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ true | _ ⇒ false ]
- | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
- | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
- | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ true | _ ⇒ false ]
- | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ true | _ ⇒ false ]
- | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ true | _ ⇒ false ]
- | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ true | _ ⇒ false ]
- | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ true | _ ⇒ false ]
- | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ true | _ ⇒ false ]
- | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ true | _ ⇒ false ]
- | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ true | _ ⇒ false ]
- | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ true | _ ⇒ false ]
- | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ true | _ ⇒ false ]
- | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ true | _ ⇒ false ]
- | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]
- | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]
- | MODE_TNY e1 ⇒ match i2 with [ MODE_TNY e2 ⇒ eq_ex e1 e2 | _ ⇒ false ]
- | MODE_SRT t1 ⇒ match i2 with [ MODE_SRT t2 ⇒ eq_bit t1 t2 | _ ⇒ false ]
- ].
-
-(* enumerazione delle istruzioni di tutte le ALU *)
-ninductive opcode: Type ≝
- ADC : opcode (* add with carry *)
-| ADD : opcode (* add *)
-| AIS : opcode (* add immediate to SP *)
-| AIX : opcode (* add immediate to X *)
-| AND : opcode (* and *)
-| ASL : opcode (* aritmetic shift left *)
-| ASR : opcode (* aritmetic shift right *)
-| BCC : opcode (* branch if C=0 *)
-| BCLRn : opcode (* clear bit n *)
-| BCS : opcode (* branch if C=1 *)
-| BEQ : opcode (* branch if Z=1 *)
-| BGE : opcode (* branch if N⊙V=0 (great or equal) *)
-| BGND : opcode (* !!background mode!! *)
-| BGT : opcode (* branch if Z|N⊙V=0 clear (great) *)
-| BHCC : opcode (* branch if H=0 *)
-| BHCS : opcode (* branch if H=1 *)
-| BHI : opcode (* branch if C|Z=0, (higher) *)
-| BIH : opcode (* branch if nIRQ=1 *)
-| BIL : opcode (* branch if nIRQ=0 *)
-| BIT : opcode (* flag = and (bit test) *)
-| BLE : opcode (* branch if Z|N⊙V=1 (less or equal) *)
-| BLS : opcode (* branch if C|Z=1 (lower or same) *)
-| BLT : opcode (* branch if N⊙1=1 (less) *)
-| BMC : opcode (* branch if I=0 (interrupt mask clear) *)
-| BMI : opcode (* branch if N=1 (minus) *)
-| BMS : opcode (* branch if I=1 (interrupt mask set) *)
-| BNE : opcode (* branch if Z=0 *)
-| BPL : opcode (* branch if N=0 (plus) *)
-| BRA : opcode (* branch always *)
-| BRCLRn : opcode (* branch if bit n clear *)
-| BRN : opcode (* branch never (nop) *)
-| BRSETn : opcode (* branch if bit n set *)
-| BSETn : opcode (* set bit n *)
-| BSR : opcode (* branch to subroutine *)
-| CBEQA : opcode (* compare (A) and BEQ *)
-| CBEQX : opcode (* compare (X) and BEQ *)
-| CLC : opcode (* C=0 *)
-| CLI : opcode (* I=0 *)
-| CLR : opcode (* operand=0 *)
-| CMP : opcode (* flag = sub (compare A) *)
-| COM : opcode (* not (1 complement) *)
-| CPHX : opcode (* flag = sub (compare H:X) *)
-| CPX : opcode (* flag = sub (compare X) *)
-| DAA : opcode (* decimal adjust A *)
-| DBNZ : opcode (* dec and BNE *)
-| DEC : opcode (* operand=operand-1 (decrement) *)
-| DIV : opcode (* div *)
-| EOR : opcode (* xor *)
-| INC : opcode (* operand=operand+1 (increment) *)
-| JMP : opcode (* jmp word [operand] *)
-| JSR : opcode (* jmp to subroutine *)
-| LDA : opcode (* load in A *)
-| LDHX : opcode (* load in H:X *)
-| LDX : opcode (* load in X *)
-| LSR : opcode (* logical shift right *)
-| MOV : opcode (* move *)
-| MUL : opcode (* mul *)
-| NEG : opcode (* neg (2 complement) *)
-| NOP : opcode (* nop *)
-| NSA : opcode (* nibble swap A (al:ah <- ah:al) *)
-| ORA : opcode (* or *)
-| PSHA : opcode (* push A *)
-| PSHH : opcode (* push H *)
-| PSHX : opcode (* push X *)
-| PULA : opcode (* pop A *)
-| PULH : opcode (* pop H *)
-| PULX : opcode (* pop X *)
-| ROL : opcode (* rotate left *)
-| ROR : opcode (* rotate right *)
-| RSP : opcode (* reset SP (0x00FF) *)
-| RTI : opcode (* return from interrupt *)
-| RTS : opcode (* return from subroutine *)
-| SBC : opcode (* sub with carry*)
-| SEC : opcode (* C=1 *)
-| SEI : opcode (* I=1 *)
-| SHA : opcode (* swap spc_high,A *)
-| SLA : opcode (* swap spc_low,A *)
-| STA : opcode (* store from A *)
-| STHX : opcode (* store from H:X *)
-| STOP : opcode (* !!stop mode!! *)
-| STX : opcode (* store from X *)
-| SUB : opcode (* sub *)
-| SWI : opcode (* software interrupt *)
-| TAP : opcode (* flag=A (transfer A to process status byte *)
-| TAX : opcode (* X=A (transfer A to X) *)
-| TPA : opcode (* A=flag (transfer process status byte to A) *)
-| TST : opcode (* flag = sub (test) *)
-| TSX : opcode (* X:H=SP (transfer SP to H:X) *)
-| TXA : opcode (* A=X (transfer X to A) *)
-| TXS : opcode (* SP=X:H (transfer H:X to SP) *)
-| WAIT : opcode (* !!wait mode!! *)
-.
-
-ndefinition eq_op ≝
-λop1,op2:opcode.
- match op1 with
- [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ] | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
- | AIS ⇒ match op2 with [ AIS ⇒ true | _ ⇒ false ] | AIX ⇒ match op2 with [ AIX ⇒ true | _ ⇒ false ]
- | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ] | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
- | ASR ⇒ match op2 with [ ASR ⇒ true | _ ⇒ false ] | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]
- | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ] | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]
- | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ] | BGE ⇒ match op2 with [ BGE ⇒ true | _ ⇒ false ]
- | BGND ⇒ match op2 with [ BGND ⇒ true | _ ⇒ false ] | BGT ⇒ match op2 with [ BGT ⇒ true | _ ⇒ false ]
- | BHCC ⇒ match op2 with [ BHCC ⇒ true | _ ⇒ false ] | BHCS ⇒ match op2 with [ BHCS ⇒ true | _ ⇒ false ]
- | BHI ⇒ match op2 with [ BHI ⇒ true | _ ⇒ false ] | BIH ⇒ match op2 with [ BIH ⇒ true | _ ⇒ false ]
- | BIL ⇒ match op2 with [ BIL ⇒ true | _ ⇒ false ] | BIT ⇒ match op2 with [ BIT ⇒ true | _ ⇒ false ]
- | BLE ⇒ match op2 with [ BLE ⇒ true | _ ⇒ false ] | BLS ⇒ match op2 with [ BLS ⇒ true | _ ⇒ false ]
- | BLT ⇒ match op2 with [ BLT ⇒ true | _ ⇒ false ] | BMC ⇒ match op2 with [ BMC ⇒ true | _ ⇒ false ]
- | BMI ⇒ match op2 with [ BMI ⇒ true | _ ⇒ false ] | BMS ⇒ match op2 with [ BMS ⇒ true | _ ⇒ false ]
- | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ] | BPL ⇒ match op2 with [ BPL ⇒ true | _ ⇒ false ]
- | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ] | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ]
- | BRN ⇒ match op2 with [ BRN ⇒ true | _ ⇒ false ] | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ]
- | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ] | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]
- | CBEQA ⇒ match op2 with [ CBEQA ⇒ true | _ ⇒ false ] | CBEQX ⇒ match op2 with [ CBEQX ⇒ true | _ ⇒ false ]
- | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ] | CLI ⇒ match op2 with [ CLI ⇒ true | _ ⇒ false ]
- | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ] | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]
- | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ] | CPHX ⇒ match op2 with [ CPHX ⇒ true | _ ⇒ false ]
- | CPX ⇒ match op2 with [ CPX ⇒ true | _ ⇒ false ] | DAA ⇒ match op2 with [ DAA ⇒ true | _ ⇒ false ]
- | DBNZ ⇒ match op2 with [ DBNZ ⇒ true | _ ⇒ false ] | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]
- | DIV ⇒ match op2 with [ DIV ⇒ true | _ ⇒ false ] | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]
- | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ] | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]
- | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ] | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]
- | LDHX ⇒ match op2 with [ LDHX ⇒ true | _ ⇒ false ] | LDX ⇒ match op2 with [ LDX ⇒ true | _ ⇒ false ]
- | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ] | MOV ⇒ match op2 with [ MOV ⇒ true | _ ⇒ false ]
- | MUL ⇒ match op2 with [ MUL ⇒ true | _ ⇒ false ] | NEG ⇒ match op2 with [ NEG ⇒ true | _ ⇒ false ]
- | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ] | NSA ⇒ match op2 with [ NSA ⇒ true | _ ⇒ false ]
- | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ] | PSHA ⇒ match op2 with [ PSHA ⇒ true | _ ⇒ false ]
- | PSHH ⇒ match op2 with [ PSHH ⇒ true | _ ⇒ false ] | PSHX ⇒ match op2 with [ PSHX ⇒ true | _ ⇒ false ]
- | PULA ⇒ match op2 with [ PULA ⇒ true | _ ⇒ false ] | PULH ⇒ match op2 with [ PULH ⇒ true | _ ⇒ false ]
- | PULX ⇒ match op2 with [ PULX ⇒ true | _ ⇒ false ] | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]
- | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ] | RSP ⇒ match op2 with [ RSP ⇒ true | _ ⇒ false ]
- | RTI ⇒ match op2 with [ RTI ⇒ true | _ ⇒ false ] | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]
- | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ] | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]
- | SEI ⇒ match op2 with [ SEI ⇒ true | _ ⇒ false ] | SHA ⇒ match op2 with [ SHA ⇒ true | _ ⇒ false ]
- | SLA ⇒ match op2 with [ SLA ⇒ true | _ ⇒ false ] | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]
- | STHX ⇒ match op2 with [ STHX ⇒ true | _ ⇒ false ] | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]
- | STX ⇒ match op2 with [ STX ⇒ true | _ ⇒ false ] | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]
- | SWI ⇒ match op2 with [ SWI ⇒ true | _ ⇒ false ] | TAP ⇒ match op2 with [ TAP ⇒ true | _ ⇒ false ]
- | TAX ⇒ match op2 with [ TAX ⇒ true | _ ⇒ false ] | TPA ⇒ match op2 with [ TPA ⇒ true | _ ⇒ false ]
- | TST ⇒ match op2 with [ TST ⇒ true | _ ⇒ false ] | TSX ⇒ match op2 with [ TSX ⇒ true | _ ⇒ false ]
- | TXA ⇒ match op2 with [ TXA ⇒ true | _ ⇒ false ] | TXS ⇒ match op2 with [ TXS ⇒ true | _ ⇒ false ]
- | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
- ].
-
-(* introduzione di un tipo opcode dipendente dall'mcu_type (phantom type) *)
-ninductive any_opcode (m:mcu_type) : Type ≝
- anyOP : opcode → any_opcode m.
-
-ndefinition eq_anyop ≝
-λm:mcu_type.λop1,op2:any_opcode m.
- match op1 with [ anyOP op1' ⇒
- match op2 with [ anyOP op2' ⇒
- eq_op op1' op2' ]].
-
-(* raggruppamento di byte e word in un tipo unico *)
-ninductive byte8_or_word16 : Type ≝
- Byte: byte8 → byte8_or_word16
-| Word: word16 → byte8_or_word16.
-
-ndefinition eq_b8w16 ≝
-λbw1,bw2:byte8_or_word16.
- match bw1 with
- [ Byte b1 ⇒ match bw2 with [ Byte b2 ⇒ eq_b8 b1 b2 | Word _ ⇒ false ]
- | Word w1 ⇒ match bw2 with [ Byte _ ⇒ false | Word w2 ⇒ eq_w16 w1 w2 ]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-ndefinition mcu_type_destruct_aux ≝
-Πm1,m2:mcu_type.ΠP:Prop.m1 = m2 →
- match m1 with
- [ HC05 ⇒ match m2 with [ HC05 ⇒ P → P | _ ⇒ P ]
- | HC08 ⇒ match m2 with [ HC08 ⇒ P → P | _ ⇒ P ]
- | HCS08 ⇒ match m2 with [ HCS08 ⇒ P → P | _ ⇒ P ]
- | RS08 ⇒ match m2 with [ RS08 ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition mcu_type_destruct : mcu_type_destruct_aux.
- #m1; #m2; #P;
- nelim m1;
- ##[ ##1: nelim m2; nnormalize; #H;
- ##[ ##1: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match HC05 with [ HC05 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##2: nelim m2; nnormalize; #H;
- ##[ ##2: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match HC08 with [ HC08 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##3: nelim m2; nnormalize; #H;
- ##[ ##3: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match HCS08 with [ HCS08 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##4: nelim m2; nnormalize; #H;
- ##[ ##4: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match RS08 with [ RS08 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##]
-nqed.
-
-nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype.
- #m1; #m2;
- nelim m1;
- nelim m2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqmcutype_to_eq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = true) → (m1 = m2).
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true.
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (mcu_type_destruct … H)
- ##]
-nqed.
-
-nlemma instr_mode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instr_mode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instr_mode_destruct_MODE_TNY : ∀e1,e2.MODE_TNY e1 = MODE_TNY e2 → e1 = e2.
- #e1; #e2; #H;
- nchange with (match MODE_TNY e2 with [ MODE_TNY a ⇒ e1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instr_mode_destruct_MODE_SRT : ∀t1,t2.MODE_SRT t1 = MODE_SRT t2 → t1 = t2.
- #t1; #t2; #H;
- nchange with (match MODE_SRT t2 with [ MODE_SRT a ⇒ t1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode_base_lemmas_opcode2.ma".
-include "freescale/opcode_base_lemmas_instrmode2.ma".
-include "freescale/word16_lemmas.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-nlemma anyop_destruct : ∀m.∀x1,x2:opcode.anyOP m x1 = anyOP m x2 → x1 = x2.
- #m; #x1; #x2; #H;
- nchange with (match anyOP m x2 with [ anyOP a ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqanyop : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = eq_anyop m op2 op1.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #x1;
- ncases op2;
- #x2;
- nchange with (eq_op x1 x2 = eq_op x2 x1);
- nrewrite > (symmetric_eqop x1 x2);
- napply refl_eq.
-nqed.
-
-nlemma eqanyop_to_eq : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = true → op1 = op2.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #x1;
- ncases op2;
- #x2;
- nchange with ((eq_op x1 x2 = true) → ?);
- #H;
- nrewrite > (eqop_to_eq … H);
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqanyop : ∀m.∀op1,op2:any_opcode m.op1 = op2 → eq_anyop m op1 op2 = true.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #p1;
- ncases op2;
- #p2; #H;
- nrewrite > (anyop_destruct … H);
- nchange with (eq_op p2 p2 = true);
- nrewrite > (eq_to_eqop p2 p2 (refl_eq opcode p2));
- napply refl_eq.
-nqed.
-
-nlemma b8w16_destruct_b8_b8 : ∀x1,x2.Byte x1 = Byte x2 → x1 = x2.
- #x1; #x2; #H;
- nchange with (match Byte x2 with [ Byte a ⇒ x1 = a | Word _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma b8w16_destruct_w16_w16 : ∀x1,x2.Word x1 = Word x2 → x1 = x2.
- #x1; #x2; #H;
- nchange with (match Word x2 with [ Word a ⇒ x1 = a | Byte _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma b8w16_destruct_b8_w16 : ∀x1,x2.Byte x1 = Word x2 → False.
- #x1; #x2; #H;
- nchange with (match Byte x1 with [ Word _ ⇒ True | Byte a ⇒ False ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma b8w16_destruct_w16_b8 : ∀x1,x2.Word x1 = Byte x2 → False.
- #x1; #x2; #H;
- nchange with (match Word x1 with [ Word a ⇒ False | Byte _ ⇒ True ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma symmetric_eqb8w16 : ∀bw1,bw2.eq_b8w16 bw1 bw2 = eq_b8w16 bw2 bw1.
- #bw1; #bw2;
- ncases bw1;
- #x1;
- ncases bw2;
- #x2;
- ##[ ##1: nchange with (eq_b8 x1 x2 = eq_b8 x2 x1);
- nrewrite > (symmetric_eqb8 x1 x2);
- napply refl_eq
- ##| ##2,3: nnormalize; napply refl_eq
- ##| ##4: nchange with (eq_w16 x1 x2 = eq_w16 x2 x1);
- nrewrite > (symmetric_eqw16 x1 x2);
- napply refl_eq
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/oct_lemmas.ma".
-include "freescale/bitrigesim_lemmas.ma".
-include "freescale/exadecim_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-ndefinition instr_mode_destruct1 :
- Πi2.ΠP:Prop.MODE_INH = i2 → match i2 with [ MODE_INH ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##1: #H; napply (λx:P.x)
- ##| ##2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INH with [ MODE_INH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INH with [ MODE_INH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct2 :
- Πi2.ΠP:Prop.MODE_INHA = i2 → match i2 with [ MODE_INHA ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##2: #H; napply (λx:P.x)
- ##| ##1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHA with [ MODE_INHA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHA with [ MODE_INHA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct3 :
- Πi2.ΠP:Prop.MODE_INHX = i2 → match i2 with [ MODE_INHX ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##3: #H; napply (λx:P.x)
- ##| ##1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHX with [ MODE_INHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHX with [ MODE_INHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct4 :
- Πi2.ΠP:Prop.MODE_INHH = i2 → match i2 with [ MODE_INHH ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##4: #H; napply (λx:P.x)
- ##| ##1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHH with [ MODE_INHH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHH with [ MODE_INHH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct5 :
- Πi2.ΠP:Prop.MODE_INHX0ADD = i2 → match i2 with [ MODE_INHX0ADD ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##5: #H; napply (λx:P.x)
- ##| ##1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHX0ADD with [ MODE_INHX0ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHX0ADD with [ MODE_INHX0ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct6 :
- Πi2.ΠP:Prop.MODE_INHX1ADD = i2 → match i2 with [ MODE_INHX1ADD ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##6: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHX1ADD with [ MODE_INHX1ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHX1ADD with [ MODE_INHX1ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct7 :
- Πi2.ΠP:Prop.MODE_INHX2ADD = i2 → match i2 with [ MODE_INHX2ADD ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##7: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHX2ADD with [ MODE_INHX2ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHX2ADD with [ MODE_INHX2ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct8 :
- Πi2.ΠP:Prop.MODE_IMM1 = i2 → match i2 with [ MODE_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##8: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IMM1 with [ MODE_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IMM1 with [ MODE_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct9 :
- Πi2.ΠP:Prop.MODE_IMM1EXT = i2 → match i2 with [ MODE_IMM1EXT ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##9: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IMM1EXT with [ MODE_IMM1EXT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IMM1EXT with [ MODE_IMM1EXT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct10 :
- Πi2.ΠP:Prop.MODE_IMM2 = i2 → match i2 with [ MODE_IMM2 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##10: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IMM2 with [ MODE_IMM2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IMM2 with [ MODE_IMM2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct11 :
- Πi2.ΠP:Prop.MODE_DIR1 = i2 → match i2 with [ MODE_DIR1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##11: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIR1 with [ MODE_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIR1 with [ MODE_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct12 :
- Πi2.ΠP:Prop.MODE_DIR2 = i2 → match i2 with [ MODE_DIR2 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##12: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIR2 with [ MODE_DIR2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIR2 with [ MODE_DIR2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct13 :
- Πi2.ΠP:Prop.MODE_IX0 = i2 → match i2 with [ MODE_IX0 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##13: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX0 with [ MODE_IX0 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX0 with [ MODE_IX0 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct14 :
- Πi2.ΠP:Prop.MODE_IX1 = i2 → match i2 with [ MODE_IX1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##14: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX1 with [ MODE_IX1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX1 with [ MODE_IX1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct15 :
- Πi2.ΠP:Prop.MODE_IX2 = i2 → match i2 with [ MODE_IX2 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##15: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX2 with [ MODE_IX2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX2 with [ MODE_IX2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct16 :
- Πi2.ΠP:Prop.MODE_SP1 = i2 → match i2 with [ MODE_SP1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##16: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_SP1 with [ MODE_SP1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_SP1 with [ MODE_SP1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct17 :
- Πi2.ΠP:Prop.MODE_SP2 = i2 → match i2 with [ MODE_SP2 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##17: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_SP2 with [ MODE_SP2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_SP2 with [ MODE_SP2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct18 :
- Πi2.ΠP:Prop.MODE_DIR1_to_DIR1 = i2 → match i2 with [ MODE_DIR1_to_DIR1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##18: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIR1_to_DIR1 with [ MODE_DIR1_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIR1_to_DIR1 with [ MODE_DIR1_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct19 :
- Πi2.ΠP:Prop.MODE_IMM1_to_DIR1 = i2 → match i2 with [ MODE_IMM1_to_DIR1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##19: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IMM1_to_DIR1 with [ MODE_IMM1_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IMM1_to_DIR1 with [ MODE_IMM1_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct20 :
- Πi2.ΠP:Prop.MODE_IX0p_to_DIR1 = i2 → match i2 with [ MODE_IX0p_to_DIR1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##20: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX0p_to_DIR1 with [ MODE_IX0p_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX0p_to_DIR1 with [ MODE_IX0p_to_DIR1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct21 :
- Πi2.ΠP:Prop.MODE_DIR1_to_IX0p = i2 → match i2 with [ MODE_DIR1_to_IX0p ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##21: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIR1_to_IX0p with [ MODE_DIR1_to_IX0p ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIR1_to_IX0p with [ MODE_DIR1_to_IX0p ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct22 :
- Πi2.ΠP:Prop.MODE_INHA_and_IMM1 = i2 → match i2 with [ MODE_INHA_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##22: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHA_and_IMM1 with [ MODE_INHA_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHA_and_IMM1 with [ MODE_INHA_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct23 :
- Πi2.ΠP:Prop.MODE_INHX_and_IMM1 = i2 → match i2 with [ MODE_INHX_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##23: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_INHX_and_IMM1 with [ MODE_INHX_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_INHX_and_IMM1 with [ MODE_INHX_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct24 :
- Πi2.ΠP:Prop.MODE_IMM1_and_IMM1 = i2 → match i2 with [ MODE_IMM1_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##24: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IMM1_and_IMM1 with [ MODE_IMM1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IMM1_and_IMM1 with [ MODE_IMM1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct25 :
- Πi2.ΠP:Prop.MODE_DIR1_and_IMM1 = i2 → match i2 with [ MODE_DIR1_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##25: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIR1_and_IMM1 with [ MODE_DIR1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIR1_and_IMM1 with [ MODE_DIR1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct26 :
- Πi2.ΠP:Prop.MODE_IX0_and_IMM1 = i2 → match i2 with [ MODE_IX0_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##26: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX0_and_IMM1 with [ MODE_IX0_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX0_and_IMM1 with [ MODE_IX0_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct27 :
- Πi2.ΠP:Prop.MODE_IX0p_and_IMM1 = i2 → match i2 with [ MODE_IX0p_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##27: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX0p_and_IMM1 with [ MODE_IX0p_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX0p_and_IMM1 with [ MODE_IX0p_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct28 :
- Πi2.ΠP:Prop.MODE_IX1_and_IMM1 = i2 → match i2 with [ MODE_IX1_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##28: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,29,30: #H;
- napply False_ind;
- nchange with (match MODE_IX1_and_IMM1 with [ MODE_IX1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX1_and_IMM1 with [ MODE_IX1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct29 :
- Πi2.ΠP:Prop.MODE_IX1p_and_IMM1 = i2 → match i2 with [ MODE_IX1p_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##29: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30: #H;
- napply False_ind;
- nchange with (match MODE_IX1p_and_IMM1 with [ MODE_IX1p_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_IX1p_and_IMM1 with [ MODE_IX1p_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition instr_mode_destruct30 :
- Πi2.ΠP:Prop.MODE_SP1_and_IMM1 = i2 → match i2 with [ MODE_SP1_and_IMM1 ⇒ P → P | _ ⇒ P ].
- #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##30: #H; napply (λx:P.x)
- ##| ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29: #H;
- napply False_ind;
- nchange with (match MODE_SP1_and_IMM1 with [ MODE_SP1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_SP1_and_IMM1 with [ MODE_SP1_and_IMM1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-nlemma instr_mode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition instr_mode_destruct31 :
- Πn1,i2.ΠP:Prop.MODE_DIRn n1 = i2 →
- match i2 with
- [ MODE_DIRn n2 ⇒ match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
- | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
- | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
- | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ].
- #n1; #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIRn n1 with [ MODE_DIRn a ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##32,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIRn n1 with [ MODE_DIRn n1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31: #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,10,19,28,37,46,55,64: #H; napply (λx:P.x)
- ##| ##*: #H; napply (oct_destruct … (instr_mode_destruct_MODE_DIRn … H))
- ##]
-nqed.
-
-nlemma instr_mode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition instr_mode_destruct32 :
- Πn1,i2.ΠP:Prop.MODE_DIRn_and_IMM1 n1 = i2 →
- match i2 with
- [ MODE_DIRn_and_IMM1 n2 ⇒ match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
- | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
- | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
- | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ].
- #n1; #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_DIRn_and_IMM1 n1 with [ MODE_DIRn_and_IMM1 a ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,33,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_DIRn_and_IMM1 n1 with [ MODE_DIRn_and_IMM1 n1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##32: #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,10,19,28,37,46,55,64: #H; napply (λx:P.x)
- ##| ##*: #H; napply (oct_destruct … (instr_mode_destruct_MODE_DIRn_and_IMM1 … H))
- ##]
-nqed.
-
-nlemma instr_mode_destruct_MODE_TNY : ∀n1,n2.MODE_TNY n1 = MODE_TNY n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_TNY n2 with [ MODE_TNY a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition instr_mode_destruct33 :
- Πn1,i2.ΠP:Prop.MODE_TNY n1 = i2 →
- match i2 with
- [ MODE_TNY n2 ⇒ match n1 with
- [ x0 ⇒ match n2 with [ x0 ⇒ P → P | _ ⇒ P ] | x1 ⇒ match n2 with [ x1 ⇒ P → P | _ ⇒ P ]
- | x2 ⇒ match n2 with [ x2 ⇒ P → P | _ ⇒ P ] | x3 ⇒ match n2 with [ x3 ⇒ P → P | _ ⇒ P ]
- | x4 ⇒ match n2 with [ x4 ⇒ P → P | _ ⇒ P ] | x5 ⇒ match n2 with [ x5 ⇒ P → P | _ ⇒ P ]
- | x6 ⇒ match n2 with [ x6 ⇒ P → P | _ ⇒ P ] | x7 ⇒ match n2 with [ x7 ⇒ P → P | _ ⇒ P ]
- | x8 ⇒ match n2 with [ x8 ⇒ P → P | _ ⇒ P ] | x9 ⇒ match n2 with [ x9 ⇒ P → P | _ ⇒ P ]
- | xA ⇒ match n2 with [ xA ⇒ P → P | _ ⇒ P ] | xB ⇒ match n2 with [ xB ⇒ P → P | _ ⇒ P ]
- | xC ⇒ match n2 with [ xC ⇒ P → P | _ ⇒ P ] | xD ⇒ match n2 with [ xD ⇒ P → P | _ ⇒ P ]
- | xE ⇒ match n2 with [ xE ⇒ P → P | _ ⇒ P ] | xF ⇒ match n2 with [ xF ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ].
- #n1; #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_TNY n1 with [ MODE_TNY a ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,34: #n; #H;
- napply False_ind;
- nchange with (match MODE_TNY n1 with [ MODE_TNY n1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##33: #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,18,35,52,69,86,103,120,137,154,171,188,205,222,239,256: #H; napply (λx:P.x)
- ##| ##*: #H; napply (exadecim_destruct … (instr_mode_destruct_MODE_TNY … H))
- ##]
-nqed.
-
-nlemma instr_mode_destruct_MODE_SRT : ∀n1,n2.MODE_SRT n1 = MODE_SRT n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_SRT n2 with [ MODE_SRT a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition instr_mode_destruct34 :
- Πn1,i2.ΠP:Prop.MODE_SRT n1 = i2 →
- match i2 with
- [ MODE_SRT n2 ⇒ match n1 with
- [ t00 ⇒ match n2 with [ t00 ⇒ P → P | _ ⇒ P ] | t01 ⇒ match n2 with [ t01 ⇒ P → P | _ ⇒ P ]
- | t02 ⇒ match n2 with [ t02 ⇒ P → P | _ ⇒ P ] | t03 ⇒ match n2 with [ t03 ⇒ P → P | _ ⇒ P ]
- | t04 ⇒ match n2 with [ t04 ⇒ P → P | _ ⇒ P ] | t05 ⇒ match n2 with [ t05 ⇒ P → P | _ ⇒ P ]
- | t06 ⇒ match n2 with [ t06 ⇒ P → P | _ ⇒ P ] | t07 ⇒ match n2 with [ t07 ⇒ P → P | _ ⇒ P ]
- | t08 ⇒ match n2 with [ t08 ⇒ P → P | _ ⇒ P ] | t09 ⇒ match n2 with [ t09 ⇒ P → P | _ ⇒ P ]
- | t0A ⇒ match n2 with [ t0A ⇒ P → P | _ ⇒ P ] | t0B ⇒ match n2 with [ t0B ⇒ P → P | _ ⇒ P ]
- | t0C ⇒ match n2 with [ t0C ⇒ P → P | _ ⇒ P ] | t0D ⇒ match n2 with [ t0D ⇒ P → P | _ ⇒ P ]
- | t0E ⇒ match n2 with [ t0E ⇒ P → P | _ ⇒ P ] | t0F ⇒ match n2 with [ t0F ⇒ P → P | _ ⇒ P ]
- | t10 ⇒ match n2 with [ t10 ⇒ P → P | _ ⇒ P ] | t11 ⇒ match n2 with [ t11 ⇒ P → P | _ ⇒ P ]
- | t12 ⇒ match n2 with [ t12 ⇒ P → P | _ ⇒ P ] | t13 ⇒ match n2 with [ t13 ⇒ P → P | _ ⇒ P ]
- | t14 ⇒ match n2 with [ t14 ⇒ P → P | _ ⇒ P ] | t15 ⇒ match n2 with [ t15 ⇒ P → P | _ ⇒ P ]
- | t16 ⇒ match n2 with [ t16 ⇒ P → P | _ ⇒ P ] | t17 ⇒ match n2 with [ t17 ⇒ P → P | _ ⇒ P ]
- | t18 ⇒ match n2 with [ t18 ⇒ P → P | _ ⇒ P ] | t19 ⇒ match n2 with [ t19 ⇒ P → P | _ ⇒ P ]
- | t1A ⇒ match n2 with [ t1A ⇒ P → P | _ ⇒ P ] | t1B ⇒ match n2 with [ t1B ⇒ P → P | _ ⇒ P ]
- | t1C ⇒ match n2 with [ t1C ⇒ P → P | _ ⇒ P ] | t1D ⇒ match n2 with [ t1D ⇒ P → P | _ ⇒ P ]
- | t1E ⇒ match n2 with [ t1E ⇒ P → P | _ ⇒ P ] | t1F ⇒ match n2 with [ t1F ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ].
- #n1; #i2; #P;
- ncases i2;
- nnormalize;
- ##[ ##1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30: #H;
- napply False_ind;
- nchange with (match MODE_SRT n1 with [ MODE_SRT a ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##31,32,33: #n; #H;
- napply False_ind;
- nchange with (match MODE_SRT n1 with [ MODE_SRT n1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##| ##34: #n2;
- ncases n1;
- ##[ ##1: ncases n2; nnormalize;
- ##[ ##1: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##2: ncases n2; nnormalize;
- ##[ ##2: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##3: ncases n2; nnormalize;
- ##[ ##3: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##4: ncases n2; nnormalize;
- ##[ ##4: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##5: ncases n2; nnormalize;
- ##[ ##5: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##6: ncases n2; nnormalize;
- ##[ ##6: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##7: ncases n2; nnormalize;
- ##[ ##7: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##8: ncases n2; nnormalize;
- ##[ ##8: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##9: ncases n2; nnormalize;
- ##[ ##9: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##10: ncases n2; nnormalize;
- ##[ ##10: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##11: ncases n2; nnormalize;
- ##[ ##11: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##12: ncases n2; nnormalize;
- ##[ ##12: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##13: ncases n2; nnormalize;
- ##[ ##13: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##14: ncases n2; nnormalize;
- ##[ ##14: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##15: ncases n2; nnormalize;
- ##[ ##15: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##16: ncases n2; nnormalize;
- ##[ ##16: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##17: ncases n2; nnormalize;
- ##[ ##17: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##18: ncases n2; nnormalize;
- ##[ ##18: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##19: ncases n2; nnormalize;
- ##[ ##19: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##20: ncases n2; nnormalize;
- ##[ ##20: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##21: ncases n2; nnormalize;
- ##[ ##21: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##22: ncases n2; nnormalize;
- ##[ ##22: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##23: ncases n2; nnormalize;
- ##[ ##23: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##24: ncases n2; nnormalize;
- ##[ ##24: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##25: ncases n2; nnormalize;
- ##[ ##25: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##26: ncases n2; nnormalize;
- ##[ ##26: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##27: ncases n2; nnormalize;
- ##[ ##27: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##28: ncases n2; nnormalize;
- ##[ ##28: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##29: ncases n2; nnormalize;
- ##[ ##29: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##30: ncases n2; nnormalize;
- ##[ ##30: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##31: ncases n2; nnormalize;
- ##[ ##31: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##| ##32: ncases n2; nnormalize;
- ##[ ##32: #H; napply (λx:P.x)
- ##| ##*: #H; napply (bitrigesim_destruct … (instr_mode_destruct_MODE_SRT … H))
- ##]
- ##]
- ##]
-nqed.
-
-ndefinition instr_mode_destruct_aux ≝
-Πi1,i2.ΠP:Prop.i1 = i2 →
- match i1 with
- [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ P → P | _ ⇒ P ]
- | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ P → P | _ ⇒ P ]
- | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ P → P | _ ⇒ P ]
- | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ P → P | _ ⇒ P ]
- | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ P → P | _ ⇒ P ]
- | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ P → P | _ ⇒ P ]
- | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ P → P | _ ⇒ P ]
- | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ P → P | _ ⇒ P ]
- | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ P → P | _ ⇒ P ]
- | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ P → P | _ ⇒ P ]
- | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ P → P | _ ⇒ P ]
- | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ P → P | _ ⇒ P ]
- | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ P → P | _ ⇒ P ]
- | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ P → P | _ ⇒ P ]
- | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ P → P | _ ⇒ P ]
- | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ P → P | _ ⇒ P ]
- | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ P → P | _ ⇒ P ]
- | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ P → P | _ ⇒ P ]
- | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ P → P | _ ⇒ P ]
- | MODE_DIRn n1 ⇒ match i2 with
- [ MODE_DIRn n2 ⇒ match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
- | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
- | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
- | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ]
- | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with
- [ MODE_DIRn_and_IMM1 n2 ⇒ match n1 with
- [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ] | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
- | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ] | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
- | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ] | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
- | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ] | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ]
- | MODE_TNY e1 ⇒ match i2 with
- [ MODE_TNY e2 ⇒ match e1 with
- [ x0 ⇒ match e2 with [ x0 ⇒ P → P | _ ⇒ P ] | x1 ⇒ match e2 with [ x1 ⇒ P → P | _ ⇒ P ]
- | x2 ⇒ match e2 with [ x2 ⇒ P → P | _ ⇒ P ] | x3 ⇒ match e2 with [ x3 ⇒ P → P | _ ⇒ P ]
- | x4 ⇒ match e2 with [ x4 ⇒ P → P | _ ⇒ P ] | x5 ⇒ match e2 with [ x5 ⇒ P → P | _ ⇒ P ]
- | x6 ⇒ match e2 with [ x6 ⇒ P → P | _ ⇒ P ] | x7 ⇒ match e2 with [ x7 ⇒ P → P | _ ⇒ P ]
- | x8 ⇒ match e2 with [ x8 ⇒ P → P | _ ⇒ P ] | x9 ⇒ match e2 with [ x9 ⇒ P → P | _ ⇒ P ]
- | xA ⇒ match e2 with [ xA ⇒ P → P | _ ⇒ P ] | xB ⇒ match e2 with [ xB ⇒ P → P | _ ⇒ P ]
- | xC ⇒ match e2 with [ xC ⇒ P → P | _ ⇒ P ] | xD ⇒ match e2 with [ xD ⇒ P → P | _ ⇒ P ]
- | xE ⇒ match e2 with [ xE ⇒ P → P | _ ⇒ P ] | xF ⇒ match e2 with [ xF ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ]
- | MODE_SRT t1 ⇒ match i2 with
- [ MODE_SRT t2 ⇒ match t1 with
- [ t00 ⇒ match t2 with [ t00 ⇒ P → P | _ ⇒ P ] | t01 ⇒ match t2 with [ t01 ⇒ P → P | _ ⇒ P ]
- | t02 ⇒ match t2 with [ t02 ⇒ P → P | _ ⇒ P ] | t03 ⇒ match t2 with [ t03 ⇒ P → P | _ ⇒ P ]
- | t04 ⇒ match t2 with [ t04 ⇒ P → P | _ ⇒ P ] | t05 ⇒ match t2 with [ t05 ⇒ P → P | _ ⇒ P ]
- | t06 ⇒ match t2 with [ t06 ⇒ P → P | _ ⇒ P ] | t07 ⇒ match t2 with [ t07 ⇒ P → P | _ ⇒ P ]
- | t08 ⇒ match t2 with [ t08 ⇒ P → P | _ ⇒ P ] | t09 ⇒ match t2 with [ t09 ⇒ P → P | _ ⇒ P ]
- | t0A ⇒ match t2 with [ t0A ⇒ P → P | _ ⇒ P ] | t0B ⇒ match t2 with [ t0B ⇒ P → P | _ ⇒ P ]
- | t0C ⇒ match t2 with [ t0C ⇒ P → P | _ ⇒ P ] | t0D ⇒ match t2 with [ t0D ⇒ P → P | _ ⇒ P ]
- | t0E ⇒ match t2 with [ t0E ⇒ P → P | _ ⇒ P ] | t0F ⇒ match t2 with [ t0F ⇒ P → P | _ ⇒ P ]
- | t10 ⇒ match t2 with [ t10 ⇒ P → P | _ ⇒ P ] | t11 ⇒ match t2 with [ t11 ⇒ P → P | _ ⇒ P ]
- | t12 ⇒ match t2 with [ t12 ⇒ P → P | _ ⇒ P ] | t13 ⇒ match t2 with [ t13 ⇒ P → P | _ ⇒ P ]
- | t14 ⇒ match t2 with [ t14 ⇒ P → P | _ ⇒ P ] | t15 ⇒ match t2 with [ t15 ⇒ P → P | _ ⇒ P ]
- | t16 ⇒ match t2 with [ t16 ⇒ P → P | _ ⇒ P ] | t17 ⇒ match t2 with [ t17 ⇒ P → P | _ ⇒ P ]
- | t18 ⇒ match t2 with [ t18 ⇒ P → P | _ ⇒ P ] | t19 ⇒ match t2 with [ t19 ⇒ P → P | _ ⇒ P ]
- | t1A ⇒ match t2 with [ t1A ⇒ P → P | _ ⇒ P ] | t1B ⇒ match t2 with [ t1B ⇒ P → P | _ ⇒ P ]
- | t1C ⇒ match t2 with [ t1C ⇒ P → P | _ ⇒ P ] | t1D ⇒ match t2 with [ t1D ⇒ P → P | _ ⇒ P ]
- | t1E ⇒ match t2 with [ t1E ⇒ P → P | _ ⇒ P ] | t1F ⇒ match t2 with [ t1F ⇒ P → P | _ ⇒ P ]]
- | _ ⇒ P ]
- ].
-
-ndefinition instr_mode_destruct : instr_mode_destruct_aux.
- #t1; ncases t1;
- ##[ ##1: napply instr_mode_destruct1 ##| ##2: napply instr_mode_destruct2
- ##| ##3: napply instr_mode_destruct3 ##| ##4: napply instr_mode_destruct4
- ##| ##5: napply instr_mode_destruct5 ##| ##6: napply instr_mode_destruct6
- ##| ##7: napply instr_mode_destruct7 ##| ##8: napply instr_mode_destruct8
- ##| ##9: napply instr_mode_destruct9 ##| ##10: napply instr_mode_destruct10
- ##| ##11: napply instr_mode_destruct11 ##| ##12: napply instr_mode_destruct12
- ##| ##13: napply instr_mode_destruct13 ##| ##14: napply instr_mode_destruct14
- ##| ##15: napply instr_mode_destruct15 ##| ##16: napply instr_mode_destruct16
- ##| ##17: napply instr_mode_destruct17 ##| ##18: napply instr_mode_destruct18
- ##| ##19: napply instr_mode_destruct19 ##| ##20: napply instr_mode_destruct20
- ##| ##21: napply instr_mode_destruct21 ##| ##22: napply instr_mode_destruct22
- ##| ##23: napply instr_mode_destruct23 ##| ##24: napply instr_mode_destruct24
- ##| ##25: napply instr_mode_destruct25 ##| ##26: napply instr_mode_destruct26
- ##| ##27: napply instr_mode_destruct27 ##| ##28: napply instr_mode_destruct28
- ##| ##29: napply instr_mode_destruct29 ##| ##30: napply instr_mode_destruct30
- ##| ##31: napply instr_mode_destruct31 ##| ##32: napply instr_mode_destruct32
- ##| ##33: napply instr_mode_destruct33 ##| ##34: napply instr_mode_destruct34
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode_base_lemmas_instrmode1.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-nlemma symmetric_eqim : symmetricT instr_mode bool eq_im.
- #i1; #i2;
- ncases i1;
- ##[ ##1: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##2: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##3: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##4: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##5: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##6: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##7: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##8: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##9: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##10: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##11: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##12: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##13: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##14: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##15: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##16: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##17: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##18: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##19: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##20: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##21: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##22: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##23: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##24: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##25: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##26: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##27: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##28: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##29: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##30: ncases i2; nnormalize; ##[ ##31,32,33,34: #n ##] napply refl_eq
- ##| ##31: ncases i2; #n1;
- ##[ ##31: #n2;
- nchange with (eq_oct n2 n1 = eq_oct n1 n2);
- nrewrite > (symmetric_eqoct n1 n2);
- ##| ##32,33,34: #n2; nnormalize
- ##]
- nnormalize; napply refl_eq
- ##| ##32: ncases i2; #n1;
- ##[ ##32: #n2;
- nchange with (eq_oct n2 n1 = eq_oct n1 n2);
- nrewrite > (symmetric_eqoct n1 n2);
- ##| ##31,33,34: #n2; nnormalize
- ##]
- nnormalize; napply refl_eq
- ##| ##33: ncases i2; #n1;
- ##[ ##33: #n2;
- nchange with (eq_ex n2 n1 = eq_ex n1 n2);
- nrewrite > (symmetric_eqex n1 n2);
- ##| ##31,32,34: #n2; nnormalize
- ##]
- nnormalize; napply refl_eq
- ##| ##34: ncases i2; #n1;
- ##[ ##34: #n2;
- nchange with (eq_bit n2 n1 = eq_bit n1 n2);
- nrewrite > (symmetric_eqbit n1 n2);
- ##| ##31,32,33: #n2; nnormalize
- ##]
- nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma eqim_to_eq1 : ∀i2.eq_im MODE_INH i2 = true → MODE_INH = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##1: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq2 : ∀i2.eq_im MODE_INHA i2 = true → MODE_INHA = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##2: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq3 : ∀i2.eq_im MODE_INHX i2 = true → MODE_INHX = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##3: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq4 : ∀i2.eq_im MODE_INHH i2 = true → MODE_INHH = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##4: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq5 : ∀i2.eq_im MODE_INHX0ADD i2 = true → MODE_INHX0ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##5: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq6 : ∀i2.eq_im MODE_INHX1ADD i2 = true → MODE_INHX1ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##6: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq7 : ∀i2.eq_im MODE_INHX2ADD i2 = true → MODE_INHX2ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##7: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq8 : ∀i2.eq_im MODE_IMM1 i2 = true → MODE_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##8: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq9 : ∀i2.eq_im MODE_IMM1EXT i2 = true → MODE_IMM1EXT = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##9: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq10 : ∀i2.eq_im MODE_IMM2 i2 = true → MODE_IMM2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##10: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq11 : ∀i2.eq_im MODE_DIR1 i2 = true → MODE_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##11: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq12 : ∀i2.eq_im MODE_DIR2 i2 = true → MODE_DIR2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##12: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq13 : ∀i2.eq_im MODE_IX0 i2 = true → MODE_IX0 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##13: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq14 : ∀i2.eq_im MODE_IX1 i2 = true → MODE_IX1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##14: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq15 : ∀i2.eq_im MODE_IX2 i2 = true → MODE_IX2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##15: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq16 : ∀i2.eq_im MODE_SP1 i2 = true → MODE_SP1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##16: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq17 : ∀i2.eq_im MODE_SP2 i2 = true → MODE_SP2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##17: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq18 : ∀i2.eq_im MODE_DIR1_to_DIR1 i2 = true → MODE_DIR1_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##18: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq19 : ∀i2.eq_im MODE_IMM1_to_DIR1 i2 = true → MODE_IMM1_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##19: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq20 : ∀i2.eq_im MODE_IX0p_to_DIR1 i2 = true → MODE_IX0p_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##20: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq21 : ∀i2.eq_im MODE_DIR1_to_IX0p i2 = true → MODE_DIR1_to_IX0p = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##21: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq22 : ∀i2.eq_im MODE_INHA_and_IMM1 i2 = true → MODE_INHA_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##22: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq23 : ∀i2.eq_im MODE_INHX_and_IMM1 i2 = true → MODE_INHX_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##23: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq24 : ∀i2.eq_im MODE_IMM1_and_IMM1 i2 = true → MODE_IMM1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##24: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq25 : ∀i2.eq_im MODE_DIR1_and_IMM1 i2 = true → MODE_DIR1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##25: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq26 : ∀i2.eq_im MODE_IX0_and_IMM1 i2 = true → MODE_IX0_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##26: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq27 : ∀i2.eq_im MODE_IX0p_and_IMM1 i2 = true → MODE_IX0p_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##27: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq28 : ∀i2.eq_im MODE_IX1_and_IMM1 i2 = true → MODE_IX1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##28: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq29 : ∀i2.eq_im MODE_IX1p_and_IMM1 i2 = true → MODE_IX1p_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##29: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq30 : ∀i2.eq_im MODE_SP1_and_IMM1 i2 = true → MODE_SP1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##30: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq31 : ∀n1,i2.eq_im (MODE_DIRn n1) i2 = true → MODE_DIRn n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##31: #n2; #H;
- nchange in H:(%) with (eq_oct n1 n2 = true);
- nrewrite > (eqoct_to_eq … H);
- napply refl_eq
- ##| ##32,33,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq32 : ∀n1,i2.eq_im (MODE_DIRn_and_IMM1 n1) i2 = true → MODE_DIRn_and_IMM1 n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##32: #n2; #H;
- nchange in H:(%) with (eq_oct n1 n2 = true);
- nrewrite > (eqoct_to_eq … H);
- napply refl_eq
- ##| ##31,33,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq33 : ∀n1,i2.eq_im (MODE_TNY n1) i2 = true → MODE_TNY n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##33: #n2; #H;
- nchange in H:(%) with (eq_ex n1 n2 = true);
- nrewrite > (eqex_to_eq … H);
- napply refl_eq
- ##| ##31,32,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq34 : ∀n1,i2.eq_im (MODE_SRT n1) i2 = true → MODE_SRT n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##34: #n2; #H;
- nchange in H:(%) with (eq_bit n1 n2 = true);
- nrewrite > (eqbit_to_eq … H);
- napply refl_eq
- ##| ##31,32,33: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq : ∀i1,i2.eq_im i1 i2 = true → i1 = i2.
- #i1; ncases i1;
- ##[ ##1: napply eqim_to_eq1 ##| ##2: napply eqim_to_eq2
- ##| ##3: napply eqim_to_eq3 ##| ##4: napply eqim_to_eq4
- ##| ##5: napply eqim_to_eq5 ##| ##6: napply eqim_to_eq6
- ##| ##7: napply eqim_to_eq7 ##| ##8: napply eqim_to_eq8
- ##| ##9: napply eqim_to_eq9 ##| ##10: napply eqim_to_eq10
- ##| ##11: napply eqim_to_eq11 ##| ##12: napply eqim_to_eq12
- ##| ##13: napply eqim_to_eq13 ##| ##14: napply eqim_to_eq14
- ##| ##15: napply eqim_to_eq15 ##| ##16: napply eqim_to_eq16
- ##| ##17: napply eqim_to_eq17 ##| ##18: napply eqim_to_eq18
- ##| ##19: napply eqim_to_eq19 ##| ##20: napply eqim_to_eq20
- ##| ##21: napply eqim_to_eq21 ##| ##22: napply eqim_to_eq22
- ##| ##23: napply eqim_to_eq23 ##| ##24: napply eqim_to_eq24
- ##| ##25: napply eqim_to_eq25 ##| ##26: napply eqim_to_eq26
- ##| ##27: napply eqim_to_eq27 ##| ##28: napply eqim_to_eq28
- ##| ##29: napply eqim_to_eq29 ##| ##30: napply eqim_to_eq30
- ##| ##31: napply eqim_to_eq31 ##| ##32: napply eqim_to_eq32
- ##| ##33: napply eqim_to_eq33 ##| ##34: napply eqim_to_eq34
- ##]
-nqed.
-
-nlemma eq_to_eqim1 : ∀i2.MODE_INH = i2 → eq_im MODE_INH i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##1: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim2 : ∀i2.MODE_INHA = i2 → eq_im MODE_INHA i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##2: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim3 : ∀i2.MODE_INHX = i2 → eq_im MODE_INHX i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##3: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim4 : ∀i2.MODE_INHH = i2 → eq_im MODE_INHH i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##4: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim5 : ∀i2.MODE_INHX0ADD = i2 → eq_im MODE_INHX0ADD i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##5: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim6 : ∀i2.MODE_INHX1ADD = i2 → eq_im MODE_INHX1ADD i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##6: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim7 : ∀i2.MODE_INHX2ADD = i2 → eq_im MODE_INHX2ADD i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##7: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim8 : ∀i2.MODE_IMM1 = i2 → eq_im MODE_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##8: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim9 : ∀i2.MODE_IMM1EXT = i2 → eq_im MODE_IMM1EXT i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##9: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim10 : ∀i2.MODE_IMM2 = i2 → eq_im MODE_IMM2 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##10: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim11 : ∀i2.MODE_DIR1 = i2 → eq_im MODE_DIR1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##11: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim12 : ∀i2.MODE_DIR2 = i2 → eq_im MODE_DIR2 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##12: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim13 : ∀i2.MODE_IX0 = i2 → eq_im MODE_IX0 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##13: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim14 : ∀i2.MODE_IX1 = i2 → eq_im MODE_IX1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##14: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim15 : ∀i2.MODE_IX2 = i2 → eq_im MODE_IX2 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##15: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim16 : ∀i2.MODE_SP1 = i2 → eq_im MODE_SP1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##16: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim17 : ∀i2.MODE_SP2 = i2 → eq_im MODE_SP2 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##17: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim18 : ∀i2.MODE_DIR1_to_DIR1 = i2 → eq_im MODE_DIR1_to_DIR1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##18: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim19 : ∀i2.MODE_IMM1_to_DIR1 = i2 → eq_im MODE_IMM1_to_DIR1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##19: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim20 : ∀i2.MODE_IX0p_to_DIR1 = i2 → eq_im MODE_IX0p_to_DIR1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##20: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim21 : ∀i2.MODE_DIR1_to_IX0p = i2 → eq_im MODE_DIR1_to_IX0p i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##21: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim22 : ∀i2.MODE_INHA_and_IMM1 = i2 → eq_im MODE_INHA_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##22: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim23 : ∀i2.MODE_INHX_and_IMM1 = i2 → eq_im MODE_INHX_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##23: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim24 : ∀i2.MODE_IMM1_and_IMM1 = i2 → eq_im MODE_IMM1_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##24: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim25 : ∀i2.MODE_DIR1_and_IMM1 = i2 → eq_im MODE_DIR1_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##25: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim26 : ∀i2.MODE_IX0_and_IMM1 = i2 → eq_im MODE_IX0_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##26: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim27 : ∀i2.MODE_IX0p_and_IMM1 = i2 → eq_im MODE_IX0p_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##27: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim28 : ∀i2.MODE_IX1_and_IMM1 = i2 → eq_im MODE_IX1_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##28: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim29 : ∀i2.MODE_IX1p_and_IMM1 = i2 → eq_im MODE_IX1p_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##29: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim30 : ∀i2.MODE_SP1_and_IMM1 = i2 → eq_im MODE_SP1_and_IMM1 i2 = true.
- #t2; ncases t2; nnormalize;
- ##[ ##30: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (instr_mode_destruct … H)
- ##| ##*: #H; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim31 : ∀n1,i2.MODE_DIRn n1 = i2 → eq_im (MODE_DIRn n1) i2 = true.
- #n1; #t2; ncases t2;
- ##[ ##31: #n2; #H;
- nchange with (eq_oct n1 n2 = true);
- nrewrite > (instr_mode_destruct_MODE_DIRn … H);
- nrewrite > (eq_to_eqoct n2 n2 (refl_eq …));
- napply refl_eq
- ##| ##32,33,34: #n; #H; nnormalize; napply (instr_mode_destruct … H)
- ##| ##*: #H; nnormalize; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim32 : ∀n1,i2.MODE_DIRn_and_IMM1 n1 = i2 → eq_im (MODE_DIRn_and_IMM1 n1) i2 = true.
- #n1; #t2; ncases t2;
- ##[ ##32: #n2; #H;
- nchange with (eq_oct n1 n2 = true);
- nrewrite > (instr_mode_destruct_MODE_DIRn_and_IMM1 … H);
- nrewrite > (eq_to_eqoct n2 n2 (refl_eq …));
- napply refl_eq
- ##| ##31,33,34: #n; #H; nnormalize; napply (instr_mode_destruct … H)
- ##| ##*: #H; nnormalize; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim33 : ∀n1,i2.MODE_TNY n1 = i2 → eq_im (MODE_TNY n1) i2 = true.
- #n1; #t2; ncases t2;
- ##[ ##33: #n2; #H;
- nchange with (eq_ex n1 n2 = true);
- nrewrite > (instr_mode_destruct_MODE_TNY … H);
- nrewrite > (eq_to_eqex n2 n2 (refl_eq …));
- napply refl_eq
- ##| ##31,32,34: #n; #H; nnormalize; napply (instr_mode_destruct … H)
- ##| ##*: #H; nnormalize; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim34 : ∀n1,i2.MODE_SRT n1 = i2 → eq_im (MODE_SRT n1) i2 = true.
- #n1; #t2; ncases t2;
- ##[ ##34: #n2; #H;
- nchange with (eq_bit n1 n2 = true);
- nrewrite > (instr_mode_destruct_MODE_SRT … H);
- nrewrite > (eq_to_eqbit n2 n2 (refl_eq …));
- napply refl_eq
- ##| ##31,32,33: #n; #H; nnormalize; napply (instr_mode_destruct … H)
- ##| ##*: #H; nnormalize; napply (instr_mode_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqim : ∀i1,i2.i1 = i2 → eq_im i1 i2 = true.
- #i1; ncases i1;
- ##[ ##1: napply eq_to_eqim1 ##| ##2: napply eq_to_eqim2
- ##| ##3: napply eq_to_eqim3 ##| ##4: napply eq_to_eqim4
- ##| ##5: napply eq_to_eqim5 ##| ##6: napply eq_to_eqim6
- ##| ##7: napply eq_to_eqim7 ##| ##8: napply eq_to_eqim8
- ##| ##9: napply eq_to_eqim9 ##| ##10: napply eq_to_eqim10
- ##| ##11: napply eq_to_eqim11 ##| ##12: napply eq_to_eqim12
- ##| ##13: napply eq_to_eqim13 ##| ##14: napply eq_to_eqim14
- ##| ##15: napply eq_to_eqim15 ##| ##16: napply eq_to_eqim16
- ##| ##17: napply eq_to_eqim17 ##| ##18: napply eq_to_eqim18
- ##| ##19: napply eq_to_eqim19 ##| ##20: napply eq_to_eqim20
- ##| ##21: napply eq_to_eqim21 ##| ##22: napply eq_to_eqim22
- ##| ##23: napply eq_to_eqim23 ##| ##24: napply eq_to_eqim24
- ##| ##25: napply eq_to_eqim25 ##| ##26: napply eq_to_eqim26
- ##| ##27: napply eq_to_eqim27 ##| ##28: napply eq_to_eqim28
- ##| ##29: napply eq_to_eqim29 ##| ##30: napply eq_to_eqim30
- ##| ##31: napply eq_to_eqim31 ##| ##32: napply eq_to_eqim32
- ##| ##33: napply eq_to_eqim33 ##| ##34: napply eq_to_eqim34
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-ndefinition opcode_destruct1 : Πop2.ΠP:Prop.ADC = op2 → match op2 with [ ADC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##1: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ADC with [ ADC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct2 : Πop2.ΠP:Prop.ADD = op2 → match op2 with [ ADD ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##2: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ADD with [ ADD ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct3 : Πop2.ΠP:Prop.AIS = op2 → match op2 with [ AIS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##3: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match AIS with [ AIS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct4 : Πop2.ΠP:Prop.AIX = op2 → match op2 with [ AIX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##4: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match AIX with [ AIX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct5 : Πop2.ΠP:Prop.AND = op2 → match op2 with [ AND ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##5: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match AND with [ AND ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct6 : Πop2.ΠP:Prop.ASL = op2 → match op2 with [ ASL ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##6: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ASL with [ ASL ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct7 : Πop2.ΠP:Prop.ASR = op2 → match op2 with [ ASR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##7: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ASR with [ ASR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct8 : Πop2.ΠP:Prop.BCC = op2 → match op2 with [ BCC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##8: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BCC with [ BCC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct9 : Πop2.ΠP:Prop.BCLRn = op2 → match op2 with [ BCLRn ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##9: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BCLRn with [ BCLRn ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct10 : Πop2.ΠP:Prop.BCS = op2 → match op2 with [ BCS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##10: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BCS with [ BCS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct11 : Πop2.ΠP:Prop.BEQ = op2 → match op2 with [ BEQ ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##11: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BEQ with [ BEQ ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct12 : Πop2.ΠP:Prop.BGE = op2 → match op2 with [ BGE ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##12: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BGE with [ BGE ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct13 : Πop2.ΠP:Prop.BGND = op2 → match op2 with [ BGND ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##13: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BGND with [ BGND ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct14 : Πop2.ΠP:Prop.BGT = op2 → match op2 with [ BGT ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##14: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BGT with [ BGT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct15 : Πop2.ΠP:Prop.BHCC = op2 → match op2 with [ BHCC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##15: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BHCC with [ BHCC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct16 : Πop2.ΠP:Prop.BHCS = op2 → match op2 with [ BHCS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##16: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BHCS with [ BHCS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct17 : Πop2.ΠP:Prop.BHI = op2 → match op2 with [ BHI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##17: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BHI with [ BHI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct18 : Πop2.ΠP:Prop.BIH = op2 → match op2 with [ BIH ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##18: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BIH with [ BIH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct19 : Πop2.ΠP:Prop.BIL = op2 → match op2 with [ BIL ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##19: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BIL with [ BIL ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct20 : Πop2.ΠP:Prop.BIT = op2 → match op2 with [ BIT ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##20: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BIT with [ BIT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct21 : Πop2.ΠP:Prop.BLE = op2 → match op2 with [ BLE ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##21: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BLE with [ BLE ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct22 : Πop2.ΠP:Prop.BLS = op2 → match op2 with [ BLS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##22: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BLS with [ BLS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct23 : Πop2.ΠP:Prop.BLT = op2 → match op2 with [ BLT ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##23: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BLT with [ BLT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct24 : Πop2.ΠP:Prop.BMC = op2 → match op2 with [ BMC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##24: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BMC with [ BMC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct25 : Πop2.ΠP:Prop.BMI = op2 → match op2 with [ BMI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##25: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BMI with [ BMI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct26 : Πop2.ΠP:Prop.BMS = op2 → match op2 with [ BMS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##26: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BMS with [ BMS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct27 : Πop2.ΠP:Prop.BNE = op2 → match op2 with [ BNE ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##27: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BNE with [ BNE ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct28 : Πop2.ΠP:Prop.BPL = op2 → match op2 with [ BPL ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##28: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BPL with [ BPL ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct29 : Πop2.ΠP:Prop.BRA = op2 → match op2 with [ BRA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##29: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BRA with [ BRA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct30 : Πop2.ΠP:Prop.BRCLRn = op2 → match op2 with [ BRCLRn ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##30: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BRCLRn with [ BRCLRn ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct31 : Πop2.ΠP:Prop.BRN = op2 → match op2 with [ BRN ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##31: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BRN with [ BRN ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct32 : Πop2.ΠP:Prop.BRSETn = op2 → match op2 with [ BRSETn ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##32: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BRSETn with [ BRSETn ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct33 : Πop2.ΠP:Prop.BSETn = op2 → match op2 with [ BSETn ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##33: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BSETn with [ BSETn ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct34 : Πop2.ΠP:Prop.BSR = op2 → match op2 with [ BSR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##34: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match BSR with [ BSR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct35 : Πop2.ΠP:Prop.CBEQA = op2 → match op2 with [ CBEQA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##35: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CBEQA with [ CBEQA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct36 : Πop2.ΠP:Prop.CBEQX = op2 → match op2 with [ CBEQX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##36: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CBEQX with [ CBEQX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct37 : Πop2.ΠP:Prop.CLC = op2 → match op2 with [ CLC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##37: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CLC with [ CLC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct38 : Πop2.ΠP:Prop.CLI = op2 → match op2 with [ CLI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##38: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CLI with [ CLI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct39 : Πop2.ΠP:Prop.CLR = op2 → match op2 with [ CLR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##39: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CLR with [ CLR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct40 : Πop2.ΠP:Prop.CMP = op2 → match op2 with [ CMP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##40: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CMP with [ CMP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct41 : Πop2.ΠP:Prop.COM = op2 → match op2 with [ COM ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##41: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match COM with [ COM ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct42 : Πop2.ΠP:Prop.CPHX = op2 → match op2 with [ CPHX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##42: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CPHX with [ CPHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct43 : Πop2.ΠP:Prop.CPX = op2 → match op2 with [ CPX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##43: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match CPX with [ CPX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct44 : Πop2.ΠP:Prop.DAA = op2 → match op2 with [ DAA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##44: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match DAA with [ DAA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct45 : Πop2.ΠP:Prop.DBNZ = op2 → match op2 with [ DBNZ ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##45: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match DBNZ with [ DBNZ ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct46 : Πop2.ΠP:Prop.DEC = op2 → match op2 with [ DEC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##46: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match DEC with [ DEC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct47 : Πop2.ΠP:Prop.DIV = op2 → match op2 with [ DIV ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##47: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match DIV with [ DIV ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct48 : Πop2.ΠP:Prop.EOR = op2 → match op2 with [ EOR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##48: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match EOR with [ EOR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct49 : Πop2.ΠP:Prop.INC = op2 → match op2 with [ INC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##49: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match INC with [ INC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct50 : Πop2.ΠP:Prop.JMP = op2 → match op2 with [ JMP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##50: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match JMP with [ JMP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct51 : Πop2.ΠP:Prop.JSR = op2 → match op2 with [ JSR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##51: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match JSR with [ JSR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct52 : Πop2.ΠP:Prop.LDA = op2 → match op2 with [ LDA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##52: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match LDA with [ LDA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct53 : Πop2.ΠP:Prop.LDHX = op2 → match op2 with [ LDHX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##53: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match LDHX with [ LDHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct54 : Πop2.ΠP:Prop.LDX = op2 → match op2 with [ LDX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##54: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match LDX with [ LDX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct55 : Πop2.ΠP:Prop.LSR = op2 → match op2 with [ LSR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##55: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match LSR with [ LSR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct56 : Πop2.ΠP:Prop.MOV = op2 → match op2 with [ MOV ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##56: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match MOV with [ MOV ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct57 : Πop2.ΠP:Prop.MUL = op2 → match op2 with [ MUL ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##57: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match MUL with [ MUL ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct58 : Πop2.ΠP:Prop.NEG = op2 → match op2 with [ NEG ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##58: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match NEG with [ NEG ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct59 : Πop2.ΠP:Prop.NOP = op2 → match op2 with [ NOP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##59: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match NOP with [ NOP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct60 : Πop2.ΠP:Prop.NSA = op2 → match op2 with [ NSA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##60: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match NSA with [ NSA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct61 : Πop2.ΠP:Prop.ORA = op2 → match op2 with [ ORA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##61: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ORA with [ ORA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct62 : Πop2.ΠP:Prop.PSHA = op2 → match op2 with [ PSHA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##62: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PSHA with [ PSHA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct63 : Πop2.ΠP:Prop.PSHH = op2 → match op2 with [ PSHH ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##63: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PSHH with [ PSHH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct64 : Πop2.ΠP:Prop.PSHX = op2 → match op2 with [ PSHX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##64: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PSHX with [ PSHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct65 : Πop2.ΠP:Prop.PULA = op2 → match op2 with [ PULA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##65: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PULA with [ PULA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct66 : Πop2.ΠP:Prop.PULH = op2 → match op2 with [ PULH ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##66: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PULH with [ PULH ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct67 : Πop2.ΠP:Prop.PULX = op2 → match op2 with [ PULX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##67: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match PULX with [ PULX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct68 : Πop2.ΠP:Prop.ROL = op2 → match op2 with [ ROL ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##68: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ROL with [ ROL ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct69 : Πop2.ΠP:Prop.ROR = op2 → match op2 with [ ROR ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##69: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match ROR with [ ROR ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct70 : Πop2.ΠP:Prop.RSP = op2 → match op2 with [ RSP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##70: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match RSP with [ RSP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct71 : Πop2.ΠP:Prop.RTI = op2 → match op2 with [ RTI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##71: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match RTI with [ RTI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct72 : Πop2.ΠP:Prop.RTS = op2 → match op2 with [ RTS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##72: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match RTS with [ RTS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct73 : Πop2.ΠP:Prop.SBC = op2 → match op2 with [ SBC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##73: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SBC with [ SBC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct74 : Πop2.ΠP:Prop.SEC = op2 → match op2 with [ SEC ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##74: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SEC with [ SEC ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct75 : Πop2.ΠP:Prop.SEI = op2 → match op2 with [ SEI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##75: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SEI with [ SEI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct76 : Πop2.ΠP:Prop.SHA = op2 → match op2 with [ SHA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##76: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SHA with [ SHA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct77 : Πop2.ΠP:Prop.SLA = op2 → match op2 with [ SLA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##77: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SLA with [ SLA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct78 : Πop2.ΠP:Prop.STA = op2 → match op2 with [ STA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##78: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match STA with [ STA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct79 : Πop2.ΠP:Prop.STHX = op2 → match op2 with [ STHX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##79: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match STHX with [ STHX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct80 : Πop2.ΠP:Prop.STOP = op2 → match op2 with [ STOP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##80: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match STOP with [ STOP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct81 : Πop2.ΠP:Prop.STX = op2 → match op2 with [ STX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##81: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match STX with [ STX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct82 : Πop2.ΠP:Prop.SUB = op2 → match op2 with [ SUB ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##82: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SUB with [ SUB ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct83 : Πop2.ΠP:Prop.SWI = op2 → match op2 with [ SWI ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##83: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match SWI with [ SWI ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct84 : Πop2.ΠP:Prop.TAP = op2 → match op2 with [ TAP ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##84: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TAP with [ TAP ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct85 : Πop2.ΠP:Prop.TAX = op2 → match op2 with [ TAX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##85: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TAX with [ TAX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct86 : Πop2.ΠP:Prop.TPA = op2 → match op2 with [ TPA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##86: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TPA with [ TPA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct87 : Πop2.ΠP:Prop.TST = op2 → match op2 with [ TST ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##87: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TST with [ TST ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct88 : Πop2.ΠP:Prop.TSX = op2 → match op2 with [ TSX ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##88: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TSX with [ TSX ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct89 : Πop2.ΠP:Prop.TXA = op2 → match op2 with [ TXA ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##89: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TXA with [ TXA ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct90 : Πop2.ΠP:Prop.TXS = op2 → match op2 with [ TXS ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##90: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match TXS with [ TXS ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct91 : Πop2.ΠP:Prop.WAIT = op2 → match op2 with [ WAIT ⇒ P → P | _ ⇒ P ].
- #op2; #P; ncases op2; nnormalize;
- ##[ ##91: #H; napply (λx:P.x)
- ##| ##*: #H; napply False_ind;
- nchange with (match WAIT with [ WAIT ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition opcode_destruct_aux ≝
-Πop1,op2.ΠP:Prop.op1 = op2 →
- match op1 with
- [ ADC ⇒ match op2 with [ ADC ⇒ P → P | _ ⇒ P ]
- | ADD ⇒ match op2 with [ ADD ⇒ P → P | _ ⇒ P ]
- | AIS ⇒ match op2 with [ AIS ⇒ P → P | _ ⇒ P ]
- | AIX ⇒ match op2 with [ AIX ⇒ P → P | _ ⇒ P ]
- | AND ⇒ match op2 with [ AND ⇒ P → P | _ ⇒ P ]
- | ASL ⇒ match op2 with [ ASL ⇒ P → P | _ ⇒ P ]
- | ASR ⇒ match op2 with [ ASR ⇒ P → P | _ ⇒ P ]
- | BCC ⇒ match op2 with [ BCC ⇒ P → P | _ ⇒ P ]
- | BCLRn ⇒ match op2 with [ BCLRn ⇒ P → P | _ ⇒ P ]
- | BCS ⇒ match op2 with [ BCS ⇒ P → P | _ ⇒ P ]
- | BEQ ⇒ match op2 with [ BEQ ⇒ P → P | _ ⇒ P ]
- | BGE ⇒ match op2 with [ BGE ⇒ P → P | _ ⇒ P ]
- | BGND ⇒ match op2 with [ BGND ⇒ P → P | _ ⇒ P ]
- | BGT ⇒ match op2 with [ BGT ⇒ P → P | _ ⇒ P ]
- | BHCC ⇒ match op2 with [ BHCC ⇒ P → P | _ ⇒ P ]
- | BHCS ⇒ match op2 with [ BHCS ⇒ P → P | _ ⇒ P ]
- | BHI ⇒ match op2 with [ BHI ⇒ P → P | _ ⇒ P ]
- | BIH ⇒ match op2 with [ BIH ⇒ P → P | _ ⇒ P ]
- | BIL ⇒ match op2 with [ BIL ⇒ P → P | _ ⇒ P ]
- | BIT ⇒ match op2 with [ BIT ⇒ P → P | _ ⇒ P ]
- | BLE ⇒ match op2 with [ BLE ⇒ P → P | _ ⇒ P ]
- | BLS ⇒ match op2 with [ BLS ⇒ P → P | _ ⇒ P ]
- | BLT ⇒ match op2 with [ BLT ⇒ P → P | _ ⇒ P ]
- | BMC ⇒ match op2 with [ BMC ⇒ P → P | _ ⇒ P ]
- | BMI ⇒ match op2 with [ BMI ⇒ P → P | _ ⇒ P ]
- | BMS ⇒ match op2 with [ BMS ⇒ P → P | _ ⇒ P ]
- | BNE ⇒ match op2 with [ BNE ⇒ P → P | _ ⇒ P ]
- | BPL ⇒ match op2 with [ BPL ⇒ P → P | _ ⇒ P ]
- | BRA ⇒ match op2 with [ BRA ⇒ P → P | _ ⇒ P ]
- | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ P → P | _ ⇒ P ]
- | BRN ⇒ match op2 with [ BRN ⇒ P → P | _ ⇒ P ]
- | BRSETn ⇒ match op2 with [ BRSETn ⇒ P → P | _ ⇒ P ]
- | BSETn ⇒ match op2 with [ BSETn ⇒ P → P | _ ⇒ P ]
- | BSR ⇒ match op2 with [ BSR ⇒ P → P | _ ⇒ P ]
- | CBEQA ⇒ match op2 with [ CBEQA ⇒ P → P | _ ⇒ P ]
- | CBEQX ⇒ match op2 with [ CBEQX ⇒ P → P | _ ⇒ P ]
- | CLC ⇒ match op2 with [ CLC ⇒ P → P | _ ⇒ P ]
- | CLI ⇒ match op2 with [ CLI ⇒ P → P | _ ⇒ P ]
- | CLR ⇒ match op2 with [ CLR ⇒ P → P | _ ⇒ P ]
- | CMP ⇒ match op2 with [ CMP ⇒ P → P | _ ⇒ P ]
- | COM ⇒ match op2 with [ COM ⇒ P → P | _ ⇒ P ]
- | CPHX ⇒ match op2 with [ CPHX ⇒ P → P | _ ⇒ P ]
- | CPX ⇒ match op2 with [ CPX ⇒ P → P | _ ⇒ P ]
- | DAA ⇒ match op2 with [ DAA ⇒ P → P | _ ⇒ P ]
- | DBNZ ⇒ match op2 with [ DBNZ ⇒ P → P | _ ⇒ P ]
- | DEC ⇒ match op2 with [ DEC ⇒ P → P | _ ⇒ P ]
- | DIV ⇒ match op2 with [ DIV ⇒ P → P | _ ⇒ P ]
- | EOR ⇒ match op2 with [ EOR ⇒ P → P | _ ⇒ P ]
- | INC ⇒ match op2 with [ INC ⇒ P → P | _ ⇒ P ]
- | JMP ⇒ match op2 with [ JMP ⇒ P → P | _ ⇒ P ]
- | JSR ⇒ match op2 with [ JSR ⇒ P → P | _ ⇒ P ]
- | LDA ⇒ match op2 with [ LDA ⇒ P → P | _ ⇒ P ]
- | LDHX ⇒ match op2 with [ LDHX ⇒ P → P | _ ⇒ P ]
- | LDX ⇒ match op2 with [ LDX ⇒ P → P | _ ⇒ P ]
- | LSR ⇒ match op2 with [ LSR ⇒ P → P | _ ⇒ P ]
- | MOV ⇒ match op2 with [ MOV ⇒ P → P | _ ⇒ P ]
- | MUL ⇒ match op2 with [ MUL ⇒ P → P | _ ⇒ P ]
- | NEG ⇒ match op2 with [ NEG ⇒ P → P | _ ⇒ P ]
- | NOP ⇒ match op2 with [ NOP ⇒ P → P | _ ⇒ P ]
- | NSA ⇒ match op2 with [ NSA ⇒ P → P | _ ⇒ P ]
- | ORA ⇒ match op2 with [ ORA ⇒ P → P | _ ⇒ P ]
- | PSHA ⇒ match op2 with [ PSHA ⇒ P → P | _ ⇒ P ]
- | PSHH ⇒ match op2 with [ PSHH ⇒ P → P | _ ⇒ P ]
- | PSHX ⇒ match op2 with [ PSHX ⇒ P → P | _ ⇒ P ]
- | PULA ⇒ match op2 with [ PULA ⇒ P → P | _ ⇒ P ]
- | PULH ⇒ match op2 with [ PULH ⇒ P → P | _ ⇒ P ]
- | PULX ⇒ match op2 with [ PULX ⇒ P → P | _ ⇒ P ]
- | ROL ⇒ match op2 with [ ROL ⇒ P → P | _ ⇒ P ]
- | ROR ⇒ match op2 with [ ROR ⇒ P → P | _ ⇒ P ]
- | RSP ⇒ match op2 with [ RSP ⇒ P → P | _ ⇒ P ]
- | RTI ⇒ match op2 with [ RTI ⇒ P → P | _ ⇒ P ]
- | RTS ⇒ match op2 with [ RTS ⇒ P → P | _ ⇒ P ]
- | SBC ⇒ match op2 with [ SBC ⇒ P → P | _ ⇒ P ]
- | SEC ⇒ match op2 with [ SEC ⇒ P → P | _ ⇒ P ]
- | SEI ⇒ match op2 with [ SEI ⇒ P → P | _ ⇒ P ]
- | SHA ⇒ match op2 with [ SHA ⇒ P → P | _ ⇒ P ]
- | SLA ⇒ match op2 with [ SLA ⇒ P → P | _ ⇒ P ]
- | STA ⇒ match op2 with [ STA ⇒ P → P | _ ⇒ P ]
- | STHX ⇒ match op2 with [ STHX ⇒ P → P | _ ⇒ P ]
- | STOP ⇒ match op2 with [ STOP ⇒ P → P | _ ⇒ P ]
- | STX ⇒ match op2 with [ STX ⇒ P → P | _ ⇒ P ]
- | SUB ⇒ match op2 with [ SUB ⇒ P → P | _ ⇒ P ]
- | SWI ⇒ match op2 with [ SWI ⇒ P → P | _ ⇒ P ]
- | TAP ⇒ match op2 with [ TAP ⇒ P → P | _ ⇒ P ]
- | TAX ⇒ match op2 with [ TAX ⇒ P → P | _ ⇒ P ]
- | TPA ⇒ match op2 with [ TPA ⇒ P → P | _ ⇒ P ]
- | TST ⇒ match op2 with [ TST ⇒ P → P | _ ⇒ P ]
- | TSX ⇒ match op2 with [ TSX ⇒ P → P | _ ⇒ P ]
- | TXA ⇒ match op2 with [ TXA ⇒ P → P | _ ⇒ P ]
- | TXS ⇒ match op2 with [ TXS ⇒ P → P | _ ⇒ P ]
- | WAIT ⇒ match op2 with [ WAIT ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition opcode_destruct : opcode_destruct_aux.
- #op1; ncases op1;
- ##[ ##1: napply opcode_destruct1 ##| ##2: napply opcode_destruct2 ##| ##3: napply opcode_destruct3 ##| ##4: napply opcode_destruct4
- ##| ##5: napply opcode_destruct5 ##| ##6: napply opcode_destruct6 ##| ##7: napply opcode_destruct7 ##| ##8: napply opcode_destruct8
- ##| ##9: napply opcode_destruct9 ##| ##10: napply opcode_destruct10 ##| ##11: napply opcode_destruct11 ##| ##12: napply opcode_destruct12
- ##| ##13: napply opcode_destruct13 ##| ##14: napply opcode_destruct14 ##| ##15: napply opcode_destruct15 ##| ##16: napply opcode_destruct16
- ##| ##17: napply opcode_destruct17 ##| ##18: napply opcode_destruct18 ##| ##19: napply opcode_destruct19 ##| ##20: napply opcode_destruct20
- ##| ##21: napply opcode_destruct21 ##| ##22: napply opcode_destruct22 ##| ##23: napply opcode_destruct23 ##| ##24: napply opcode_destruct24
- ##| ##25: napply opcode_destruct25 ##| ##26: napply opcode_destruct26 ##| ##27: napply opcode_destruct27 ##| ##28: napply opcode_destruct28
- ##| ##29: napply opcode_destruct29 ##| ##30: napply opcode_destruct30 ##| ##31: napply opcode_destruct31 ##| ##32: napply opcode_destruct32
- ##| ##33: napply opcode_destruct33 ##| ##34: napply opcode_destruct34 ##| ##35: napply opcode_destruct35 ##| ##36: napply opcode_destruct36
- ##| ##37: napply opcode_destruct37 ##| ##38: napply opcode_destruct38 ##| ##39: napply opcode_destruct39 ##| ##40: napply opcode_destruct40
- ##| ##41: napply opcode_destruct41 ##| ##42: napply opcode_destruct42 ##| ##43: napply opcode_destruct43 ##| ##44: napply opcode_destruct44
- ##| ##45: napply opcode_destruct45 ##| ##46: napply opcode_destruct46 ##| ##47: napply opcode_destruct47 ##| ##48: napply opcode_destruct48
- ##| ##49: napply opcode_destruct49 ##| ##50: napply opcode_destruct50 ##| ##51: napply opcode_destruct51 ##| ##52: napply opcode_destruct52
- ##| ##53: napply opcode_destruct53 ##| ##54: napply opcode_destruct54 ##| ##55: napply opcode_destruct55 ##| ##56: napply opcode_destruct56
- ##| ##57: napply opcode_destruct57 ##| ##58: napply opcode_destruct58 ##| ##59: napply opcode_destruct59 ##| ##60: napply opcode_destruct60
- ##| ##61: napply opcode_destruct61 ##| ##62: napply opcode_destruct62 ##| ##63: napply opcode_destruct63 ##| ##64: napply opcode_destruct64
- ##| ##65: napply opcode_destruct65 ##| ##66: napply opcode_destruct66 ##| ##67: napply opcode_destruct67 ##| ##68: napply opcode_destruct68
- ##| ##69: napply opcode_destruct69 ##| ##70: napply opcode_destruct70 ##| ##71: napply opcode_destruct71 ##| ##72: napply opcode_destruct72
- ##| ##73: napply opcode_destruct73 ##| ##74: napply opcode_destruct74 ##| ##75: napply opcode_destruct75 ##| ##76: napply opcode_destruct76
- ##| ##77: napply opcode_destruct77 ##| ##78: napply opcode_destruct78 ##| ##79: napply opcode_destruct79 ##| ##80: napply opcode_destruct80
- ##| ##81: napply opcode_destruct81 ##| ##82: napply opcode_destruct82 ##| ##83: napply opcode_destruct83 ##| ##84: napply opcode_destruct84
- ##| ##85: napply opcode_destruct85 ##| ##86: napply opcode_destruct86 ##| ##87: napply opcode_destruct87 ##| ##88: napply opcode_destruct88
- ##| ##89: napply opcode_destruct89 ##| ##90: napply opcode_destruct90 ##| ##91: napply opcode_destruct91 ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode_base_lemmas_opcode1.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-nlemma symmetric_eqop1 : ∀op2.eq_op ADC op2 = eq_op op2 ADC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop2 : ∀op2.eq_op ADD op2 = eq_op op2 ADD. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop3 : ∀op2.eq_op AIS op2 = eq_op op2 AIS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop4 : ∀op2.eq_op AIX op2 = eq_op op2 AIX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop5 : ∀op2.eq_op AND op2 = eq_op op2 AND. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop6 : ∀op2.eq_op ASL op2 = eq_op op2 ASL. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop7 : ∀op2.eq_op ASR op2 = eq_op op2 ASR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop8 : ∀op2.eq_op BCC op2 = eq_op op2 BCC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop9 : ∀op2.eq_op BCLRn op2 = eq_op op2 BCLRn. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop10 : ∀op2.eq_op BCS op2 = eq_op op2 BCS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop11 : ∀op2.eq_op BEQ op2 = eq_op op2 BEQ. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop12 : ∀op2.eq_op BGE op2 = eq_op op2 BGE. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop13 : ∀op2.eq_op BGND op2 = eq_op op2 BGND. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop14 : ∀op2.eq_op BGT op2 = eq_op op2 BGT. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop15 : ∀op2.eq_op BHCC op2 = eq_op op2 BHCC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop16 : ∀op2.eq_op BHCS op2 = eq_op op2 BHCS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop17 : ∀op2.eq_op BHI op2 = eq_op op2 BHI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop18 : ∀op2.eq_op BIH op2 = eq_op op2 BIH. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop19 : ∀op2.eq_op BIL op2 = eq_op op2 BIL. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop20 : ∀op2.eq_op BIT op2 = eq_op op2 BIT. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop21 : ∀op2.eq_op BLE op2 = eq_op op2 BLE. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop22 : ∀op2.eq_op BLS op2 = eq_op op2 BLS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop23 : ∀op2.eq_op BLT op2 = eq_op op2 BLT. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop24 : ∀op2.eq_op BMC op2 = eq_op op2 BMC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop25 : ∀op2.eq_op BMI op2 = eq_op op2 BMI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop26 : ∀op2.eq_op BMS op2 = eq_op op2 BMS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop27 : ∀op2.eq_op BNE op2 = eq_op op2 BNE. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop28 : ∀op2.eq_op BPL op2 = eq_op op2 BPL. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop29 : ∀op2.eq_op BRA op2 = eq_op op2 BRA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop30 : ∀op2.eq_op BRCLRn op2 = eq_op op2 BRCLRn. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop31 : ∀op2.eq_op BRN op2 = eq_op op2 BRN. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop32 : ∀op2.eq_op BRSETn op2 = eq_op op2 BRSETn. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop33 : ∀op2.eq_op BSETn op2 = eq_op op2 BSETn. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop34 : ∀op2.eq_op BSR op2 = eq_op op2 BSR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop35 : ∀op2.eq_op CBEQA op2 = eq_op op2 CBEQA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop36 : ∀op2.eq_op CBEQX op2 = eq_op op2 CBEQX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop37 : ∀op2.eq_op CLC op2 = eq_op op2 CLC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop38 : ∀op2.eq_op CLI op2 = eq_op op2 CLI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop39 : ∀op2.eq_op CLR op2 = eq_op op2 CLR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop40 : ∀op2.eq_op CMP op2 = eq_op op2 CMP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop41 : ∀op2.eq_op COM op2 = eq_op op2 COM. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop42 : ∀op2.eq_op CPHX op2 = eq_op op2 CPHX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop43 : ∀op2.eq_op CPX op2 = eq_op op2 CPX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop44 : ∀op2.eq_op DAA op2 = eq_op op2 DAA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop45 : ∀op2.eq_op DBNZ op2 = eq_op op2 DBNZ. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop46 : ∀op2.eq_op DEC op2 = eq_op op2 DEC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop47 : ∀op2.eq_op DIV op2 = eq_op op2 DIV. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop48 : ∀op2.eq_op EOR op2 = eq_op op2 EOR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop49 : ∀op2.eq_op INC op2 = eq_op op2 INC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop50 : ∀op2.eq_op JMP op2 = eq_op op2 JMP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop51 : ∀op2.eq_op JSR op2 = eq_op op2 JSR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop52 : ∀op2.eq_op LDA op2 = eq_op op2 LDA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop53 : ∀op2.eq_op LDHX op2 = eq_op op2 LDHX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop54 : ∀op2.eq_op LDX op2 = eq_op op2 LDX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop55 : ∀op2.eq_op LSR op2 = eq_op op2 LSR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop56 : ∀op2.eq_op MOV op2 = eq_op op2 MOV. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop57 : ∀op2.eq_op MUL op2 = eq_op op2 MUL. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop58 : ∀op2.eq_op NEG op2 = eq_op op2 NEG. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop59 : ∀op2.eq_op NOP op2 = eq_op op2 NOP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop60 : ∀op2.eq_op NSA op2 = eq_op op2 NSA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop61 : ∀op2.eq_op ORA op2 = eq_op op2 ORA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop62 : ∀op2.eq_op PSHA op2 = eq_op op2 PSHA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop63 : ∀op2.eq_op PSHH op2 = eq_op op2 PSHH. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop64 : ∀op2.eq_op PSHX op2 = eq_op op2 PSHX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop65 : ∀op2.eq_op PULA op2 = eq_op op2 PULA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop66 : ∀op2.eq_op PULH op2 = eq_op op2 PULH. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop67 : ∀op2.eq_op PULX op2 = eq_op op2 PULX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop68 : ∀op2.eq_op ROL op2 = eq_op op2 ROL. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop69 : ∀op2.eq_op ROR op2 = eq_op op2 ROR. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop70 : ∀op2.eq_op RSP op2 = eq_op op2 RSP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop71 : ∀op2.eq_op RTI op2 = eq_op op2 RTI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop72 : ∀op2.eq_op RTS op2 = eq_op op2 RTS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop73 : ∀op2.eq_op SBC op2 = eq_op op2 SBC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop74 : ∀op2.eq_op SEC op2 = eq_op op2 SEC. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop75 : ∀op2.eq_op SEI op2 = eq_op op2 SEI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop76 : ∀op2.eq_op SHA op2 = eq_op op2 SHA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop77 : ∀op2.eq_op SLA op2 = eq_op op2 SLA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop78 : ∀op2.eq_op STA op2 = eq_op op2 STA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop79 : ∀op2.eq_op STHX op2 = eq_op op2 STHX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop80 : ∀op2.eq_op STOP op2 = eq_op op2 STOP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop81 : ∀op2.eq_op STX op2 = eq_op op2 STX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop82 : ∀op2.eq_op SUB op2 = eq_op op2 SUB. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop83 : ∀op2.eq_op SWI op2 = eq_op op2 SWI. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop84 : ∀op2.eq_op TAP op2 = eq_op op2 TAP. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop85 : ∀op2.eq_op TAX op2 = eq_op op2 TAX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop86 : ∀op2.eq_op TPA op2 = eq_op op2 TPA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop87 : ∀op2.eq_op TST op2 = eq_op op2 TST. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop88 : ∀op2.eq_op TSX op2 = eq_op op2 TSX. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop89 : ∀op2.eq_op TXA op2 = eq_op op2 TXA. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop90 : ∀op2.eq_op TXS op2 = eq_op op2 TXS. #op2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqop91 : ∀op2.eq_op WAIT op2 = eq_op op2 WAIT. #op2; nnormalize; napply refl_eq.nqed.
-
-nlemma symmetric_eqop : symmetricT opcode bool eq_op.
- #op1; ncases op1;
- ##[ ##1: napply symmetric_eqop1 ##| ##2: napply symmetric_eqop2 ##| ##3: napply symmetric_eqop3 ##| ##4: napply symmetric_eqop4
- ##| ##5: napply symmetric_eqop5 ##| ##6: napply symmetric_eqop6 ##| ##7: napply symmetric_eqop7 ##| ##8: napply symmetric_eqop8
- ##| ##9: napply symmetric_eqop9 ##| ##10: napply symmetric_eqop10 ##| ##11: napply symmetric_eqop11 ##| ##12: napply symmetric_eqop12
- ##| ##13: napply symmetric_eqop13 ##| ##14: napply symmetric_eqop14 ##| ##15: napply symmetric_eqop15 ##| ##16: napply symmetric_eqop16
- ##| ##17: napply symmetric_eqop17 ##| ##18: napply symmetric_eqop18 ##| ##19: napply symmetric_eqop19 ##| ##20: napply symmetric_eqop20
- ##| ##21: napply symmetric_eqop21 ##| ##22: napply symmetric_eqop22 ##| ##23: napply symmetric_eqop23 ##| ##24: napply symmetric_eqop24
- ##| ##25: napply symmetric_eqop25 ##| ##26: napply symmetric_eqop26 ##| ##27: napply symmetric_eqop27 ##| ##28: napply symmetric_eqop28
- ##| ##29: napply symmetric_eqop29 ##| ##30: napply symmetric_eqop30 ##| ##31: napply symmetric_eqop31 ##| ##32: napply symmetric_eqop32
- ##| ##33: napply symmetric_eqop33 ##| ##34: napply symmetric_eqop34 ##| ##35: napply symmetric_eqop35 ##| ##36: napply symmetric_eqop36
- ##| ##37: napply symmetric_eqop37 ##| ##38: napply symmetric_eqop38 ##| ##39: napply symmetric_eqop39 ##| ##40: napply symmetric_eqop40
- ##| ##41: napply symmetric_eqop41 ##| ##42: napply symmetric_eqop42 ##| ##43: napply symmetric_eqop43 ##| ##44: napply symmetric_eqop44
- ##| ##45: napply symmetric_eqop45 ##| ##46: napply symmetric_eqop46 ##| ##47: napply symmetric_eqop47 ##| ##48: napply symmetric_eqop48
- ##| ##49: napply symmetric_eqop49 ##| ##50: napply symmetric_eqop50 ##| ##51: napply symmetric_eqop51 ##| ##52: napply symmetric_eqop52
- ##| ##53: napply symmetric_eqop53 ##| ##54: napply symmetric_eqop54 ##| ##55: napply symmetric_eqop55 ##| ##56: napply symmetric_eqop56
- ##| ##57: napply symmetric_eqop57 ##| ##58: napply symmetric_eqop58 ##| ##59: napply symmetric_eqop59 ##| ##60: napply symmetric_eqop60
- ##| ##61: napply symmetric_eqop61 ##| ##62: napply symmetric_eqop62 ##| ##63: napply symmetric_eqop63 ##| ##64: napply symmetric_eqop64
- ##| ##65: napply symmetric_eqop65 ##| ##66: napply symmetric_eqop66 ##| ##67: napply symmetric_eqop67 ##| ##68: napply symmetric_eqop68
- ##| ##69: napply symmetric_eqop69 ##| ##70: napply symmetric_eqop70 ##| ##71: napply symmetric_eqop71 ##| ##72: napply symmetric_eqop72
- ##| ##73: napply symmetric_eqop73 ##| ##74: napply symmetric_eqop74 ##| ##75: napply symmetric_eqop75 ##| ##76: napply symmetric_eqop76
- ##| ##77: napply symmetric_eqop77 ##| ##78: napply symmetric_eqop78 ##| ##79: napply symmetric_eqop79 ##| ##80: napply symmetric_eqop80
- ##| ##81: napply symmetric_eqop81 ##| ##82: napply symmetric_eqop82 ##| ##83: napply symmetric_eqop83 ##| ##84: napply symmetric_eqop84
- ##| ##85: napply symmetric_eqop85 ##| ##86: napply symmetric_eqop86 ##| ##87: napply symmetric_eqop87 ##| ##88: napply symmetric_eqop88
- ##| ##89: napply symmetric_eqop89 ##| ##90: napply symmetric_eqop90 ##| ##91: napply symmetric_eqop91 ##]
-nqed.
-
-nlemma eqop_to_eq1 : ∀op2.eq_op ADC op2 = true → ADC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##1: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq2 : ∀op2.eq_op ADD op2 = true → ADD = op2. #op2; ncases op2; nnormalize; #H; ##[ ##2: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq3 : ∀op2.eq_op AIS op2 = true → AIS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##3: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq4 : ∀op2.eq_op AIX op2 = true → AIX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##4: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq5 : ∀op2.eq_op AND op2 = true → AND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##5: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq6 : ∀op2.eq_op ASL op2 = true → ASL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##6: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq7 : ∀op2.eq_op ASR op2 = true → ASR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##7: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq8 : ∀op2.eq_op BCC op2 = true → BCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##8: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq9 : ∀op2.eq_op BCLRn op2 = true → BCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##9: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq10 : ∀op2.eq_op BCS op2 = true → BCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##10: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq11 : ∀op2.eq_op BEQ op2 = true → BEQ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##11: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq12 : ∀op2.eq_op BGE op2 = true → BGE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##12: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq13 : ∀op2.eq_op BGND op2 = true → BGND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##13: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq14 : ∀op2.eq_op BGT op2 = true → BGT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##14: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq15 : ∀op2.eq_op BHCC op2 = true → BHCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##15: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq16 : ∀op2.eq_op BHCS op2 = true → BHCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##16: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq17 : ∀op2.eq_op BHI op2 = true → BHI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##17: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq18 : ∀op2.eq_op BIH op2 = true → BIH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##18: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq19 : ∀op2.eq_op BIL op2 = true → BIL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##19: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq20 : ∀op2.eq_op BIT op2 = true → BIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##20: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq21 : ∀op2.eq_op BLE op2 = true → BLE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##21: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq22 : ∀op2.eq_op BLS op2 = true → BLS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##22: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq23 : ∀op2.eq_op BLT op2 = true → BLT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##23: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq24 : ∀op2.eq_op BMC op2 = true → BMC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##24: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq25 : ∀op2.eq_op BMI op2 = true → BMI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##25: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq26 : ∀op2.eq_op BMS op2 = true → BMS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##26: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq27 : ∀op2.eq_op BNE op2 = true → BNE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##27: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq28 : ∀op2.eq_op BPL op2 = true → BPL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##28: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq29 : ∀op2.eq_op BRA op2 = true → BRA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##29: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq30 : ∀op2.eq_op BRCLRn op2 = true → BRCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##30: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq31 : ∀op2.eq_op BRN op2 = true → BRN = op2. #op2; ncases op2; nnormalize; #H; ##[ ##31: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq32 : ∀op2.eq_op BRSETn op2 = true → BRSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##32: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq33 : ∀op2.eq_op BSETn op2 = true → BSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##33: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq34 : ∀op2.eq_op BSR op2 = true → BSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##34: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq35 : ∀op2.eq_op CBEQA op2 = true → CBEQA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##35: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq36 : ∀op2.eq_op CBEQX op2 = true → CBEQX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##36: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq37 : ∀op2.eq_op CLC op2 = true → CLC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##37: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq38 : ∀op2.eq_op CLI op2 = true → CLI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##38: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq39 : ∀op2.eq_op CLR op2 = true → CLR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##39: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq40 : ∀op2.eq_op CMP op2 = true → CMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##40: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq41 : ∀op2.eq_op COM op2 = true → COM = op2. #op2; ncases op2; nnormalize; #H; ##[ ##41: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq42 : ∀op2.eq_op CPHX op2 = true → CPHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##42: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq43 : ∀op2.eq_op CPX op2 = true → CPX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##43: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq44 : ∀op2.eq_op DAA op2 = true → DAA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##44: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq45 : ∀op2.eq_op DBNZ op2 = true → DBNZ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##45: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq46 : ∀op2.eq_op DEC op2 = true → DEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##46: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq47 : ∀op2.eq_op DIV op2 = true → DIV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##47: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq48 : ∀op2.eq_op EOR op2 = true → EOR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##48: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq49 : ∀op2.eq_op INC op2 = true → INC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##49: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq50 : ∀op2.eq_op JMP op2 = true → JMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##50: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq51 : ∀op2.eq_op JSR op2 = true → JSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##51: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq52 : ∀op2.eq_op LDA op2 = true → LDA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##52: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq53 : ∀op2.eq_op LDHX op2 = true → LDHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##53: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq54 : ∀op2.eq_op LDX op2 = true → LDX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##54: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq55 : ∀op2.eq_op LSR op2 = true → LSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##55: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq56 : ∀op2.eq_op MOV op2 = true → MOV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##56: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq57 : ∀op2.eq_op MUL op2 = true → MUL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##57: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq58 : ∀op2.eq_op NEG op2 = true → NEG = op2. #op2; ncases op2; nnormalize; #H; ##[ ##58: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq59 : ∀op2.eq_op NOP op2 = true → NOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##59: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq60 : ∀op2.eq_op NSA op2 = true → NSA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##60: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq61 : ∀op2.eq_op ORA op2 = true → ORA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##61: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq62 : ∀op2.eq_op PSHA op2 = true → PSHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##62: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq63 : ∀op2.eq_op PSHH op2 = true → PSHH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##63: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq64 : ∀op2.eq_op PSHX op2 = true → PSHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##64: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq65 : ∀op2.eq_op PULA op2 = true → PULA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##65: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq66 : ∀op2.eq_op PULH op2 = true → PULH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##66: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq67 : ∀op2.eq_op PULX op2 = true → PULX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##67: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq68 : ∀op2.eq_op ROL op2 = true → ROL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##68: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq69 : ∀op2.eq_op ROR op2 = true → ROR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##69: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq70 : ∀op2.eq_op RSP op2 = true → RSP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##70: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq71 : ∀op2.eq_op RTI op2 = true → RTI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##71: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq72 : ∀op2.eq_op RTS op2 = true → RTS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##72: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq73 : ∀op2.eq_op SBC op2 = true → SBC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##73: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq74 : ∀op2.eq_op SEC op2 = true → SEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##74: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq75 : ∀op2.eq_op SEI op2 = true → SEI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##75: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq76 : ∀op2.eq_op SHA op2 = true → SHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##76: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq77 : ∀op2.eq_op SLA op2 = true → SLA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##77: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq78 : ∀op2.eq_op STA op2 = true → STA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##78: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq79 : ∀op2.eq_op STHX op2 = true → STHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##79: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq80 : ∀op2.eq_op STOP op2 = true → STOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##80: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq81 : ∀op2.eq_op STX op2 = true → STX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##81: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq82 : ∀op2.eq_op SUB op2 = true → SUB = op2. #op2; ncases op2; nnormalize; #H; ##[ ##82: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq83 : ∀op2.eq_op SWI op2 = true → SWI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##83: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq84 : ∀op2.eq_op TAP op2 = true → TAP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##84: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq85 : ∀op2.eq_op TAX op2 = true → TAX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##85: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq86 : ∀op2.eq_op TPA op2 = true → TPA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##86: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq87 : ∀op2.eq_op TST op2 = true → TST = op2. #op2; ncases op2; nnormalize; #H; ##[ ##87: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq88 : ∀op2.eq_op TSX op2 = true → TSX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##88: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq89 : ∀op2.eq_op TXA op2 = true → TXA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##89: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq90 : ∀op2.eq_op TXS op2 = true → TXS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##90: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq91 : ∀op2.eq_op WAIT op2 = true → WAIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##91: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-
-nlemma eqop_to_eq : ∀op1,op2.eq_op op1 op2 = true → op1 = op2.
- #op1; ncases op1;
- ##[ ##1: napply eqop_to_eq1 ##| ##2: napply eqop_to_eq2 ##| ##3: napply eqop_to_eq3 ##| ##4: napply eqop_to_eq4
- ##| ##5: napply eqop_to_eq5 ##| ##6: napply eqop_to_eq6 ##| ##7: napply eqop_to_eq7 ##| ##8: napply eqop_to_eq8
- ##| ##9: napply eqop_to_eq9 ##| ##10: napply eqop_to_eq10 ##| ##11: napply eqop_to_eq11 ##| ##12: napply eqop_to_eq12
- ##| ##13: napply eqop_to_eq13 ##| ##14: napply eqop_to_eq14 ##| ##15: napply eqop_to_eq15 ##| ##16: napply eqop_to_eq16
- ##| ##17: napply eqop_to_eq17 ##| ##18: napply eqop_to_eq18 ##| ##19: napply eqop_to_eq19 ##| ##20: napply eqop_to_eq20
- ##| ##21: napply eqop_to_eq21 ##| ##22: napply eqop_to_eq22 ##| ##23: napply eqop_to_eq23 ##| ##24: napply eqop_to_eq24
- ##| ##25: napply eqop_to_eq25 ##| ##26: napply eqop_to_eq26 ##| ##27: napply eqop_to_eq27 ##| ##28: napply eqop_to_eq28
- ##| ##29: napply eqop_to_eq29 ##| ##30: napply eqop_to_eq30 ##| ##31: napply eqop_to_eq31 ##| ##32: napply eqop_to_eq32
- ##| ##33: napply eqop_to_eq33 ##| ##34: napply eqop_to_eq34 ##| ##35: napply eqop_to_eq35 ##| ##36: napply eqop_to_eq36
- ##| ##37: napply eqop_to_eq37 ##| ##38: napply eqop_to_eq38 ##| ##39: napply eqop_to_eq39 ##| ##40: napply eqop_to_eq40
- ##| ##41: napply eqop_to_eq41 ##| ##42: napply eqop_to_eq42 ##| ##43: napply eqop_to_eq43 ##| ##44: napply eqop_to_eq44
- ##| ##45: napply eqop_to_eq45 ##| ##46: napply eqop_to_eq46 ##| ##47: napply eqop_to_eq47 ##| ##48: napply eqop_to_eq48
- ##| ##49: napply eqop_to_eq49 ##| ##50: napply eqop_to_eq50 ##| ##51: napply eqop_to_eq51 ##| ##52: napply eqop_to_eq52
- ##| ##53: napply eqop_to_eq53 ##| ##54: napply eqop_to_eq54 ##| ##55: napply eqop_to_eq55 ##| ##56: napply eqop_to_eq56
- ##| ##57: napply eqop_to_eq57 ##| ##58: napply eqop_to_eq58 ##| ##59: napply eqop_to_eq59 ##| ##60: napply eqop_to_eq60
- ##| ##61: napply eqop_to_eq61 ##| ##62: napply eqop_to_eq62 ##| ##63: napply eqop_to_eq63 ##| ##64: napply eqop_to_eq64
- ##| ##65: napply eqop_to_eq65 ##| ##66: napply eqop_to_eq66 ##| ##67: napply eqop_to_eq67 ##| ##68: napply eqop_to_eq68
- ##| ##69: napply eqop_to_eq69 ##| ##70: napply eqop_to_eq70 ##| ##71: napply eqop_to_eq71 ##| ##72: napply eqop_to_eq72
- ##| ##73: napply eqop_to_eq73 ##| ##74: napply eqop_to_eq74 ##| ##75: napply eqop_to_eq75 ##| ##76: napply eqop_to_eq76
- ##| ##77: napply eqop_to_eq77 ##| ##78: napply eqop_to_eq78 ##| ##79: napply eqop_to_eq79 ##| ##80: napply eqop_to_eq80
- ##| ##81: napply eqop_to_eq81 ##| ##82: napply eqop_to_eq82 ##| ##83: napply eqop_to_eq83 ##| ##84: napply eqop_to_eq84
- ##| ##85: napply eqop_to_eq85 ##| ##86: napply eqop_to_eq86 ##| ##87: napply eqop_to_eq87 ##| ##88: napply eqop_to_eq88
- ##| ##89: napply eqop_to_eq89 ##| ##90: napply eqop_to_eq90 ##| ##91: napply eqop_to_eq91 ##]
-nqed.
-
-nlemma eq_to_eqop1 : ∀op2.ADC = op2 → eq_op ADC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##1: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop2 : ∀op2.ADD = op2 → eq_op ADD op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##2: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop3 : ∀op2.AIS = op2 → eq_op AIS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##3: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop4 : ∀op2.AIX = op2 → eq_op AIX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##4: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop5 : ∀op2.AND = op2 → eq_op AND op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##5: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop6 : ∀op2.ASL = op2 → eq_op ASL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##6: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop7 : ∀op2.ASR = op2 → eq_op ASR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##7: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop8 : ∀op2.BCC = op2 → eq_op BCC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##8: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop9 : ∀op2.BCLRn = op2 → eq_op BCLRn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##9: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop10 : ∀op2.BCS = op2 → eq_op BCS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##10: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop11 : ∀op2.BEQ = op2 → eq_op BEQ op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##11: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop12 : ∀op2.BGE = op2 → eq_op BGE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##12: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop13 : ∀op2.BGND = op2 → eq_op BGND op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##13: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop14 : ∀op2.BGT = op2 → eq_op BGT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##14: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop15 : ∀op2.BHCC = op2 → eq_op BHCC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##15: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop16 : ∀op2.BHCS = op2 → eq_op BHCS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##16: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop17 : ∀op2.BHI = op2 → eq_op BHI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##17: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop18 : ∀op2.BIH = op2 → eq_op BIH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##18: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop19 : ∀op2.BIL = op2 → eq_op BIL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##19: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop20 : ∀op2.BIT = op2 → eq_op BIT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##20: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop21 : ∀op2.BLE = op2 → eq_op BLE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##21: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop22 : ∀op2.BLS = op2 → eq_op BLS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##22: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop23 : ∀op2.BLT = op2 → eq_op BLT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##23: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop24 : ∀op2.BMC = op2 → eq_op BMC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##24: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop25 : ∀op2.BMI = op2 → eq_op BMI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##25: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop26 : ∀op2.BMS = op2 → eq_op BMS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##26: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop27 : ∀op2.BNE = op2 → eq_op BNE op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##27: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop28 : ∀op2.BPL = op2 → eq_op BPL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##28: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop29 : ∀op2.BRA = op2 → eq_op BRA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##29: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop30 : ∀op2.BRCLRn = op2 → eq_op BRCLRn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##30: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop31 : ∀op2.BRN = op2 → eq_op BRN op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##31: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop32 : ∀op2.BRSETn = op2 → eq_op BRSETn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##32: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop33 : ∀op2.BSETn = op2 → eq_op BSETn op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##33: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop34 : ∀op2.BSR = op2 → eq_op BSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##34: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop35 : ∀op2.CBEQA = op2 → eq_op CBEQA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##35: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop36 : ∀op2.CBEQX = op2 → eq_op CBEQX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##36: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop37 : ∀op2.CLC = op2 → eq_op CLC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##37: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop38 : ∀op2.CLI = op2 → eq_op CLI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##38: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop39 : ∀op2.CLR = op2 → eq_op CLR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##39: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop40 : ∀op2.CMP = op2 → eq_op CMP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##40: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop41 : ∀op2.COM = op2 → eq_op COM op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##41: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop42 : ∀op2.CPHX = op2 → eq_op CPHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##42: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop43 : ∀op2.CPX = op2 → eq_op CPX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##43: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop44 : ∀op2.DAA = op2 → eq_op DAA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##44: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop45 : ∀op2.DBNZ = op2 → eq_op DBNZ op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##45: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop46 : ∀op2.DEC = op2 → eq_op DEC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##46: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop47 : ∀op2.DIV = op2 → eq_op DIV op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##47: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop48 : ∀op2.EOR = op2 → eq_op EOR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##48: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop49 : ∀op2.INC = op2 → eq_op INC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##49: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop50 : ∀op2.JMP = op2 → eq_op JMP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##50: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop51 : ∀op2.JSR = op2 → eq_op JSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##51: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop52 : ∀op2.LDA = op2 → eq_op LDA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##52: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop53 : ∀op2.LDHX = op2 → eq_op LDHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##53: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop54 : ∀op2.LDX = op2 → eq_op LDX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##54: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop55 : ∀op2.LSR = op2 → eq_op LSR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##55: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop56 : ∀op2.MOV = op2 → eq_op MOV op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##56: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop57 : ∀op2.MUL = op2 → eq_op MUL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##57: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop58 : ∀op2.NEG = op2 → eq_op NEG op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##58: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop59 : ∀op2.NOP = op2 → eq_op NOP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##59: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop60 : ∀op2.NSA = op2 → eq_op NSA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##60: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop61 : ∀op2.ORA = op2 → eq_op ORA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##61: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop62 : ∀op2.PSHA = op2 → eq_op PSHA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##62: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop63 : ∀op2.PSHH = op2 → eq_op PSHH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##63: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop64 : ∀op2.PSHX = op2 → eq_op PSHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##64: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop65 : ∀op2.PULA = op2 → eq_op PULA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##65: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop66 : ∀op2.PULH = op2 → eq_op PULH op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##66: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop67 : ∀op2.PULX = op2 → eq_op PULX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##67: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop68 : ∀op2.ROL = op2 → eq_op ROL op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##68: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop69 : ∀op2.ROR = op2 → eq_op ROR op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##69: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop70 : ∀op2.RSP = op2 → eq_op RSP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##70: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop71 : ∀op2.RTI = op2 → eq_op RTI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##71: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop72 : ∀op2.RTS = op2 → eq_op RTS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##72: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop73 : ∀op2.SBC = op2 → eq_op SBC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##73: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop74 : ∀op2.SEC = op2 → eq_op SEC op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##74: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop75 : ∀op2.SEI = op2 → eq_op SEI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##75: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop76 : ∀op2.SHA = op2 → eq_op SHA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##76: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop77 : ∀op2.SLA = op2 → eq_op SLA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##77: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop78 : ∀op2.STA = op2 → eq_op STA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##78: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop79 : ∀op2.STHX = op2 → eq_op STHX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##79: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop80 : ∀op2.STOP = op2 → eq_op STOP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##80: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop81 : ∀op2.STX = op2 → eq_op STX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##81: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop82 : ∀op2.SUB = op2 → eq_op SUB op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##82: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop83 : ∀op2.SWI = op2 → eq_op SWI op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##83: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop84 : ∀op2.TAP = op2 → eq_op TAP op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##84: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop85 : ∀op2.TAX = op2 → eq_op TAX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##85: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop86 : ∀op2.TPA = op2 → eq_op TPA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##86: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop87 : ∀op2.TST = op2 → eq_op TST op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##87: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop88 : ∀op2.TSX = op2 → eq_op TSX op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##88: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop89 : ∀op2.TXA = op2 → eq_op TXA op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##89: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop90 : ∀op2.TXS = op2 → eq_op TXS op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##90: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-nlemma eq_to_eqop91 : ∀op2.WAIT = op2 → eq_op WAIT op2 = true. #op2; ncases op2; nnormalize; #H; ##[ ##91: napply refl_eq ##| ##*: napply (opcode_destruct … (false = true) H) ##]nqed.
-
-nlemma eq_to_eqop : ∀op1,op2.op1 = op2 → eq_op op1 op2 = true.
- #op1; ncases op1;
- ##[ ##1: napply eq_to_eqop1 ##| ##2: napply eq_to_eqop2 ##| ##3: napply eq_to_eqop3 ##| ##4: napply eq_to_eqop4
- ##| ##5: napply eq_to_eqop5 ##| ##6: napply eq_to_eqop6 ##| ##7: napply eq_to_eqop7 ##| ##8: napply eq_to_eqop8
- ##| ##9: napply eq_to_eqop9 ##| ##10: napply eq_to_eqop10 ##| ##11: napply eq_to_eqop11 ##| ##12: napply eq_to_eqop12
- ##| ##13: napply eq_to_eqop13 ##| ##14: napply eq_to_eqop14 ##| ##15: napply eq_to_eqop15 ##| ##16: napply eq_to_eqop16
- ##| ##17: napply eq_to_eqop17 ##| ##18: napply eq_to_eqop18 ##| ##19: napply eq_to_eqop19 ##| ##20: napply eq_to_eqop20
- ##| ##21: napply eq_to_eqop21 ##| ##22: napply eq_to_eqop22 ##| ##23: napply eq_to_eqop23 ##| ##24: napply eq_to_eqop24
- ##| ##25: napply eq_to_eqop25 ##| ##26: napply eq_to_eqop26 ##| ##27: napply eq_to_eqop27 ##| ##28: napply eq_to_eqop28
- ##| ##29: napply eq_to_eqop29 ##| ##30: napply eq_to_eqop30 ##| ##31: napply eq_to_eqop31 ##| ##32: napply eq_to_eqop32
- ##| ##33: napply eq_to_eqop33 ##| ##34: napply eq_to_eqop34 ##| ##35: napply eq_to_eqop35 ##| ##36: napply eq_to_eqop36
- ##| ##37: napply eq_to_eqop37 ##| ##38: napply eq_to_eqop38 ##| ##39: napply eq_to_eqop39 ##| ##40: napply eq_to_eqop40
- ##| ##41: napply eq_to_eqop41 ##| ##42: napply eq_to_eqop42 ##| ##43: napply eq_to_eqop43 ##| ##44: napply eq_to_eqop44
- ##| ##45: napply eq_to_eqop45 ##| ##46: napply eq_to_eqop46 ##| ##47: napply eq_to_eqop47 ##| ##48: napply eq_to_eqop48
- ##| ##49: napply eq_to_eqop49 ##| ##50: napply eq_to_eqop50 ##| ##51: napply eq_to_eqop51 ##| ##52: napply eq_to_eqop52
- ##| ##53: napply eq_to_eqop53 ##| ##54: napply eq_to_eqop54 ##| ##55: napply eq_to_eqop55 ##| ##56: napply eq_to_eqop56
- ##| ##57: napply eq_to_eqop57 ##| ##58: napply eq_to_eqop58 ##| ##59: napply eq_to_eqop59 ##| ##60: napply eq_to_eqop60
- ##| ##61: napply eq_to_eqop61 ##| ##62: napply eq_to_eqop62 ##| ##63: napply eq_to_eqop63 ##| ##64: napply eq_to_eqop64
- ##| ##65: napply eq_to_eqop65 ##| ##66: napply eq_to_eqop66 ##| ##67: napply eq_to_eqop67 ##| ##68: napply eq_to_eqop68
- ##| ##69: napply eq_to_eqop69 ##| ##70: napply eq_to_eqop70 ##| ##71: napply eq_to_eqop71 ##| ##72: napply eq_to_eqop72
- ##| ##73: napply eq_to_eqop73 ##| ##74: napply eq_to_eqop74 ##| ##75: napply eq_to_eqop75 ##| ##76: napply eq_to_eqop76
- ##| ##77: napply eq_to_eqop77 ##| ##78: napply eq_to_eqop78 ##| ##79: napply eq_to_eqop79 ##| ##80: napply eq_to_eqop80
- ##| ##81: napply eq_to_eqop81 ##| ##82: napply eq_to_eqop82 ##| ##83: napply eq_to_eqop83 ##| ##84: napply eq_to_eqop84
- ##| ##85: napply eq_to_eqop85 ##| ##86: napply eq_to_eqop86 ##| ##87: napply eq_to_eqop87 ##| ##88: napply eq_to_eqop88
- ##| ##89: napply eq_to_eqop89 ##| ##90: napply eq_to_eqop90 ##| ##91: napply eq_to_eqop91 ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ****** *)
-(* OPTION *)
-(* ****** *)
-
-ninductive option (A:Type) : Type ≝
- None : option A
-| Some : A → option A.
-
-ndefinition eq_option ≝
-λT.λop1,op2:option T.λf:T → T → bool.
- match op1 with
- [ None ⇒ match op2 with [ None ⇒ true | Some _ ⇒ false ]
- | Some x1 ⇒ match op2 with [ None ⇒ false | Some x2 ⇒ f x1 x2 ]
- ].
-
-(* option map = match ... with [ None ⇒ None ? | Some .. ⇒ .. ] *)
-ndefinition opt_map ≝
-λT1,T2:Type.λt:option T1.λf:T1 → option T2.
- match t with [ None ⇒ None ? | Some x ⇒ (f x) ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/option.ma".
-
-(* ****** *)
-(* OPTION *)
-(* ****** *)
-
-nlemma option_destruct_some_some : ∀T.∀x1,x2:T.Some T x1 = Some T x2 → x1 = x2.
- #T; #x1; #x2; #H;
- nchange with (match Some T x2 with [ None ⇒ False | Some a ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma option_destruct_some_none : ∀T.∀x:T.Some T x = None T → False.
- #T; #x; #H;
- nchange with (match Some T x with [ None ⇒ True | Some a ⇒ False ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma option_destruct_none_some : ∀T.∀x:T.None T = Some T x → False.
- #T; #x; #H;
- nchange with (match Some T x with [ None ⇒ True | Some a ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma symmetric_eqoption :
-∀T:Type.∀op1,op2:option T.∀f:T → T → bool.
- (symmetricT T bool f) →
- (eq_option T op1 op2 f = eq_option T op2 op1 f).
- #T; #op1; #op2; #f; #H;
- nelim op1;
- nelim op2;
- nnormalize;
- ##[ ##1: napply refl_eq
- ##| ##2,3: #H; napply refl_eq
- ##| ##4: #a; #a0;
- nrewrite > (H a0 a);
- napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqoption :
-∀T.∀op1,op2:option T.∀f:T → T → bool.
- (∀x1,x2:T.x1 = x2 → f x1 x2 = true) →
- (op1 = op2 → eq_option T op1 op2 f = true).
- #T; #op1; #op2; #f; #H;
- nelim op1;
- nelim op2;
- nnormalize;
- ##[ ##1: #H1; napply refl_eq
- ##| ##2: #a; #H1; nelim (option_destruct_none_some ?? H1)
- ##| ##3: #a; #H1; nelim (option_destruct_some_none ?? H1)
- ##| ##4: #a; #a0; #H1;
- nrewrite > (option_destruct_some_some … H1);
- nrewrite > (H a a (refl_eq …));
- napply refl_eq
- ##]
-nqed.
-
-nlemma eqoption_to_eq :
-∀T.∀op1,op2:option T.∀f:T → T → bool.
- (∀x1,x2:T.f x1 x2 = true → x1 = x2) →
- (eq_option T op1 op2 f = true → op1 = op2).
- #T; #op1; #op2; #f; #H;
- nelim op1;
- nelim op2;
- nnormalize;
- ##[ ##1: #H1; napply refl_eq
- ##| ##2,3: #a; #H1; napply (bool_destruct … H1)
- ##| ##4: #a; #a0; #H1;
- nrewrite > (H … H1);
- napply refl_eq
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ***** *)
-(* TUPLE *)
-(* ***** *)
-
-ninductive ProdT (T1:Type) (T2:Type) : Type ≝
- pair : T1 → T2 → ProdT T1 T2.
-
-ndefinition fst ≝
-λT1,T2:Type.λp:ProdT T1 T2.match p with [ pair x _ ⇒ x ].
-
-ndefinition snd ≝
-λT1,T2:Type.λp:ProdT T1 T2.match p with [ pair _ x ⇒ x ].
-
-ndefinition eq_pair ≝
-λT1,T2:Type.λp1,p2:ProdT T1 T2.
-λf1:T1 → T1 → bool.λf2:T2 → T2 → bool.
- match p1 with [ pair x1 y1 ⇒
- match p2 with [ pair x2 y2 ⇒
- (f1 x1 x2) ⊗ (f2 y1 y2) ]].
-
-ninductive Prod3T (T1:Type) (T2:Type) (T3:Type) : Type ≝
-triple : T1 → T2 → T3 → Prod3T T1 T2 T3.
-
-ndefinition fst3T ≝
-λT1.λT2.λT3.λp:Prod3T T1 T2 T3.match p with [ triple x _ _ ⇒ x ].
-
-ndefinition snd3T ≝
-λT1.λT2.λT3.λp:Prod3T T1 T2 T3.match p with [ triple _ x _ ⇒ x ].
-
-ndefinition thd3T ≝
-λT1.λT2.λT3.λp:Prod3T T1 T2 T3.match p with [ triple _ _ x ⇒ x ].
-
-ndefinition eq_triple ≝
-λT1,T2,T3:Type.λp1,p2:Prod3T T1 T2 T3.
-λf1:T1 → T1 → bool.λf2:T2 → T2 → bool.λf3:T3 → T3 → bool.
- match p1 with [ triple x1 y1 z1 ⇒
- match p2 with [ triple x2 y2 z2 ⇒
- (f1 x1 x2) ⊗ (f2 y1 y2) ⊗ (f3 z1 z2) ]].
-
-ninductive Prod4T (T1:Type) (T2:Type) (T3:Type) (T4:Type) : Type ≝
-quadruple : T1 → T2 → T3 → T4 → Prod4T T1 T2 T3 T4.
-
-ndefinition fst4T ≝
-λT1.λT2.λT3.λT4.λp:Prod4T T1 T2 T3 T4.match p with [ quadruple x _ _ _ ⇒ x ].
-
-ndefinition snd4T ≝
-λT1.λT2.λT3.λT4.λp:Prod4T T1 T2 T3 T4.match p with [ quadruple _ x _ _ ⇒ x ].
-
-ndefinition thd4T ≝
-λT1.λT2.λT3.λT4.λp:Prod4T T1 T2 T3 T4.match p with [ quadruple _ _ x _ ⇒ x ].
-
-ndefinition fth4T ≝
-λT1.λT2.λT3.λT4.λp:Prod4T T1 T2 T3 T4.match p with [ quadruple _ _ _ x ⇒ x ].
-
-ndefinition eq_quadruple ≝
-λT1,T2,T3,T4:Type.λp1,p2:Prod4T T1 T2 T3 T4.
-λf1:T1 → T1 → bool.λf2:T2 → T2 → bool.λf3:T3 → T3 → bool.λf4:T4 → T4 → bool.
- match p1 with [ quadruple x1 y1 z1 w1 ⇒
- match p2 with [ quadruple x2 y2 z2 w2 ⇒
- (f1 x1 x2) ⊗ (f2 y1 y2) ⊗ (f3 z1 z2) ⊗ (f4 w1 w2) ]].
-
-ninductive Prod5T (T1:Type) (T2:Type) (T3:Type) (T4:Type) (T5:Type) : Type ≝
-quintuple : T1 → T2 → T3 → T4 → T5 → Prod5T T1 T2 T3 T4 T5.
-
-ndefinition fst5T ≝
-λT1.λT2.λT3.λT4.λT5.λp:Prod5T T1 T2 T3 T4 T5.match p with [ quintuple x _ _ _ _ ⇒ x ].
-
-ndefinition snd5T ≝
-λT1.λT2.λT3.λT4.λT5.λp:Prod5T T1 T2 T3 T4 T5.match p with [ quintuple _ x _ _ _ ⇒ x ].
-
-ndefinition thd5T ≝
-λT1.λT2.λT3.λT4.λT5.λp:Prod5T T1 T2 T3 T4 T5.match p with [ quintuple _ _ x _ _ ⇒ x ].
-
-ndefinition frth5T ≝
-λT1.λT2.λT3.λT4.λT5.λp:Prod5T T1 T2 T3 T4 T5.match p with [ quintuple _ _ _ x _ ⇒ x ].
-
-ndefinition ffth5T ≝
-λT1.λT2.λT3.λT4.λT5.λp:Prod5T T1 T2 T3 T4 T5.match p with [ quintuple _ _ _ _ x ⇒ x ].
-
-ndefinition eq_quintuple ≝
-λT1,T2,T3,T4,T5:Type.λp1,p2:Prod5T T1 T2 T3 T4 T5.
-λf1:T1 → T1 → bool.λf2:T2 → T2 → bool.λf3:T3 → T3 → bool.λf4:T4 → T4 → bool.λf5:T5 → T5 → bool.
- match p1 with [ quintuple x1 y1 z1 w1 v1 ⇒
- match p2 with [ quintuple x2 y2 z2 w2 v2 ⇒
- (f1 x1 x2) ⊗ (f2 y1 y2) ⊗ (f3 z1 z2) ⊗ (f4 w1 w2) ⊗ (f5 v1 v2) ]].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/prod.ma".
-
-(* ***** *)
-(* TUPLE *)
-(* ***** *)
-
-nlemma pair_destruct_1 :
-∀T1,T2.∀x1,x2:T1.∀y1,y2:T2.
- pair T1 T2 x1 y1 = pair T1 T2 x2 y2 → x1 = x2.
- #T1; #T2; #x1; #x2; #y1; #y2; #H;
- nchange with (match pair T1 T2 x2 y2 with [ pair a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma pair_destruct_2 :
-∀T1,T2.∀x1,x2:T1.∀y1,y2:T2.
- pair T1 T2 x1 y1 = pair T1 T2 x2 y2 → y1 = y2.
- #T1; #T2; #x1; #x2; #y1; #y2; #H;
- nchange with (match pair T1 T2 x2 y2 with [ pair _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqpair :
-∀T1,T2:Type.∀p1,p2:ProdT T1 T2.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.
- (symmetricT T1 bool f1) →
- (symmetricT T2 bool f2) →
- (eq_pair T1 T2 p1 p2 f1 f2 = eq_pair T1 T2 p2 p1 f1 f2).
- #T1; #T2; #p1; #p2; #f1; #f2; #H; #H1;
- nelim p1;
- #x1; #y1;
- nelim p2;
- #x2; #y2;
- nnormalize;
- nrewrite > (H x1 x2);
- ncases (f1 x2 x1);
- nnormalize;
- ##[ ##1: nrewrite > (H1 y1 y2); napply refl_eq
- ##| ##2: napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqpair :
-∀T1,T2.∀p1,p2:ProdT T1 T2.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.
- (∀x1,x2:T1.x1 = x2 → f1 x1 x2 = true) →
- (∀y1,y2:T2.y1 = y2 → f2 y1 y2 = true) →
- (p1 = p2 → eq_pair T1 T2 p1 p2 f1 f2 = true).
- #T1; #T2; #p1; #p2; #f1; #f2; #H1; #H2;
- nelim p1;
- #x1; #y1;
- nelim p2;
- #x2; #y2; #H;
- nnormalize;
- nrewrite > (H1 … (pair_destruct_1 … H));
- nnormalize;
- nrewrite > (H2 … (pair_destruct_2 … H));
- napply refl_eq.
-nqed.
-
-nlemma eqpair_to_eq :
-∀T1,T2.∀p1,p2:ProdT T1 T2.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.
- (∀x1,x2:T1.f1 x1 x2 = true → x1 = x2) →
- (∀y1,y2:T2.f2 y1 y2 = true → y1 = y2) →
- (eq_pair T1 T2 p1 p2 f1 f2 = true → p1 = p2).
- #T1; #T2; #p1; #p2; #f1; #f2; #H1; #H2;
- nelim p1;
- #x1; #y1;
- nelim p2;
- #x2; #y2; #H;
- nnormalize in H:(%);
- nletin K ≝ (H1 x1 x2);
- ncases (f1 x1 x2) in H:(%) K:(%);
- nnormalize;
- #H3;
- ##[ ##2: napply (bool_destruct … H3) ##]
- #H4;
- nrewrite > (H4 (refl_eq …));
- nrewrite > (H2 y1 y2 H3);
- napply refl_eq.
-nqed.
-
-nlemma triple_destruct_1 :
-∀T1,T2,T3.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.
- triple T1 T2 T3 x1 y1 z1 = triple T1 T2 T3 x2 y2 z2 → x1 = x2.
- #T1; #T2; #T3; #x1; #x2; #y1; #y2; #z1; #z2; #H;
- nchange with (match triple T1 T2 T3 x2 y2 z2 with [ triple a _ _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma triple_destruct_2 :
-∀T1,T2,T3.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.
- triple T1 T2 T3 x1 y1 z1 = triple T1 T2 T3 x2 y2 z2 → y1 = y2.
- #T1; #T2; #T3; #x1; #x2; #y1; #y2; #z1; #z2; #H;
- nchange with (match triple T1 T2 T3 x2 y2 z2 with [ triple _ b _ ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma triple_destruct_3 :
-∀T1,T2,T3.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.
- triple T1 T2 T3 x1 y1 z1 = triple T1 T2 T3 x2 y2 z2 → z1 = z2.
- #T1; #T2; #T3; #x1; #x2; #y1; #y2; #z1; #z2; #H;
- nchange with (match triple T1 T2 T3 x2 y2 z2 with [ triple _ _ c ⇒ z1 = c ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqtriple :
-∀T1,T2,T3:Type.∀p1,p2:Prod3T T1 T2 T3.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.
- (symmetricT T1 bool f1) →
- (symmetricT T2 bool f2) →
- (symmetricT T3 bool f3) →
- (eq_triple T1 T2 T3 p1 p2 f1 f2 f3 = eq_triple T1 T2 T3 p2 p1 f1 f2 f3).
- #T1; #T2; #T3; #p1; #p2; #f1; #f2; #f3; #H; #H1; #H2;
- nelim p1;
- #x1; #y1; #z1;
- nelim p2;
- #x2; #y2; #z2;
- nnormalize;
- nrewrite > (H x1 x2);
- ncases (f1 x2 x1);
- nnormalize;
- ##[ ##1: nrewrite > (H1 y1 y2);
- ncases (f2 y2 y1);
- nnormalize;
- ##[ ##1: nrewrite > (H2 z1 z2); napply refl_eq
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqtriple :
-∀T1,T2,T3.∀p1,p2:Prod3T T1 T2 T3.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.
- (∀x1,x2:T1.x1 = x2 → f1 x1 x2 = true) →
- (∀y1,y2:T2.y1 = y2 → f2 y1 y2 = true) →
- (∀z1,z2:T3.z1 = z2 → f3 z1 z2 = true) →
- (p1 = p2 → eq_triple T1 T2 T3 p1 p2 f1 f2 f3 = true).
- #T1; #T2; #T3; #p1; #p2; #f1; #f2; #f3; #H1; #H2; #H3;
- nelim p1;
- #x1; #y1; #z1;
- nelim p2;
- #x2; #y2; #z2; #H;
- nnormalize;
- nrewrite > (H1 … (triple_destruct_1 … H));
- nnormalize;
- nrewrite > (H2 … (triple_destruct_2 … H));
- nnormalize;
- nrewrite > (H3 … (triple_destruct_3 … H));
- napply refl_eq.
-nqed.
-
-nlemma eqtriple_to_eq :
-∀T1,T2,T3.∀p1,p2:Prod3T T1 T2 T3.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.
- (∀x1,x2:T1.f1 x1 x2 = true → x1 = x2) →
- (∀y1,y2:T2.f2 y1 y2 = true → y1 = y2) →
- (∀z1,z2:T3.f3 z1 z2 = true → z1 = z2) →
- (eq_triple T1 T2 T3 p1 p2 f1 f2 f3 = true → p1 = p2).
- #T1; #T2; #T3; #p1; #p2; #f1; #f2; #f3; #H1; #H2; #H3;
- nelim p1;
- #x1; #y1; #z1;
- nelim p2;
- #x2; #y2; #z2; #H;
- nnormalize in H:(%);
- nletin K ≝ (H1 x1 x2);
- ncases (f1 x1 x2) in H:(%) K:(%);
- nnormalize;
- ##[ ##2: #H4; napply (bool_destruct … H4) ##]
- nletin K1 ≝ (H2 y1 y2);
- ncases (f2 y1 y2) in K1:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H4; #H5; napply (bool_destruct … H5) ##]
- #H4; #H5; #H6;
- nrewrite > (H4 (refl_eq …));
- nrewrite > (H6 (refl_eq …));
- nrewrite > (H3 z1 z2 H5);
- napply refl_eq.
-nqed.
-
-nlemma quadruple_destruct_1 :
-∀T1,T2,T3,T4.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.
- quadruple T1 T2 T3 T4 x1 y1 z1 v1 = quadruple T1 T2 T3 T4 x2 y2 z2 v2 → x1 = x2.
- #T1; #T2; #T3; #T4; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #H;
- nchange with (match quadruple T1 T2 T3 T4 x2 y2 z2 v2 with [ quadruple a _ _ _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quadruple_destruct_2 :
-∀T1,T2,T3,T4.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.
- quadruple T1 T2 T3 T4 x1 y1 z1 v1 = quadruple T1 T2 T3 T4 x2 y2 z2 v2 → y1 = y2.
- #T1; #T2; #T3; #T4; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #H;
- nchange with (match quadruple T1 T2 T3 T4 x2 y2 z2 v2 with [ quadruple _ b _ _ ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quadruple_destruct_3 :
-∀T1,T2,T3,T4.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.
- quadruple T1 T2 T3 T4 x1 y1 z1 v1 = quadruple T1 T2 T3 T4 x2 y2 z2 v2 → z1 = z2.
- #T1; #T2; #T3; #T4; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #H;
- nchange with (match quadruple T1 T2 T3 T4 x2 y2 z2 v2 with [ quadruple _ _ c _ ⇒ z1 = c ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quadruple_destruct_4 :
-∀T1,T2,T3,T4.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.
- quadruple T1 T2 T3 T4 x1 y1 z1 v1 = quadruple T1 T2 T3 T4 x2 y2 z2 v2 → v1 = v2.
- #T1; #T2; #T3; #T4; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #H;
- nchange with (match quadruple T1 T2 T3 T4 x2 y2 z2 v2 with [ quadruple _ _ _ d ⇒ v1 = d ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqquadruple :
-∀T1,T2,T3,T4:Type.∀p1,p2:Prod4T T1 T2 T3 T4.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.
- (symmetricT T1 bool f1) →
- (symmetricT T2 bool f2) →
- (symmetricT T3 bool f3) →
- (symmetricT T4 bool f4) →
- (eq_quadruple T1 T2 T3 T4 p1 p2 f1 f2 f3 f4 = eq_quadruple T1 T2 T3 T4 p2 p1 f1 f2 f3 f4).
- #T1; #T2; #T3; #T4; #p1; #p2; #f1; #f2; #f3; #f4; #H; #H1; #H2; #H3;
- nelim p1;
- #x1; #y1; #z1; #v1;
- nelim p2;
- #x2; #y2; #z2; #v2;
- nnormalize;
- nrewrite > (H x1 x2);
- ncases (f1 x2 x1);
- nnormalize;
- ##[ ##1: nrewrite > (H1 y1 y2);
- ncases (f2 y2 y1);
- nnormalize;
- ##[ ##1: nrewrite > (H2 z1 z2);
- ncases (f3 z2 z1);
- nnormalize;
- ##[ ##1: nrewrite > (H3 v1 v2); napply refl_eq
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqquadruple :
-∀T1,T2,T3,T4.∀p1,p2:Prod4T T1 T2 T3 T4.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.
- (∀x1,x2:T1.x1 = x2 → f1 x1 x2 = true) →
- (∀y1,y2:T2.y1 = y2 → f2 y1 y2 = true) →
- (∀z1,z2:T3.z1 = z2 → f3 z1 z2 = true) →
- (∀v1,v2:T4.v1 = v2 → f4 v1 v2 = true) →
- (p1 = p2 → eq_quadruple T1 T2 T3 T4 p1 p2 f1 f2 f3 f4 = true).
- #T1; #T2; #T3; #T4; #p1; #p2; #f1; #f2; #f3; #f4; #H1; #H2; #H3; #H4;
- nelim p1;
- #x1; #y1; #z1; #v1;
- nelim p2;
- #x2; #y2; #z2; #v2; #H;
- nnormalize;
- nrewrite > (H1 … (quadruple_destruct_1 … H));
- nnormalize;
- nrewrite > (H2 … (quadruple_destruct_2 … H));
- nnormalize;
- nrewrite > (H3 … (quadruple_destruct_3 … H));
- nnormalize;
- nrewrite > (H4 … (quadruple_destruct_4 … H));
- napply refl_eq.
-nqed.
-
-nlemma eqquadruple_to_eq :
-∀T1,T2,T3,T4.∀p1,p2:Prod4T T1 T2 T3 T4.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.
- (∀x1,x2:T1.f1 x1 x2 = true → x1 = x2) →
- (∀y1,y2:T2.f2 y1 y2 = true → y1 = y2) →
- (∀z1,z2:T3.f3 z1 z2 = true → z1 = z2) →
- (∀v1,v2:T4.f4 v1 v2 = true → v1 = v2) →
- (eq_quadruple T1 T2 T3 T4 p1 p2 f1 f2 f3 f4 = true → p1 = p2).
- #T1; #T2; #T3; #T4; #p1; #p2; #f1; #f2; #f3; #f4; #H1; #H2; #H3; #H4;
- nelim p1;
- #x1; #y1; #z1; #v1;
- nelim p2;
- #x2; #y2; #z2; #v2; #H;
- nnormalize in H:(%);
- nletin K ≝ (H1 x1 x2);
- ncases (f1 x1 x2) in H:(%) K:(%);
- nnormalize;
- ##[ ##2: #H5; napply (bool_destruct … H5) ##]
- nletin K1 ≝ (H2 y1 y2);
- ncases (f2 y1 y2) in K1:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H5; #H6; napply (bool_destruct … H6) ##]
- nletin K2 ≝ (H3 z1 z2);
- ncases (f3 z1 z2) in K2:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H5; #H6; #H7; napply (bool_destruct … H7) ##]
- #H5; #H6; #H7; #H8;
- nrewrite > (H5 (refl_eq …));
- nrewrite > (H6 (refl_eq …));
- nrewrite > (H8 (refl_eq …));
- nrewrite > (H4 v1 v2 H7);
- napply refl_eq.
-nqed.
-
-nlemma quintuple_destruct_1 :
-∀T1,T2,T3,T4,T5.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.∀w1,w2:T5.
- quintuple T1 T2 T3 T4 T5 x1 y1 z1 v1 w1 = quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 → x1 = x2.
- #T1; #T2; #T3; #T4; #T5; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #w1; #w2; #H;
- nchange with (match quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 with [ quintuple a _ _ _ _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quintuple_destruct_2 :
-∀T1,T2,T3,T4,T5.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.∀w1,w2:T5.
- quintuple T1 T2 T3 T4 T5 x1 y1 z1 v1 w1 = quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 → y1 = y2.
- #T1; #T2; #T3; #T4; #T5; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #w1; #w2; #H;
- nchange with (match quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 with [ quintuple _ b _ _ _ ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quintuple_destruct_3 :
-∀T1,T2,T3,T4,T5.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.∀w1,w2:T5.
- quintuple T1 T2 T3 T4 T5 x1 y1 z1 v1 w1 = quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 → z1 = z2.
- #T1; #T2; #T3; #T4; #T5; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #w1; #w2; #H;
- nchange with (match quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 with [ quintuple _ _ c _ _ ⇒ z1 = c ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quintuple_destruct_4 :
-∀T1,T2,T3,T4,T5.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.∀w1,w2:T5.
- quintuple T1 T2 T3 T4 T5 x1 y1 z1 v1 w1 = quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 → v1 = v2.
- #T1; #T2; #T3; #T4; #T5; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #w1; #w2; #H;
- nchange with (match quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 with [ quintuple _ _ _ d _ ⇒ v1 = d ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma quintuple_destruct_5 :
-∀T1,T2,T3,T4,T5.∀x1,x2:T1.∀y1,y2:T2.∀z1,z2:T3.∀v1,v2:T4.∀w1,w2:T5.
- quintuple T1 T2 T3 T4 T5 x1 y1 z1 v1 w1 = quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 → w1 = w2.
- #T1; #T2; #T3; #T4; #T5; #x1; #x2; #y1; #y2; #z1; #z2; #v1; #v2; #w1; #w2; #H;
- nchange with (match quintuple T1 T2 T3 T4 T5 x2 y2 z2 v2 w2 with [ quintuple _ _ _ _ e ⇒ w1 = e ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqquintuple :
-∀T1,T2,T3,T4,T5:Type.∀p1,p2:Prod5T T1 T2 T3 T4 T5.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.∀f5:T5 → T5 → bool.
- (symmetricT T1 bool f1) →
- (symmetricT T2 bool f2) →
- (symmetricT T3 bool f3) →
- (symmetricT T4 bool f4) →
- (symmetricT T5 bool f5) →
- (eq_quintuple T1 T2 T3 T4 T5 p1 p2 f1 f2 f3 f4 f5 = eq_quintuple T1 T2 T3 T4 T5 p2 p1 f1 f2 f3 f4 f5).
- #T1; #T2; #T3; #T4; #T5; #p1; #p2; #f1; #f2; #f3; #f4; #f5; #H; #H1; #H2; #H3; #H4;
- nelim p1;
- #x1; #y1; #z1; #v1; #w1;
- nelim p2;
- #x2; #y2; #z2; #v2; #w2;
- nnormalize;
- nrewrite > (H x1 x2);
- ncases (f1 x2 x1);
- nnormalize;
- ##[ ##1: nrewrite > (H1 y1 y2);
- ncases (f2 y2 y1);
- nnormalize;
- ##[ ##1: nrewrite > (H2 z1 z2);
- ncases (f3 z2 z1);
- nnormalize;
- ##[ ##1: nrewrite > (H3 v1 v2);
- ncases (f4 v2 v1);
- nnormalize;
- ##[ ##1: nrewrite > (H4 w1 w2); napply refl_eq
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
- ##| ##2: napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqquintuple :
-∀T1,T2,T3,T4,T5.∀p1,p2:Prod5T T1 T2 T3 T4 T5.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.∀f5:T5 → T5 → bool.
- (∀x1,x2:T1.x1 = x2 → f1 x1 x2 = true) →
- (∀y1,y2:T2.y1 = y2 → f2 y1 y2 = true) →
- (∀z1,z2:T3.z1 = z2 → f3 z1 z2 = true) →
- (∀v1,v2:T4.v1 = v2 → f4 v1 v2 = true) →
- (∀w1,w2:T5.w1 = w2 → f5 w1 w2 = true) →
- (p1 = p2 → eq_quintuple T1 T2 T3 T4 T5 p1 p2 f1 f2 f3 f4 f5 = true).
- #T1; #T2; #T3; #T4; #T5; #p1; #p2; #f1; #f2; #f3; #f4; #f5; #H1; #H2; #H3; #H4; #H5;
- nelim p1;
- #x1; #y1; #z1; #v1; #w1;
- nelim p2;
- #x2; #y2; #z2; #v2; #w2; #H;
- nnormalize;
- nrewrite > (H1 … (quintuple_destruct_1 … H));
- nnormalize;
- nrewrite > (H2 … (quintuple_destruct_2 … H));
- nnormalize;
- nrewrite > (H3 … (quintuple_destruct_3 … H));
- nnormalize;
- nrewrite > (H4 … (quintuple_destruct_4 … H));
- nnormalize;
- nrewrite > (H5 … (quintuple_destruct_5 … H));
- napply refl_eq.
-nqed.
-
-nlemma eqquintuple_to_eq :
-∀T1,T2,T3,T4,T5.∀p1,p2:Prod5T T1 T2 T3 T4 T5.
-∀f1:T1 → T1 → bool.∀f2:T2 → T2 → bool.∀f3:T3 → T3 → bool.∀f4:T4 → T4 → bool.∀f5:T5 → T5 → bool.
- (∀x1,x2:T1.f1 x1 x2 = true → x1 = x2) →
- (∀y1,y2:T2.f2 y1 y2 = true → y1 = y2) →
- (∀z1,z2:T3.f3 z1 z2 = true → z1 = z2) →
- (∀v1,v2:T4.f4 v1 v2 = true → v1 = v2) →
- (∀w1,w2:T5.f5 w1 w2 = true → w1 = w2) →
- (eq_quintuple T1 T2 T3 T4 T5 p1 p2 f1 f2 f3 f4 f5 = true → p1 = p2).
- #T1; #T2; #T3; #T4; #T5; #p1; #p2; #f1; #f2; #f3; #f4; #f5; #H1; #H2; #H3; #H4; #H5;
- nelim p1;
- #x1; #y1; #z1; #v1; #w1;
- nelim p2;
- #x2; #y2; #z2; #v2; #w2; #H;
- nnormalize in H:(%);
- nletin K ≝ (H1 x1 x2);
- ncases (f1 x1 x2) in H:(%) K:(%);
- nnormalize;
- ##[ ##2: #H6; napply (bool_destruct … H6) ##]
- nletin K1 ≝ (H2 y1 y2);
- ncases (f2 y1 y2) in K1:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H6; #H7; napply (bool_destruct … H7) ##]
- nletin K2 ≝ (H3 z1 z2);
- ncases (f3 z1 z2) in K2:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H6; #H7; #H8; napply (bool_destruct … H8) ##]
- nletin K3 ≝ (H4 v1 v2);
- ncases (f4 v1 v2) in K3:(%) ⊢ %;
- nnormalize;
- ##[ ##2: #H6; #H7; #H8; #H9; napply (bool_destruct … H9) ##]
- #H6; #H7; #H8; #H9; #H10;
- nrewrite > (H6 (refl_eq …));
- nrewrite > (H7 (refl_eq …));
- nrewrite > (H8 (refl_eq …));
- nrewrite > (H10 (refl_eq …));
- nrewrite > (H5 w1 w2 H9);
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| A.Asperti, C.Sacerdoti Coen, *)
-(* ||A|| E.Tassi, S.Zacchiroli *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU Lesser General Public License Version 2.1 *)
-(* *)
-(**************************************************************************)
-
-(* ********************************************************************** *)
-(* Progetto FreeScale *)
-(* *)
-(* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
-(* Cosimo Oliboni, oliboni@cs.unibo.it *)
-(* *)
-(* ********************************************************************** *)
-
-universe constraint Type[0] < Type[1].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ********** *)
-(* QUATERNARI *)
-(* ********** *)
-
-ninductive quatern : Type ≝
- q0 : quatern
-| q1 : quatern
-| q2 : quatern
-| q3 : quatern.
-
-(* operatore = *)
-ndefinition eq_qu ≝
-λn1,n2:quatern.
- match n1 with
- [ q0 ⇒ match n2 with [ q0 ⇒ true | _ ⇒ false ]
- | q1 ⇒ match n2 with [ q1 ⇒ true | _ ⇒ false ]
- | q2 ⇒ match n2 with [ q2 ⇒ true | _ ⇒ false ]
- | q3 ⇒ match n2 with [ q3 ⇒ true | _ ⇒ false ]
- ].
-
-(* iteratore sui quaternari *)
-ndefinition forall_qu ≝ λP.
- P q0 ⊗ P q1 ⊗ P q2 ⊗ P q3.
-
-(* operatore successorre *)
-ndefinition succ_qu ≝
-λn.match n with
- [ q0 ⇒ q1 | q1 ⇒ q2 | q2 ⇒ q3 | q3 ⇒ q0 ].
-
-(* quaternari ricorsivi *)
-ninductive rec_quatern : quatern → Type ≝
- qu_O : rec_quatern q0
-| qu_S : ∀n.rec_quatern n → rec_quatern (succ_qu n).
-
-(* quaternari → quaternari ricorsivi *)
-ndefinition qu_to_recqu ≝
-λn.match n return λx.rec_quatern x with
- [ q0 ⇒ qu_O
- | q1 ⇒ qu_S ? qu_O
- | q2 ⇒ qu_S ? (qu_S ? qu_O)
- | q3 ⇒ qu_S ? (qu_S ? (qu_S ? qu_O))
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool_lemmas.ma".
-include "freescale/quatern.ma".
-
-(* ********** *)
-(* QUATERNARI *)
-(* ********** *)
-
-ndefinition quatern_destruct_aux ≝
-Πn1,n2:quatern.ΠP:Prop.n1 = n2 →
- match n1 with
- [ q0 ⇒ match n2 with [ q0 ⇒ P → P | _ ⇒ P ]
- | q1 ⇒ match n2 with [ q1 ⇒ P → P | _ ⇒ P ]
- | q2 ⇒ match n2 with [ q2 ⇒ P → P | _ ⇒ P ]
- | q3 ⇒ match n2 with [ q3 ⇒ P → P | _ ⇒ P ]
- ].
-
-ndefinition quatern_destruct : quatern_destruct_aux.
- #n1; #n2; #P;
- nelim n1;
- ##[ ##1: nelim n2; nnormalize; #H;
- ##[ ##1: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match q0 with [ q0 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##2: nelim n2; nnormalize; #H;
- ##[ ##2: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match q1 with [ q1 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##3: nelim n2; nnormalize; #H;
- ##[ ##3: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match q2 with [ q2 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##| ##4: nelim n2; nnormalize; #H;
- ##[ ##4: napply (λx:P.x)
- ##| ##*: napply False_ind;
- nchange with (match q3 with [ q3 ⇒ False | _ ⇒ True ]);
- nrewrite > H; nnormalize; napply I
- ##]
- ##]
-nqed.
-
-nlemma symmetric_eqqu : symmetricT quatern bool eq_qu.
- #n1; #n2;
- nelim n1;
- nelim n2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqqu_to_eq : ∀n1,n2.eq_qu n1 n2 = true → n1 = n2.
- #n1; #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqqu : ∀n1,n2.n1 = n2 → eq_qu n1 n2 = true.
- #n1; #n2;
- ncases n1;
- ncases n2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (quatern_destruct … H)
- ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/memory_abs.ma".
-include "freescale/opcode_base.ma".
-include "freescale/prod.ma".
-
-(* *********************************** *)
-(* STATUS INTERNO DEL PROCESSORE (ALU) *)
-(* *********************************** *)
-
-(* ALU dell'HC05 *)
-nrecord alu_HC05: Type ≝
- {
- (* A: registo accumulatore *)
- acc_low_reg_HC05 : byte8;
- (* X: registro indice *)
- indX_low_reg_HC05 : byte8;
- (* SP: registo stack pointer *)
- sp_reg_HC05 : word16;
- (* modificatori di SP: per esempio e' definito come 0000000011xxxxxxb *)
- (* la logica della sua costruzione e' quindi (SP∧mask)∨fix *)
- (* totalmente racchiusa nella ALU, bastera' fare get(set(SP)) *)
- sp_mask_HC05 : word16;
- sp_fix_HC05 : word16;
- (* PC: registro program counter *)
- pc_reg_HC05 : word16;
- (* modificatore di PC: per esempio e' definito come 00xxxxxxxxxxxxxxb *)
- (* la logica della sua costruzione e' quindi (PC∧mask) *)
- (* totalmente racchiusa nella ALU, bastera' fare get(set(PC)) *)
- pc_mask_HC05 : word16;
-
- (* H: flag semi-carry (somma nibble basso) *)
- h_flag_HC05 : bool;
- (* I: flag mascheramento degli interrupt mascherabili: 1=mascherati *)
- i_flag_HC05 : bool;
- (* N: flag segno/negativita' *)
- n_flag_HC05 : bool;
- (* Z: flag zero *)
- z_flag_HC05 : bool;
- (* C: flag carry *)
- c_flag_HC05 : bool;
-
- (* IRQ: flag che simula il pin esterno IRQ *)
- irq_flag_HC05 : bool
- }.
-
-notation "{hvbox('A_Reg' ≝ acclow ; break 'X_Reg' ≝ indxlow ; break 'Sp_Reg' ≝ sp ; break 'Sp_Mask' ≝ spm ; break 'Sp_Fix' ≝ spf ; break 'Pc_Reg' ≝ pc ; break 'Pc_Mask' ≝ pcm ; break 'H_Flag' ≝ hfl ; break 'I_Flag' ≝ ifl ; break 'N_Flag' ≝ nfl ; break 'Z_Flag' ≝ zfl ; break 'C_Flag' ≝ cfl ; break 'IRQ_Flag' ≝ irqfl)}"
- non associative with precedence 80 for
- @{ 'mk_alu_HC05 $acclow $indxlow $sp $spm $spf $pc $pcm $hfl $ifl $nfl $zfl $cfl $irqfl }.
-interpretation "mk_alu_HC05" 'mk_alu_HC05 acclow indxlow sp spm spf pc pcm hfl ifl nfl zfl cfl irqfl =
- (mk_alu_HC05 acclow indxlow sp spm spf pc pcm hfl ifl nfl zfl cfl irqfl).
-
-(* ALU dell'HC08/HCS08 *)
-nrecord alu_HC08: Type ≝
- {
- (* A: registo accumulatore *)
- acc_low_reg_HC08 : byte8;
- (* X: registro indice parte bassa *)
- indX_low_reg_HC08 : byte8;
- (* H: registro indice parte alta *)
- indX_high_reg_HC08 : byte8;
- (* SP: registo stack pointer *)
- sp_reg_HC08 : word16;
- (* PC: registro program counter *)
- pc_reg_HC08 : word16;
-
- (* V: flag overflow *)
- v_flag_HC08 : bool;
- (* H: flag semi-carry (somma nibble basso) *)
- h_flag_HC08 : bool;
- (* I: flag mascheramento degli interrupt mascherabili: 1=mascherati *)
- i_flag_HC08 : bool;
- (* N: flag segno/negativita' *)
- n_flag_HC08 : bool;
- (* Z: flag zero *)
- z_flag_HC08 : bool;
- (* C: flag carry *)
- c_flag_HC08 : bool;
-
- (* IRQ: flag che simula il pin esterno IRQ *)
- irq_flag_HC08 : bool
- }.
-
-notation "{hvbox('A_Reg' ≝ acclow ; break 'X_Reg' ≝ indxlow ; break 'H_Reg' ≝ indxhigh ; break 'Sp_Reg' ≝ sp ; break 'Pc_Reg' ≝ pc ; break 'V_Flag' ≝ vfl ; break 'H_Flag' ≝ hfl ; break 'I_Flag' ≝ ifl ; break 'N_Flag' ≝ nfl ; break 'Z_Flag' ≝ zfl ; break 'C_Flag' ≝ cfl ; break 'IRQ_Flag' ≝ irqfl)}"
- non associative with precedence 80 for
- @{ 'mk_alu_HC08 $acclow $indxlow $indxhigh $sp $pc $vfl $hfl $ifl $nfl $zfl $cfl $irqfl }.
-interpretation "mk_alu_HC08" 'mk_alu_HC08 acclow indxlow indxhigh sp pc vfl hfl ifl nfl zfl cfl irqfl =
- (mk_alu_HC08 acclow indxlow indxhigh sp pc vfl hfl ifl nfl zfl cfl irqfl).
-
-(* ALU dell'RS08 *)
-nrecord alu_RS08: Type ≝
- {
- (* A: registo accumulatore *)
- acc_low_reg_RS08 : byte8;
- (* PC: registro program counter *)
- pc_reg_RS08 : word16;
- (* modificatore di PC: per esempio e' definito come 00xxxxxxxxxxxxxxb *)
- (* la logica della sua costruzione e' quindi (PC∧mask) *)
- (* totalmente racchiusa nella ALU, bastera' fare get(set(PC)) *)
- pc_mask_RS08 : word16;
- (* SPC: registro shadow program counter *)
- (* NB: il suo modificatore e' lo stesso di PC *)
- spc_reg_RS08 : word16;
-
- (* X: registro indice parte bassa *)
- (* NB: in realta' e' mappato in memoria e non risiede nella ALU *)
- (* la lettura/scrittura avviene tramite la locazione [0x000F] *)
- (* la funzione memory_filter_read/write si occupera' di intercettare *)
- (* e deviare sul registro le letture/scritture (modulo load_write) *)
- x_map_RS08 : byte8;
- (* PS: registro selezione di pagina *)
- (* serve a indirizzare la finestra RAM di 64b [0x00C0-0x00FF] *)
- (* su tutta la memoria installata [0x0000-0x3FFF]: [00pp pppp ppxx xxxx] *)
- (* NB: in realta' e' mappato in memoria e non risiede nella ALU *)
- (* la lettura/scrittura avviene tramite la locazione [0x001F] *)
- (* la funzione memory_filter_read/write si occupera' di intercettare *)
- (* e deviare sul registro le letture/scritture (modulo load_write) *)
- ps_map_RS08 : byte8;
-
- (* Z: flag zero *)
- z_flag_RS08 : bool;
- (* C: flag carry *)
- c_flag_RS08 : bool
- }.
-
-notation "{hvbox('A_Reg' ≝ acclow ; break 'Pc_Reg' ≝ pc ; break 'Pc_Mask' ≝ pcm ; break 'Spc_Reg' ≝ spc ; break 'X_Map' ≝ xm ; break 'Ps_Map' ≝ psm ; break 'Z_Flag' ≝ zfl ; break 'C_Flag' ≝ cfl)}"
- non associative with precedence 80 for
- @{ 'mk_alu_RS08 $acclow $pc $pcm $spc $xm $psm $zfl $cfl }.
-interpretation "mk_alu_RS08" 'mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl =
- (mk_alu_RS08 acclow pc pcm spc xm psm zfl cfl).
-
-(* tipo processore dipendente dalla mcu, varia solo la ALU *)
-nrecord any_status (mcu:mcu_type) (t:memory_impl): Type ≝
- {
- alu : match mcu with
- [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ];
-
- (* descritore della memoria *)
- mem_desc : aux_mem_type t;
- (* descrittore del tipo di memoria installata *)
- chk_desc : aux_chk_type t;
- (* descrittore del click = stato di avanzamento dell'esecuzione+cur_pc conseguente a fetch *)
- (* 1) None = istruzione eseguita, attesa del fetch *)
- (* 2) Some cur_clk,pseudo,mode,clks,cur_pc = fetch eseguito, countup a esecuzione *)
- clk_desc : option (Prod5T byte8 (any_opcode mcu) (instr_mode) byte8 word16)
- }.
-
-(* evitare di mostrare la memoria/descrittore che impalla il visualizzatore *)
-notation > "{hvbox('Alu' ≝ alu ; break 'Clk' ≝ clk)}" non associative with precedence 80
- for @{ 'mk_any_status $alu $mem $chk $clk }.
-interpretation "mk_any_status" 'mk_any_status alu mem chk clk =
- (mk_any_status alu mem chk clk).
-
-(* **************** *)
-(* GETTER SPECIFICI *)
-(* **************** *)
-
-(* funzione ausiliaria per il tipaggio dei getter *)
-ndefinition aux_get_typing ≝ λx:Type.λm:mcu_type.match m with
- [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ] → x.
-
-(* REGISTRI *)
-
-(* getter di A, esiste sempre *)
-ndefinition get_acc_8_low_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing byte8 with
- [ HC05 ⇒ acc_low_reg_HC05
- | HC08 ⇒ acc_low_reg_HC08
- | HCS08 ⇒ acc_low_reg_HC08
- | RS08 ⇒ acc_low_reg_RS08 ]
- (alu m t s).
-
-(* getter di X, non esiste sempre *)
-ndefinition get_indX_8_low_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option byte8) with
- [ HC05 ⇒ λalu.Some ? (indX_low_reg_HC05 alu)
- | HC08 ⇒ λalu.Some ? (indX_low_reg_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (indX_low_reg_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di H, non esiste sempre *)
-ndefinition get_indX_8_high_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option byte8) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.Some ? (indX_high_reg_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (indX_high_reg_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di H:X, non esiste sempre *)
-ndefinition get_indX_16_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option word16) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.Some ? (mk_word16 (indX_high_reg_HC08 alu) (indX_low_reg_HC08 alu))
- | HCS08 ⇒ λalu.Some ? (mk_word16 (indX_high_reg_HC08 alu) (indX_low_reg_HC08 alu))
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di SP, non esiste sempre *)
-ndefinition get_sp_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option word16) with
- [ HC05 ⇒ λalu.Some ? (sp_reg_HC05 alu)
- | HC08 ⇒ λalu.Some ? (sp_reg_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (sp_reg_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di PC, esiste sempre *)
-ndefinition get_pc_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing word16 with
- [ HC05 ⇒ pc_reg_HC05
- | HC08 ⇒ pc_reg_HC08
- | HCS08 ⇒ pc_reg_HC08
- | RS08 ⇒ pc_reg_RS08 ]
- (alu m t s).
-
-(* getter di SPC, non esiste sempre *)
-ndefinition get_spc_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option word16) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.None ?
- | HCS08 ⇒ λalu.None ?
- | RS08 ⇒ λalu.Some ? (spc_reg_RS08 alu) ]
- (alu m t s).
-
-(* REGISTRI MEMORY MAPPED *)
-
-(* getter di memory mapped X, non esiste sempre *)
-ndefinition get_x_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option byte8) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.None ?
- | HCS08 ⇒ λalu.None ?
- | RS08 ⇒ λalu.Some ? (x_map_RS08 alu) ]
- (alu m t s).
-
-(* getter di memory mapped PS, non esiste sempre *)
-ndefinition get_ps_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option byte8) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.None ?
- | HCS08 ⇒ λalu.None ?
- | RS08 ⇒ λalu.Some ? (ps_map_RS08 alu) ]
- (alu m t s).
-
-(* FLAG *)
-
-(* getter di V, non esiste sempre *)
-ndefinition get_v_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option bool) with
- [ HC05 ⇒ λalu.None ?
- | HC08 ⇒ λalu.Some ? (v_flag_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (v_flag_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di H, non esiste sempre *)
-ndefinition get_h_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option bool) with
- [ HC05 ⇒ λalu.Some ? (h_flag_HC05 alu)
- | HC08 ⇒ λalu.Some ? (h_flag_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (h_flag_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di I, non esiste sempre *)
-ndefinition get_i_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option bool) with
- [ HC05 ⇒ λalu.Some ? (i_flag_HC05 alu)
- | HC08 ⇒ λalu.Some ? (i_flag_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (i_flag_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di N, non esiste sempre *)
-ndefinition get_n_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option bool) with
- [ HC05 ⇒ λalu.Some ? (n_flag_HC05 alu)
- | HC08 ⇒ λalu.Some ? (n_flag_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (n_flag_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* getter di Z, esiste sempre *)
-ndefinition get_z_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing bool with
- [ HC05 ⇒ z_flag_HC05
- | HC08 ⇒ z_flag_HC08
- | HCS08 ⇒ z_flag_HC08
- | RS08 ⇒ z_flag_RS08 ]
- (alu m t s).
-
-(* getter di C, esiste sempre *)
-ndefinition get_c_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing bool with
- [ HC05 ⇒ c_flag_HC05
- | HC08 ⇒ c_flag_HC08
- | HCS08 ⇒ c_flag_HC08
- | RS08 ⇒ c_flag_RS08 ]
- (alu m t s).
-
-(* getter di IRQ, non esiste sempre *)
-ndefinition get_irq_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
- match m
- return aux_get_typing (option bool) with
- [ HC05 ⇒ λalu.Some ? (irq_flag_HC05 alu)
- | HC08 ⇒ λalu.Some ? (irq_flag_HC08 alu)
- | HCS08 ⇒ λalu.Some ? (irq_flag_HC08 alu)
- | RS08 ⇒ λalu.None ? ]
- (alu m t s).
-
-(* ***************************** *)
-(* SETTER SPECIFICI FORTI/DEBOLI *)
-(* ***************************** *)
-
-(* funzione ausiliaria per il tipaggio dei setter forti *)
-ndefinition aux_set_typing ≝ λx:Type.λm:mcu_type.
- match m with [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ]
- → x →
- match m with [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ].
-
-(* funzione ausiliaria per il tipaggio dei setter deboli *)
-ndefinition aux_set_typing_opt ≝ λx:Type.λm:mcu_type.option
- (match m with [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ]
- → x →
- match m with [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ]).
-
-(* DESCRITTORI ESTERNI ALLA ALU *)
-
-(* setter forte della ALU *)
-ndefinition set_alu ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λalu'.
- mk_any_status m t alu' (mem_desc m t s) (chk_desc m t s) (clk_desc m t s).
-
-(* setter forte della memoria *)
-ndefinition set_mem_desc ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λmem':aux_mem_type t.
- mk_any_status m t (alu m t s) mem' (chk_desc m t s) (clk_desc m t s).
-
-(* setter forte del descrittore *)
-ndefinition set_chk_desc ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λchk':aux_chk_type t.
- mk_any_status m t (alu m t s) (mem_desc m t s) chk' (clk_desc m t s).
-
-(* setter forte del clik *)
-ndefinition set_clk_desc ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.
-λclk':option (Prod5T byte8 (any_opcode m) (instr_mode) byte8 word16).
- mk_any_status m t (alu m t s) (mem_desc m t s) (chk_desc m t s) clk'.
-
-(* REGISTRO A *)
-
-(* setter specifico HC05 di A *)
-ndefinition set_acc_8_low_reg_HC05 ≝
-λalu.λacclow':byte8.
- mk_alu_HC05
- acclow'
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di A *)
-ndefinition set_acc_8_low_reg_HC08 ≝
-λalu.λacclow':byte8.
- mk_alu_HC08
- acclow'
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter specifico RS08 di A *)
-ndefinition set_acc_8_low_reg_RS08 ≝
-λalu.λacclow':byte8.
- mk_alu_RS08
- acclow'
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- (x_map_RS08 alu)
- (ps_map_RS08 alu)
- (z_flag_RS08 alu)
- (c_flag_RS08 alu).
-
-(* setter forte di A *)
-ndefinition set_acc_8_low_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λacclow':byte8.
- set_alu m t s
- (match m return aux_set_typing byte8 with
- [ HC05 ⇒ set_acc_8_low_reg_HC05
- | HC08 ⇒ set_acc_8_low_reg_HC08
- | HCS08 ⇒ set_acc_8_low_reg_HC08
- | RS08 ⇒ set_acc_8_low_reg_RS08
- ] (alu m t s) acclow').
-
-(* REGISTRO X *)
-
-(* setter specifico HC05 di X *)
-ndefinition set_indX_8_low_reg_HC05 ≝
-λalu.λindxlow':byte8.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- indxlow'
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di X *)
-ndefinition set_indX_8_low_reg_HC08 ≝
-λalu.λindxlow':byte8.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- indxlow'
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di X *)
-ndefinition set_indX_8_low_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindxlow':byte8.
- opt_map … (match m return aux_set_typing_opt byte8 with
- [ HC05 ⇒ Some ? set_indX_8_low_reg_HC05
- | HC08 ⇒ Some ? set_indX_8_low_reg_HC08
- | HCS08 ⇒ Some ? set_indX_8_low_reg_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) indxlow'))).
-
-(* setter debole di X *)
-ndefinition setweak_indX_8_low_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindxlow':byte8.
- match set_indX_8_low_reg m t s indxlow' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO H *)
-
-(* setter specifico HC08/HCS08 di H *)
-ndefinition set_indX_8_high_reg_HC08 ≝
-λalu.λindxhigh':byte8.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- indxhigh'
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di H *)
-ndefinition set_indX_8_high_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindxhigh':byte8.
- opt_map … (match m return aux_set_typing_opt byte8 with
- [ HC05 ⇒ None ?
- | HC08 ⇒ Some ? set_indX_8_high_reg_HC08
- | HCS08 ⇒ Some ? set_indX_8_high_reg_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) indxhigh'))).
-
-(* setter debole di H *)
-ndefinition setweak_indX_8_high_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindxhigh':byte8.
- match set_indX_8_high_reg m t s indxhigh' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO H:X *)
-
-(* setter specifico HC08/HCS08 di H:X *)
-ndefinition set_indX_16_reg_HC08 ≝
-λalu.λindx16:word16.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (w16l indx16)
- (w16h indx16)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di H:X *)
-ndefinition set_indX_16_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindx16:word16.
- opt_map … (match m return aux_set_typing_opt word16 with
- [ HC05 ⇒ None ?
- | HC08 ⇒ Some ? set_indX_16_reg_HC08
- | HCS08 ⇒ Some ? set_indX_16_reg_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) indx16))).
-
-(* setter debole di H:X *)
-ndefinition setweak_indX_16_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λindx16:word16.
- match set_indX_16_reg m t s indx16 with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO SP *)
-
-(* setter specifico HC05 di SP, effettua (SP∧mask)∨fix *)
-ndefinition set_sp_reg_HC05 ≝
-λalu.λsp':word16.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (or_w16 (and_w16 sp' (sp_mask_HC05 alu)) (sp_fix_HC05 alu))
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di SP *)
-ndefinition set_sp_reg_HC08 ≝
-λalu.λsp':word16.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- sp'
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di SP *)
-ndefinition set_sp_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λsp':word16.
- opt_map … (match m return aux_set_typing_opt word16 with
- [ HC05 ⇒ Some ? set_sp_reg_HC05
- | HC08 ⇒ Some ? set_sp_reg_HC08
- | HCS08 ⇒ Some ? set_sp_reg_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) sp'))).
-
-(* setter debole di SP *)
-ndefinition setweak_sp_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λsp':word16.
- match set_sp_reg m t s sp' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO PC *)
-
-(* setter specifico HC05 di PC, effettua PC∧mask *)
-ndefinition set_pc_reg_HC05 ≝
-λalu.λpc':word16.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (and_w16 pc' (pc_mask_HC05 alu))
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di PC *)
-ndefinition set_pc_reg_HC08 ≝
-λalu.λpc':word16.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- pc'
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter specifico RS08 di PC, effettua PC∧mask *)
-ndefinition set_pc_reg_RS08 ≝
-λalu.λpc':word16.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (and_w16 pc' (pc_mask_RS08 alu))
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- (x_map_RS08 alu)
- (ps_map_RS08 alu)
- (z_flag_RS08 alu)
- (c_flag_RS08 alu).
-
-(* setter forte di PC *)
-ndefinition set_pc_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λpc':word16.
- set_alu m t s
- (match m return aux_set_typing word16 with
- [ HC05 ⇒ set_pc_reg_HC05
- | HC08 ⇒ set_pc_reg_HC08
- | HCS08 ⇒ set_pc_reg_HC08
- | RS08 ⇒ set_pc_reg_RS08
- ] (alu m t s) pc').
-
-(* REGISTRO SPC *)
-
-(* setter specifico RS08 di SPC, effettua SPC∧mask *)
-ndefinition set_spc_reg_RS08 ≝
-λalu.λspc':word16.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (and_w16 spc' (pc_mask_RS08 alu))
- (x_map_RS08 alu)
- (ps_map_RS08 alu)
- (z_flag_RS08 alu)
- (c_flag_RS08 alu).
-
-(* setter forte di SPC *)
-ndefinition set_spc_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λspc':word16.
- opt_map … (match m return aux_set_typing_opt word16 with
- [ HC05 ⇒ None ?
- | HC08 ⇒ None ?
- | HCS08 ⇒ None ?
- | RS08 ⇒ Some ? set_spc_reg_RS08 ])
- (λf.Some ? (set_alu m t s (f (alu m t s) spc'))).
-
-(* setter debole di SPC *)
-ndefinition setweak_spc_reg ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λspc':word16.
- match set_spc_reg m t s spc' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO MEMORY MAPPED X *)
-
-(* setter specifico RS08 di memory mapped X *)
-ndefinition set_x_map_RS08 ≝
-λalu.λxm':byte8.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- xm'
- (ps_map_RS08 alu)
- (z_flag_RS08 alu)
- (c_flag_RS08 alu).
-
-(* setter forte di memory mapped X *)
-ndefinition set_x_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λxm':byte8.
- opt_map … (match m return aux_set_typing_opt byte8 with
- [ HC05 ⇒ None ?
- | HC08 ⇒ None ?
- | HCS08 ⇒ None ?
- | RS08 ⇒ Some ? set_x_map_RS08 ])
- (λf.Some ? (set_alu m t s (f (alu m t s) xm'))).
-
-(* setter debole di memory mapped X *)
-ndefinition setweak_x_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λxm':byte8.
- match set_x_map m t s xm' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* REGISTRO MEMORY MAPPED PS *)
-
-(* setter specifico RS08 di memory mapped PS *)
-ndefinition set_ps_map_RS08 ≝
-λalu.λpsm':byte8.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- (x_map_RS08 alu)
- psm'
- (z_flag_RS08 alu)
- (c_flag_RS08 alu).
-
-(* setter forte di memory mapped PS *)
-ndefinition set_ps_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λpsm':byte8.
- opt_map … (match m return aux_set_typing_opt byte8 with
- [ HC05 ⇒ None ?
- | HC08 ⇒ None ?
- | HCS08 ⇒ None ?
- | RS08 ⇒ Some ? set_ps_map_RS08 ])
- (λf.Some ? (set_alu m t s (f (alu m t s) psm'))).
-
-(* setter debole di memory mapped PS *)
-ndefinition setweak_ps_map ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λpsm':byte8.
- match set_ps_map m t s psm' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* FLAG V *)
-
-(* setter specifico HC08/HCS08 di V *)
-ndefinition set_v_flag_HC08 ≝
-λalu.λvfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- vfl'
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di V *)
-ndefinition set_v_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λvfl':bool.
- opt_map … (match m return aux_set_typing_opt bool with
- [ HC05 ⇒ None ?
- | HC08 ⇒ Some ? set_v_flag_HC08
- | HCS08 ⇒ Some ? set_v_flag_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) vfl'))).
-
-(* setter debole di V *)
-ndefinition setweak_v_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λvfl':bool.
- match set_v_flag m t s vfl' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* FLAG H *)
-
-(* setter specifico HC05 di H *)
-ndefinition set_h_flag_HC05 ≝
-λalu.λhfl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- hfl'
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di H *)
-ndefinition set_h_flag_HC08 ≝
-λalu.λhfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- hfl'
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di H *)
-ndefinition set_h_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λhfl':bool.
- opt_map … (match m return aux_set_typing_opt bool with
- [ HC05 ⇒ Some ? set_h_flag_HC05
- | HC08 ⇒ Some ? set_h_flag_HC08
- | HCS08 ⇒ Some ? set_h_flag_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) hfl'))).
-
-(* setter debole di H *)
-ndefinition setweak_h_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λhfl':bool.
- match set_h_flag m t s hfl' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* FLAG I *)
-
-(* setter specifico HC05 di I *)
-ndefinition set_i_flag_HC05 ≝
-λalu.λifl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- ifl'
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di I *)
-ndefinition set_i_flag_HC08 ≝
-λalu.λifl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- ifl'
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di I *)
-ndefinition set_i_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λifl':bool.
- opt_map … (match m return aux_set_typing_opt bool with
- [ HC05 ⇒ Some ? set_i_flag_HC05
- | HC08 ⇒ Some ? set_i_flag_HC08
- | HCS08 ⇒ Some ? set_i_flag_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) ifl'))).
-
-(* setter debole di I *)
-ndefinition setweak_i_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λifl':bool.
- match set_i_flag m t s ifl' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* FLAG N *)
-
-(* setter specifico HC05 di N *)
-ndefinition set_n_flag_HC05 ≝
-λalu.λnfl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- nfl'
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di N *)
-ndefinition set_n_flag_HC08 ≝
-λalu.λnfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- nfl'
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter forte di N *)
-ndefinition set_n_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λnfl':bool.
- opt_map … (match m return aux_set_typing_opt bool with
- [ HC05 ⇒ Some ? set_n_flag_HC05
- | HC08 ⇒ Some ? set_n_flag_HC08
- | HCS08 ⇒ Some ? set_n_flag_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) nfl'))).
-
-(* setter debole di N *)
-ndefinition setweak_n_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λnfl':bool.
- match set_n_flag m t s nfl' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* FLAG Z *)
-
-(* setter specifico HC05 di Z *)
-ndefinition set_z_flag_HC05 ≝
-λalu.λzfl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- zfl'
- (c_flag_HC05 alu)
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di Z *)
-ndefinition set_z_flag_HC08 ≝
-λalu.λzfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- zfl'
- (c_flag_HC08 alu)
- (irq_flag_HC08 alu).
-
-(* setter sprcifico RS08 di Z *)
-ndefinition set_z_flag_RS08 ≝
-λalu.λzfl':bool.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- (x_map_RS08 alu)
- (ps_map_RS08 alu)
- zfl'
- (c_flag_RS08 alu).
-
-(* setter forte di Z *)
-ndefinition set_z_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λzfl':bool.
- set_alu m t s
- (match m return aux_set_typing bool with
- [ HC05 ⇒ set_z_flag_HC05
- | HC08 ⇒ set_z_flag_HC08
- | HCS08 ⇒ set_z_flag_HC08
- | RS08 ⇒ set_z_flag_RS08
- ] (alu m t s) zfl').
-
-(* FLAG C *)
-
-(* setter specifico HC05 di C *)
-ndefinition set_c_flag_HC05 ≝
-λalu.λcfl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- cfl'
- (irq_flag_HC05 alu).
-
-(* setter specifico HC08/HCS08 di C *)
-ndefinition set_c_flag_HC08 ≝
-λalu.λcfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- cfl'
- (irq_flag_HC08 alu).
-
-(* setter specifico RS08 di C *)
-ndefinition set_c_flag_RS08 ≝
-λalu.λcfl':bool.
- mk_alu_RS08
- (acc_low_reg_RS08 alu)
- (pc_reg_RS08 alu)
- (pc_mask_RS08 alu)
- (spc_reg_RS08 alu)
- (x_map_RS08 alu)
- (ps_map_RS08 alu)
- (z_flag_RS08 alu)
- cfl'.
-
-(* setter forte di C *)
-ndefinition set_c_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λcfl':bool.
- set_alu m t s
- (match m return aux_set_typing bool with
- [ HC05 ⇒ set_c_flag_HC05
- | HC08 ⇒ set_c_flag_HC08
- | HCS08 ⇒ set_c_flag_HC08
- | RS08 ⇒ set_c_flag_RS08
- ] (alu m t s) cfl').
-
-(* FLAG IRQ *)
-
-(* setter specifico HC05 di IRQ *)
-ndefinition set_irq_flag_HC05 ≝
-λalu.λirqfl':bool.
- mk_alu_HC05
- (acc_low_reg_HC05 alu)
- (indX_low_reg_HC05 alu)
- (sp_reg_HC05 alu)
- (sp_mask_HC05 alu)
- (sp_fix_HC05 alu)
- (pc_reg_HC05 alu)
- (pc_mask_HC05 alu)
- (h_flag_HC05 alu)
- (i_flag_HC05 alu)
- (n_flag_HC05 alu)
- (z_flag_HC05 alu)
- (c_flag_HC05 alu)
- irqfl'.
-
-(* setter specifico HC08/HCS08 di IRQ *)
-ndefinition set_irq_flag_HC08 ≝
-λalu.λirqfl':bool.
- mk_alu_HC08
- (acc_low_reg_HC08 alu)
- (indX_low_reg_HC08 alu)
- (indX_high_reg_HC08 alu)
- (sp_reg_HC08 alu)
- (pc_reg_HC08 alu)
- (v_flag_HC08 alu)
- (h_flag_HC08 alu)
- (i_flag_HC08 alu)
- (n_flag_HC08 alu)
- (z_flag_HC08 alu)
- (c_flag_HC08 alu)
- irqfl'.
-
-(* setter forte di IRQ *)
-ndefinition set_irq_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λirqfl':bool.
- opt_map … (match m return aux_set_typing_opt bool with
- [ HC05 ⇒ Some ? set_irq_flag_HC05
- | HC08 ⇒ Some ? set_irq_flag_HC08
- | HCS08 ⇒ Some ? set_irq_flag_HC08
- | RS08 ⇒ None ? ])
- (λf.Some ? (set_alu m t s (f (alu m t s) irqfl'))).
-
-(* setter debole di IRQ *)
-ndefinition setweak_irq_flag ≝
-λm:mcu_type.λt:memory_impl.λs:any_status m t.λirqfl':bool.
- match set_irq_flag m t s irqfl' with
- [ None ⇒ s | Some s' ⇒ s' ].
-
-(* ***************** *)
-(* CONFRONTO FRA ALU *)
-(* ***************** *)
-
-(* confronto registro per registro dell'HC05 *)
-ndefinition eq_alu_HC05 ≝
-λalu1,alu2:alu_HC05.
- match alu1 with
- [ mk_alu_HC05 acclow1 indxlow1 sp1 spm1 spf1 pc1 pcm1 hfl1 ifl1 nfl1 zfl1 cfl1 irqfl1 ⇒
- match alu2 with
- [ mk_alu_HC05 acclow2 indxlow2 sp2 spm2 spf2 pc2 pcm2 hfl2 ifl2 nfl2 zfl2 cfl2 irqfl2 ⇒
- (eq_b8 acclow1 acclow2) ⊗
- (eq_b8 indxlow1 indxlow2) ⊗
- (eq_w16 sp1 sp2) ⊗
- (eq_w16 spm1 spm2) ⊗
- (eq_w16 spf1 spf2) ⊗
- (eq_w16 pc1 pc2) ⊗
- (eq_w16 pcm1 pcm2) ⊗
- (eq_bool hfl1 hfl2) ⊗
- (eq_bool ifl1 ifl2) ⊗
- (eq_bool nfl1 nfl2) ⊗
- (eq_bool zfl1 zfl2) ⊗
- (eq_bool cfl1 cfl2) ⊗
- (eq_bool irqfl1 irqfl2) ]].
-
-(* confronto registro per registro dell'HC08 *)
-ndefinition eq_alu_HC08 ≝
-λalu1,alu2:alu_HC08.
- match alu1 with
- [ mk_alu_HC08 acclow1 indxlow1 indxhigh1 sp1 pc1 vfl1 hfl1 ifl1 nfl1 zfl1 cfl1 irqfl1 ⇒
- match alu2 with
- [ mk_alu_HC08 acclow2 indxlow2 indxhigh2 sp2 pc2 vfl2 hfl2 ifl2 nfl2 zfl2 cfl2 irqfl2 ⇒
- (eq_b8 acclow1 acclow2) ⊗
- (eq_b8 indxlow1 indxlow2) ⊗
- (eq_b8 indxhigh1 indxhigh2) ⊗
- (eq_w16 sp1 sp2) ⊗
- (eq_w16 pc1 pc2) ⊗
- (eq_bool vfl1 vfl2) ⊗
- (eq_bool hfl1 hfl2) ⊗
- (eq_bool ifl1 ifl2) ⊗
- (eq_bool nfl1 nfl2) ⊗
- (eq_bool zfl1 zfl2) ⊗
- (eq_bool cfl1 cfl2) ⊗
- (eq_bool irqfl1 irqfl2) ]].
-
-(* confronto registro per registro dell'RS08 *)
-ndefinition eq_alu_RS08 ≝
-λalu1,alu2:alu_RS08.
- match alu1 with
- [ mk_alu_RS08 acclow1 pc1 pcm1 spc1 xm1 psm1 zfl1 cfl1 ⇒
- match alu2 with
- [ mk_alu_RS08 acclow2 pc2 pcm2 spc2 xm2 psm2 zfl2 cfl2 ⇒
- (eq_b8 acclow1 acclow2) ⊗
- (eq_w16 pc1 pc2) ⊗
- (eq_w16 pcm1 pcm2) ⊗
- (eq_w16 spc1 spc2) ⊗
- (eq_b8 xm1 xm2) ⊗
- (eq_b8 psm1 psm2) ⊗
- (eq_bool zfl1 zfl2) ⊗
- (eq_bool cfl1 cfl2) ]].
-
-(* ******************** *)
-(* CONFRONTO FRA STATUS *)
-(* ******************** *)
-
-(* confronto di una regione di memoria [addr1 ; ... ; addrn] *)
-nlet rec forall_memory_ranged
- (t:memory_impl)
- (chk1:aux_chk_type t) (chk2:aux_chk_type t)
- (mem1:aux_mem_type t) (mem2:aux_mem_type t)
- (addrl:list word16) on addrl ≝
- match addrl return λ_.bool with
- [ nil ⇒ true
- | cons hd tl ⇒ (eq_option byte8 (mem_read t mem1 chk1 hd)
- (mem_read t mem2 chk2 hd) eq_b8) ⊗
- (forall_memory_ranged t chk1 chk2 mem1 mem2 tl)
- ].
-
-(* il clk e' option (Prod5T byte8 (any_opcode m) (instr_mode) byte8 word16) *)
-ndefinition eq_clk ≝
-λm:mcu_type.λc1,c2:option (Prod5T byte8 (any_opcode m) (instr_mode) byte8 word16).
- match c1 with
- [ None ⇒ match c2 with
- [ None ⇒ true | Some _ ⇒ false ]
- | Some c1' ⇒ match c2 with
- [ None ⇒ false | Some c2' ⇒ (eq_b8 (fst5T … c1') (fst5T … c2')) ⊗
- (eq_anyop m (snd5T … c1') (snd5T … c2')) ⊗
- (eq_instrmode (thd5T … c1') (thd5T … c2')) ⊗
- (eq_b8 (frth5T … c1') (frth5T … c2')) ⊗
- (eq_w16 (ffth5T … c1') (ffth5T … c2')) ]
- ].
-
-(* generalizzazione del confronto fra stati *)
-ndefinition eq_status ≝
-λm:mcu_type.λt:memory_impl.λs1,s2:any_status m t.λaddrl:list word16.
- match s1 with [ mk_any_status alu1 mem1 chk1 clk1 ⇒
- match s2 with [ mk_any_status alu2 mem2 chk2 clk2 ⇒
-
- (* 1) confronto della ALU *)
- (match m return λm:mcu_type.
- match m with
- [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ] →
- match m with
- [ HC05 ⇒ alu_HC05 | HC08 ⇒ alu_HC08 | HCS08 ⇒ alu_HC08 | RS08 ⇒ alu_RS08 ] →
- bool with
- [ HC05 ⇒ eq_alu_HC05 | HC08 ⇒ eq_alu_HC08 | HCS08 ⇒ eq_alu_HC08 | RS08 ⇒ eq_alu_RS08 ]
- alu1 alu2) ⊗
-
- (* 2) confronto della memoria in [inf,inf+n] *)
- (forall_memory_ranged t chk1 chk2 mem1 mem2 addrl) ⊗
-
- (* 3) confronto del clik *)
- (eq_clk m clk1 clk2)
- ]].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/word16_lemmas.ma".
-include "freescale/opcode_base_lemmas1.ma".
-include "freescale/status.ma".
-include "freescale/option_lemmas.ma".
-include "freescale/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_instrmode y3 x3) ⊗ (eq_b8 y4 x4) ⊗ (eq_w16 y5 x5)) =
- ((eq_b8 x1 y1) ⊗ (eq_anyop ? x2 y2) ⊗ (eq_instrmode x3 y3) ⊗ (eq_b8 x4 y4) ⊗ (eq_w16 x5 y5)));
- nrewrite > (symmetric_eqb8 x1 y1);
- nrewrite > (symmetric_eqanyop ? x2 y2);
- nrewrite > (symmetric_eqinstrmode 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_instrmode 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 > (eqinstrmode_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 … H1)
- ##| ##3: nnormalize; #p; #H1; nelim (option_destruct_some_none … 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_instrmode 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_eqinstrmode 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 …) (refl_eq …)) (refl_eq …)).
-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 … = 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC05 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
- impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HC05_1 ≝
-[
- quadruple … (anyOP HC05 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_2 ≝
-[
- quadruple … (anyOP HC05 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_3 ≝
-[
- quadruple … (anyOP HC05 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_4 ≝
-[
- quadruple … (anyOP HC05 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_5 ≝
-[
- quadruple … (anyOP HC05 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_6 ≝
-[
- quadruple … (anyOP HC05 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_7 ≝
-[
- quadruple … (anyOP HC05 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_8 ≝
-[
- quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_9 ≝
-[
- quadruple … (anyOP HC05 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_10 ≝
-[
- quadruple … (anyOP HC05 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,xB〉
-; quadruple … (anyOP HC05 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉
-; quadruple … (anyOP HC05 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,xA〉
-; quadruple … (anyOP HC05 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC05_11 ≝
-[
- quadruple … (anyOP HC05 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_12 ≝
-[
- quadruple … (anyOP HC05 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_13 ≝
-[
- quadruple … (anyOP HC05 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_14 ≝
-[
- quadruple … (anyOP HC05 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_15 ≝
-[
- quadruple … (anyOP HC05 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_16 ≝
-[
- quadruple … (anyOP HC05 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_17 ≝
-[
- quadruple … (anyOP HC05 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_18 ≝
-[
- quadruple … (anyOP HC05 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC05_19 ≝
-[
- quadruple … (anyOP HC05 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x7〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_20 ≝
-[
- quadruple … (anyOP HC05 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_21 ≝
-[
- quadruple … (anyOP HC05 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_22 ≝
-[
- quadruple … (anyOP HC05 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_23 ≝
-[
- quadruple … (anyOP HC05 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_24 ≝
-[
- quadruple … (anyOP HC05 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_25 ≝
-[
- quadruple … (anyOP HC05 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_26 ≝
-[
- quadruple … (anyOP HC05 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_27 ≝
-[
- quadruple … (anyOP HC05 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_28 ≝
-[
- quadruple … (anyOP HC05 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_29 ≝
-[
- quadruple … (anyOP HC05 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_30 ≝
-[
- quadruple … (anyOP HC05 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_31 ≝
-[
- quadruple … (anyOP HC05 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05 ≝
- opcode_table_HC05_1 @ opcode_table_HC05_2 @ opcode_table_HC05_3 @ opcode_table_HC05_4 @
- opcode_table_HC05_5 @ opcode_table_HC05_6 @ opcode_table_HC05_7 @ opcode_table_HC05_8 @
- opcode_table_HC05_9 @ opcode_table_HC05_10 @ opcode_table_HC05_11 @ opcode_table_HC05_12 @
- opcode_table_HC05_13 @ opcode_table_HC05_14 @ opcode_table_HC05_15 @ opcode_table_HC05_16 @
- opcode_table_HC05_17 @ opcode_table_HC05_18 @ opcode_table_HC05_19 @ opcode_table_HC05_20 @
- opcode_table_HC05_21 @ opcode_table_HC05_22 @ opcode_table_HC05_23 @ opcode_table_HC05_24 @
- opcode_table_HC05_25 @ opcode_table_HC05_26 @ opcode_table_HC05_27 @ opcode_table_HC05_28 @
- opcode_table_HC05_29 @ opcode_table_HC05_30 @ opcode_table_HC05_31.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/table_HC05.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC05 *)
-(* ***************** *)
-
-(* HC05: opcode non implementati come da manuale *)
-ndefinition HC05_not_impl_byte ≝
- [〈x3,x1〉;〈x3,x2〉;〈x3,x5〉;〈x3,xB〉;〈x3,xE〉
- ;〈x4,x1〉;〈x4,x5〉;〈x4,xB〉;〈x4,xE〉
- ;〈x5,x1〉;〈x5,x2〉;〈x5,x5〉;〈x5,xB〉;〈x5,xE〉
- ;〈x6,x1〉;〈x6,x2〉;〈x6,x5〉;〈x6,xB〉;〈x6,xE〉
- ;〈x7,x1〉;〈x7,x2〉;〈x7,x5〉;〈x7,xB〉;〈x7,xE〉
- ;〈x8,x2〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,xE〉
- ;〈xA,x7〉;〈xA,xC〉;〈xA,xF〉
- ].
-
-nlemma ok_byte_table_HC05 : forall_byte8 (λb.
- (test_not_impl_byte b HC05_not_impl_byte ⊙ eq_nat (get_byte_count HC05 b 0 opcode_table_HC05) 1) ⊗
- (⊖ (test_not_impl_byte b HC05_not_impl_byte) ⊙ eq_nat (get_byte_count HC05 b 0 opcode_table_HC05) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC05: pseudocodici non implementati come da manuale *)
-ndefinition HC05_not_impl_pseudo ≝
- [ AIS ; AIX ; BGE ; BGND ; BGT ; BLE ; BLT ; CBEQA ; CBEQX ; CPHX ; DAA
- ; DBNZ ; DIV ; LDHX ; MOV ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX
- ; SHA ; SLA ; STHX ; TAP ; TPA ; TSX ; TXS ].
-
-nlemma ok_pseudo_table_HC05 : forall_opcode (λo.
- (test_not_impl_pseudo o HC05_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HC05 o 0 opcode_table_HC05)) ⊗
- (⊖ (test_not_impl_pseudo o HC05_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HC05 o 0 opcode_table_HC05) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC05: modalita' non implementate come da manuale *)
-ndefinition HC05_not_impl_mode ≝
- [ MODE_INHH ; MODE_SP1 ; MODE_SP2 ; MODE_DIR1_to_DIR1
- ; MODE_IMM1_to_DIR1 ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p
- ; MODE_INHA_and_IMM1 ; MODE_INHX_and_IMM1 ; MODE_IMM1_and_IMM1
- ; MODE_DIR1_and_IMM1 ; MODE_IX0_and_IMM1 ; MODE_IX0p_and_IMM1
- ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1
- ; MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HC05 : forall_instr_mode (λi.
- (test_not_impl_mode i HC05_not_impl_mode ⊙ le_nat 1 (get_mode_count HC05 i 0 opcode_table_HC05)) ⊗
- (⊖ (test_not_impl_mode i HC05_not_impl_mode) ⊙ eq_nat (get_mode_count HC05 i 0 opcode_table_HC05) 0))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HC05 :
- forall_instr_mode (λi:instr_mode.
- forall_opcode (λop:opcode.
- le_nat (get_OpIm_count HC05 (anyOP HC05 op) i 0 opcode_table_HC05) 1)) = true.
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC08 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
- impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HC08_1 ≝
-[
- quadruple … (anyOP HC08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ADC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_2 ≝
-[
- quadruple … (anyOP HC08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADD) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ADD) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_3 ≝
-[
- quadruple … (anyOP HC08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AND) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 AND) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_4 ≝
-[
- quadruple … (anyOP HC08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ASL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_5 ≝
-[
- quadruple … (anyOP HC08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ASR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_6 ≝
-[
- quadruple … (anyOP HC08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC08_7 ≝
-[
- quadruple … (anyOP HC08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_8 ≝
-[
- quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_9 ≝
-[
- quadruple … (anyOP HC08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 BIT) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BIT) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_10 ≝
-[
- quadruple … (anyOP HC08 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DIV ) MODE_INH (Byte 〈x5,x2〉) 〈x0,x7〉
-; quadruple … (anyOP HC08 NSA ) MODE_INH (Byte 〈x6,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DAA ) MODE_INH (Byte 〈x7,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x7〉
-; quadruple … (anyOP HC08 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,x9〉
-; quadruple … (anyOP HC08 TAP ) MODE_INH (Byte 〈x8,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TPA ) MODE_INH (Byte 〈x8,x5〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 PULA) MODE_INH (Byte 〈x8,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHA) MODE_INH (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PULX) MODE_INH (Byte 〈x8,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHX) MODE_INH (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PULH) MODE_INH (Byte 〈x8,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHH) MODE_INH (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TXS ) MODE_INH (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TSX ) MODE_INH (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC08_11 ≝
-[
- quadruple … (anyOP HC08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQA) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HC08_12 ≝
-[
- quadruple … (anyOP HC08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_13 ≝
-[
- quadruple … (anyOP HC08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CMP) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CMP) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_14 ≝
-[
- quadruple … (anyOP HC08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 COM) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_15 ≝
-[
- quadruple … (anyOP HC08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_16 ≝
-[
- quadruple … (anyOP HC08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CPX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CPX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_17 ≝
-[
- quadruple … (anyOP HC08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DBNZ) MODE_IX1_and_IMM1 (Byte 〈x6,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DBNZ) MODE_IX0_and_IMM1 (Byte 〈x7,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DBNZ) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HC08_18 ≝
-[
- quadruple … (anyOP HC08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DEC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_19 ≝
-[
- quadruple … (anyOP HC08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 EOR) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 EOR) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_20 ≝
-[
- quadruple … (anyOP HC08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 INC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_21 ≝
-[
- quadruple … (anyOP HC08 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC08_22 ≝
-[
- quadruple … (anyOP HC08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_23 ≝
-[
- quadruple … (anyOP HC08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 LDA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_24 ≝
-[
- quadruple … (anyOP HC08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 LDX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_25 ≝
-[
- quadruple … (anyOP HC08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LSR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_26 ≝
-[
- quadruple … (anyOP HC08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_27 ≝
-[
- quadruple … (anyOP HC08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 NEG) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_28 ≝
-[
- quadruple … (anyOP HC08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ORA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ORA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_29 ≝
-[
- quadruple … (anyOP HC08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ROL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_30 ≝
-[
- quadruple … (anyOP HC08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ROR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_31 ≝
-[
- quadruple … (anyOP HC08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SBC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 SBC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_32 ≝
-[
- quadruple … (anyOP HC08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 STA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_33 ≝
-[
- quadruple … (anyOP HC08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 STX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_34 ≝
-[
- quadruple … (anyOP HC08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SUB) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 SUB) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_35 ≝
-[
- quadruple … (anyOP HC08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TST) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08 ≝
-opcode_table_HC08_1 @ opcode_table_HC08_2 @ opcode_table_HC08_3 @ opcode_table_HC08_4 @
-opcode_table_HC08_5 @ opcode_table_HC08_6 @ opcode_table_HC08_7 @ opcode_table_HC08_8 @
-opcode_table_HC08_9 @ opcode_table_HC08_10 @ opcode_table_HC08_11 @ opcode_table_HC08_12 @
-opcode_table_HC08_13 @ opcode_table_HC08_14 @ opcode_table_HC08_15 @ opcode_table_HC08_16 @
-opcode_table_HC08_17 @ opcode_table_HC08_18 @ opcode_table_HC08_19 @ opcode_table_HC08_20 @
-opcode_table_HC08_21 @ opcode_table_HC08_22 @ opcode_table_HC08_23 @ opcode_table_HC08_24 @
-opcode_table_HC08_25 @ opcode_table_HC08_26 @ opcode_table_HC08_27 @ opcode_table_HC08_28 @
-opcode_table_HC08_29 @ opcode_table_HC08_30 @ opcode_table_HC08_31 @ opcode_table_HC08_32 @
-opcode_table_HC08_33 @ opcode_table_HC08_34 @ opcode_table_HC08_35.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/table_HC08.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC08 *)
-(* ***************** *)
-
-(* HC08: opcode non implementati come da manuale (byte) *)
-ndefinition HC08_not_impl_byte ≝
- [〈x3,x2〉;〈x3,xE〉
- ;〈x8,x2〉;〈x8,xD〉
- ;〈x9,x6〉;〈x9,xE〉
- ;〈xA,xC〉
- ].
-
-nlemma ok_byte_table_HC08 : forall_byte8 (λb.
- (test_not_impl_byte b HC08_not_impl_byte ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 1) ⊗
- (⊖ (test_not_impl_byte b HC08_not_impl_byte) ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: opcode non implementati come da manuale (0x9E+byte) *)
-ndefinition HC08_not_impl_word ≝
- [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
- ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
- ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
- ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
- ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
- ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
- ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
- ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
- ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
- ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
- ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
- ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
- ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
- ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
- ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
- ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
- ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
- ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
- ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉
- ;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xE〉;〈xA,xF〉
- ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉
- ;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xE〉;〈xB,xF〉
- ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉
- ;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xE〉;〈xC,xF〉
- ;〈xD,xC〉;〈xD,xD〉
- ;〈xE,xC〉;〈xE,xD〉
- ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x3〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉
- ;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉;〈xF,xE〉;〈xF,xF〉
- ].
-
-nlemma ok_word_table_HC08 : forall_byte8 (λb.
- (test_not_impl_byte b HC08_not_impl_word ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 1) ⊗
- (⊖ (test_not_impl_byte b HC08_not_impl_word) ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: pseudocodici non implementati come da manuale *)
-ndefinition HC08_not_impl_pseudo ≝
- [ BGND ; SHA ; SLA ].
-
-nlemma ok_pseudo_table_HC08 : forall_opcode (λo.
- (test_not_impl_pseudo o HC08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HC08 o 0 opcode_table_HC08)) ⊗
- (⊖ (test_not_impl_pseudo o HC08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HC08 o 0 opcode_table_HC08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: modalita' non implementate come da manuale *)
-ndefinition HC08_not_impl_mode ≝
- [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HC08 : forall_instr_mode (λi.
- (test_not_impl_mode i HC08_not_impl_mode ⊙ le_nat 1 (get_mode_count HC08 i 0 opcode_table_HC08)) ⊗
- (⊖ (test_not_impl_mode i HC08_not_impl_mode) ⊙ eq_nat (get_mode_count HC08 i 0 opcode_table_HC08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HC08 :
- forall_instr_mode (λi:instr_mode.
- forall_opcode (λop:opcode.
- le_nat (get_OpIm_count HC08 (anyOP HC08 op) i 0 opcode_table_HC08) 1)) = true.
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode.ma".
-
-(* ****************** *)
-(* TABELLA DELL'HCS08 *)
-(* ****************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
- impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HCS08_1 ≝
-[
- quadruple … (anyOP HCS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX2 (Byte 〈xD,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX1 (Byte 〈xE,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX0 (Byte 〈xF,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ADC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_2 ≝
-[
- quadruple … (anyOP HCS08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX2 (Byte 〈xD,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX1 (Byte 〈xE,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX0 (Byte 〈xF,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ADD) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_3 ≝
-[
- quadruple … (anyOP HCS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 AND) MODE_IX2 (Byte 〈xD,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 AND) MODE_IX1 (Byte 〈xE,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_IX0 (Byte 〈xF,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 AND) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_4 ≝
-[
- quadruple … (anyOP HCS08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASL) MODE_IX1 (Byte 〈x6,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASL) MODE_IX0 (Byte 〈x7,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ASL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_5 ≝
-[
- quadruple … (anyOP HCS08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASR) MODE_IX1 (Byte 〈x6,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASR) MODE_IX0 (Byte 〈x7,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ASR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_6 ≝
-[
- quadruple … (anyOP HCS08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HCS08_7 ≝
-[
- quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_8 ≝
-[
- quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_9 ≝
-[
- quadruple … (anyOP HCS08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX2 (Byte 〈xD,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX1 (Byte 〈xE,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX0 (Byte 〈xF,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BIT) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_10 ≝
-[
- quadruple … (anyOP HCS08 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DIV ) MODE_INH (Byte 〈x5,x2〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 NSA ) MODE_INH (Byte 〈x6,x2〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DAA ) MODE_INH (Byte 〈x7,x2〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉
-; quadruple … (anyOP HCS08 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,xB〉
-; quadruple … (anyOP HCS08 BGND) MODE_INH (Byte 〈x8,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 TAP ) MODE_INH (Byte 〈x8,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TPA ) MODE_INH (Byte 〈x8,x5〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 PULA) MODE_INH (Byte 〈x8,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHA) MODE_INH (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 PULX) MODE_INH (Byte 〈x8,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHX) MODE_INH (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 PULH) MODE_INH (Byte 〈x8,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHH) MODE_INH (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TXS ) MODE_INH (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TSX ) MODE_INH (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HCS08_11 ≝
-[
- quadruple … (anyOP HCS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_12 ≝
-[
- quadruple … (anyOP HCS08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_IX1 (Byte 〈x6,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CLR) MODE_IX0 (Byte 〈x7,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_13 ≝
-[
- quadruple … (anyOP HCS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX2 (Byte 〈xD,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX1 (Byte 〈xE,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX0 (Byte 〈xF,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CMP) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_14 ≝
-[
- quadruple … (anyOP HCS08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 COM) MODE_IX1 (Byte 〈x6,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 COM) MODE_IX0 (Byte 〈x7,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 COM) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_15 ≝
-[
- quadruple … (anyOP HCS08 CPHX) MODE_DIR2 (Byte 〈x3,xE〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CPHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,x3〉〉) 〈x0,x6〉
-
-; quadruple … (anyOP HCS08 LDHX) MODE_DIR2 (Byte 〈x3,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX0 (Word 〈〈x9,xE〉:〈xA,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX2 (Word 〈〈x9,xE〉:〈xB,xE〉〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX1 (Word 〈〈x9,xE〉:〈xC,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,xE〉〉) 〈x0,x5〉
-
-; quadruple … (anyOP HCS08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STHX) MODE_DIR2 (Byte 〈x9,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STHX) MODE_SP1 (Word 〈〈x9,xE〉:〈xF,xF〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_16 ≝
-[
- quadruple … (anyOP HCS08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX2 (Byte 〈xD,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX1 (Byte 〈xE,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX0 (Byte 〈xF,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CPX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_17 ≝
-[
- quadruple … (anyOP HCS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_IX1_and_IMM1 (Byte 〈x6,xB〉) 〈x0,x7〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_IX0_and_IMM1 (Byte 〈x7,xB〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_SP1_and_IMM1 (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x8〉
-].
-
-ndefinition opcode_table_HCS08_18 ≝
-[
- quadruple … (anyOP HCS08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DEC) MODE_IX1 (Byte 〈x6,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DEC) MODE_IX0 (Byte 〈x7,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DEC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_19 ≝
-[
- quadruple … (anyOP HCS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX2 (Byte 〈xD,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX1 (Byte 〈xE,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX0 (Byte 〈xF,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 EOR) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_20 ≝
-[
- quadruple … (anyOP HCS08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 INC) MODE_IX1 (Byte 〈x6,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 INC) MODE_IX0 (Byte 〈x7,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 INC) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_21 ≝
-[
- quadruple … (anyOP HCS08 JMP) MODE_IMM1EXT (Byte 〈xB,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 JMP) MODE_IMM2 (Byte 〈xC,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HCS08_22 ≝
-[
- quadruple … (anyOP HCS08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_IMM1EXT (Byte 〈xB,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_IMM2 (Byte 〈xC,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_23 ≝
-[
- quadruple … (anyOP HCS08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX2 (Byte 〈xD,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX1 (Byte 〈xE,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX0 (Byte 〈xF,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_24 ≝
-[
- quadruple … (anyOP HCS08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX2 (Byte 〈xD,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX1 (Byte 〈xE,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX0 (Byte 〈xF,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_25 ≝
-[
- quadruple … (anyOP HCS08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 LSR) MODE_IX1 (Byte 〈x6,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LSR) MODE_IX0 (Byte 〈x7,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LSR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_26 ≝
-[
- quadruple … (anyOP HCS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_27 ≝
-[
- quadruple … (anyOP HCS08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NEG) MODE_IX1 (Byte 〈x6,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 NEG) MODE_IX0 (Byte 〈x7,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 NEG) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_28 ≝
-[
- quadruple … (anyOP HCS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX2 (Byte 〈xD,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX1 (Byte 〈xE,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX0 (Byte 〈xF,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ORA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_29 ≝
-[
- quadruple … (anyOP HCS08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROL) MODE_IX1 (Byte 〈x6,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROL) MODE_IX0 (Byte 〈x7,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ROL) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_30 ≝
-[
- quadruple … (anyOP HCS08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROR) MODE_IX1 (Byte 〈x6,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROR) MODE_IX0 (Byte 〈x7,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ROR) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_31 ≝
-[
- quadruple … (anyOP HCS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX2 (Byte 〈xD,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX1 (Byte 〈xE,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX0 (Byte 〈xF,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 SBC) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_32 ≝
-[
- quadruple … (anyOP HCS08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STA) MODE_IX2 (Byte 〈xD,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STA) MODE_IX1 (Byte 〈xE,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STA) MODE_IX0 (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STA) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STA) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_33 ≝
-[
- quadruple … (anyOP HCS08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STX) MODE_IX2 (Byte 〈xD,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STX) MODE_IX1 (Byte 〈xE,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STX) MODE_IX0 (Byte 〈xF,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STX) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STX) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_34 ≝
-[
- quadruple … (anyOP HCS08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX2 (Byte 〈xD,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX1 (Byte 〈xE,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX0 (Byte 〈xF,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_SP2 (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 SUB) MODE_SP1 (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_35 ≝
-[
- quadruple … (anyOP HCS08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TST) MODE_IX1 (Byte 〈x6,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 TST) MODE_IX0 (Byte 〈x7,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 TST) MODE_SP1 (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08 ≝
-opcode_table_HCS08_1 @ opcode_table_HCS08_2 @ opcode_table_HCS08_3 @ opcode_table_HCS08_4 @
-opcode_table_HCS08_5 @ opcode_table_HCS08_6 @ opcode_table_HCS08_7 @ opcode_table_HCS08_8 @
-opcode_table_HCS08_9 @ opcode_table_HCS08_10 @ opcode_table_HCS08_11 @ opcode_table_HCS08_12 @
-opcode_table_HCS08_13 @ opcode_table_HCS08_14 @ opcode_table_HCS08_15 @ opcode_table_HCS08_16 @
-opcode_table_HCS08_17 @ opcode_table_HCS08_18 @ opcode_table_HCS08_19 @ opcode_table_HCS08_20 @
-opcode_table_HCS08_21 @ opcode_table_HCS08_22 @ opcode_table_HCS08_23 @ opcode_table_HCS08_24 @
-opcode_table_HCS08_25 @ opcode_table_HCS08_26 @ opcode_table_HCS08_27 @ opcode_table_HCS08_28 @
-opcode_table_HCS08_29 @ opcode_table_HCS08_30 @ opcode_table_HCS08_31 @ opcode_table_HCS08_32 @
-opcode_table_HCS08_33 @ opcode_table_HCS08_34 @ opcode_table_HCS08_35.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/table_HCS08.ma".
-
-(* ****************** *)
-(* TABELLA DELL'HCS08 *)
-(* ****************** *)
-
-(* HCS08: opcode non implementati come da manuale (byte) *)
-ndefinition HCS08_not_impl_byte ≝
- [〈x8,xD〉
- ;〈x9,xE〉
- ;〈xA,xC〉
- ].
-
-nlemma ok_byte_table_HCS08 : forall_byte8 (λb.
- (test_not_impl_byte b HCS08_not_impl_byte ⊙ eq_nat (get_byte_count HCS08 b 0 opcode_table_HCS08) 1) ⊗
- (⊖ (test_not_impl_byte b HCS08_not_impl_byte) ⊙ eq_nat (get_byte_count HCS08 b 0 opcode_table_HCS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: opcode non implementati come da manuale (0x9E+byte) *)
-ndefinition HCS08_not_impl_word ≝
- [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
- ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
- ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
- ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
- ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
- ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
- ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
- ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
- ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
- ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
- ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
- ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
- ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
- ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
- ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
- ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
- ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
- ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
- ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xF〉
- ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xF〉
- ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xF〉
- ;〈xD,xC〉;〈xD,xD〉
- ;〈xE,xC〉;〈xE,xD〉
- ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉
- ].
-
-nlemma ok_word_table_HCS08 : forall_byte8 (λb.
- (test_not_impl_byte b HCS08_not_impl_word ⊙ eq_nat (get_word_count HCS08 b 0 opcode_table_HCS08) 1) ⊗
- (⊖ (test_not_impl_byte b HCS08_not_impl_word) ⊙ eq_nat (get_word_count HCS08 b 0 opcode_table_HCS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: pseudocodici non implementati come da manuale *)
-ndefinition HCS08_not_impl_pseudo ≝
- [ SHA ; SLA ].
-
-nlemma ok_pseudo_table_HCS08 : forall_opcode (λo.
- (test_not_impl_pseudo o HCS08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count HCS08 o 0 opcode_table_HCS08)) ⊗
- (⊖ (test_not_impl_pseudo o HCS08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HCS08 o 0 opcode_table_HCS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: modalita' non implementate come da manuale *)
-ndefinition HCS08_not_impl_mode ≝
- [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HCS08 : forall_instr_mode (λi.
- (test_not_impl_mode i HCS08_not_impl_mode ⊙ le_nat 1 (get_mode_count HCS08 i 0 opcode_table_HCS08)) ⊗
- (⊖ (test_not_impl_mode i HCS08_not_impl_mode) ⊙ eq_nat (get_mode_count HCS08 i 0 opcode_table_HCS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HCS08 :
- forall_instr_mode (λi:instr_mode.
- forall_opcode (λop:opcode.
- le_nat (get_OpIm_count HCS08 (anyOP HCS08 op) i 0 opcode_table_HCS08) 1)) = true.
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'RS08 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
- impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_RS08_1 ≝
-[
- quadruple … (anyOP RS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_2 ≝
-[
- quadruple … (anyOP RS08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x0) (Byte 〈x6,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x1) (Byte 〈x6,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x2) (Byte 〈x6,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x3) (Byte 〈x6,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x4) (Byte 〈x6,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x5) (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x6) (Byte 〈x6,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x7) (Byte 〈x6,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x8) (Byte 〈x6,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x9) (Byte 〈x6,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xA) (Byte 〈x6,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xB) (Byte 〈x6,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xC) (Byte 〈x6,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xD) (Byte 〈x6,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xE) (Byte 〈x6,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xF) (Byte 〈x6,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_3 ≝
-[
- quadruple … (anyOP RS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_4 ≝
-[
- quadruple … (anyOP RS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_5 ≝
-[
- quadruple … (anyOP RS08 BRA) MODE_IMM1 (Byte 〈x3,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BCC) MODE_IMM1 (Byte 〈x3,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BCS) MODE_IMM1 (Byte 〈x3,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BNE) MODE_IMM1 (Byte 〈x3,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BEQ) MODE_IMM1 (Byte 〈x3,x7〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_6 ≝
-[
- quadruple … (anyOP RS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_7 ≝
-[
- quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_8 ≝
-[
- quadruple … (anyOP RS08 CLC ) MODE_INH (Byte 〈x3,x8〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SEC ) MODE_INH (Byte 〈x3,x9〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SLA ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SHA ) MODE_INH (Byte 〈x4,x5〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 NOP ) MODE_INH (Byte 〈xA,xC〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 STOP) MODE_INH (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 WAIT) MODE_INH (Byte 〈xA,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 RTS ) MODE_INH (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BGND) MODE_INH (Byte 〈xB,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_9 ≝
-[
- quadruple … (anyOP RS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_10 ≝
-[
- quadruple … (anyOP RS08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t00) (Byte 〈x8,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t01) (Byte 〈x8,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t02) (Byte 〈x8,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t03) (Byte 〈x8,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t04) (Byte 〈x8,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t05) (Byte 〈x8,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t06) (Byte 〈x8,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t07) (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t08) (Byte 〈x8,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t09) (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0A) (Byte 〈x8,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0B) (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0C) (Byte 〈x8,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0D) (Byte 〈x8,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0E) (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0F) (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t10) (Byte 〈x9,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t11) (Byte 〈x9,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t12) (Byte 〈x9,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t13) (Byte 〈x9,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t14) (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t15) (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t16) (Byte 〈x9,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t17) (Byte 〈x9,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t18) (Byte 〈x9,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t19) (Byte 〈x9,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1A) (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1B) (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1C) (Byte 〈x9,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1D) (Byte 〈x9,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1E) (Byte 〈x9,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1F) (Byte 〈x9,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_RS08_11 ≝
-[
- quadruple … (anyOP RS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_12 ≝
-[
- quadruple … (anyOP RS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_13 ≝
-[
- quadruple … (anyOP RS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
-; quadruple … (anyOP RS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_14 ≝
-[
- quadruple … (anyOP RS08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x0) (Byte 〈x5,x0〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x1) (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x2) (Byte 〈x5,x2〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x3) (Byte 〈x5,x3〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x4) (Byte 〈x5,x4〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x5) (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x6) (Byte 〈x5,x6〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x7) (Byte 〈x5,x7〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x8) (Byte 〈x5,x8〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x9) (Byte 〈x5,x9〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xA) (Byte 〈x5,xA〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xB) (Byte 〈x5,xB〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xC) (Byte 〈x5,xC〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xD) (Byte 〈x5,xD〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xE) (Byte 〈x5,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xF) (Byte 〈x5,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_15 ≝
-[
- quadruple … (anyOP RS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_16 ≝
-[
- quadruple … (anyOP RS08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x0) (Byte 〈x2,x0〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x1) (Byte 〈x2,x1〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x2) (Byte 〈x2,x2〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x3) (Byte 〈x2,x3〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x4) (Byte 〈x2,x4〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x5) (Byte 〈x2,x5〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x6) (Byte 〈x2,x6〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x7) (Byte 〈x2,x7〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x8) (Byte 〈x2,x8〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x9) (Byte 〈x2,x9〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xA) (Byte 〈x2,xA〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xB) (Byte 〈x2,xB〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xC) (Byte 〈x2,xC〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xD) (Byte 〈x2,xD〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xE) (Byte 〈x2,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xF) (Byte 〈x2,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_17 ≝
-[
- quadruple … (anyOP RS08 JMP) MODE_IMM2 (Byte 〈xB,xC〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_18 ≝
-[
- quadruple … (anyOP RS08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 JSR) MODE_IMM2 (Byte 〈xB,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_19 ≝
-[
- quadruple … (anyOP RS08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t00) (Byte 〈xC,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t01) (Byte 〈xC,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t02) (Byte 〈xC,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t03) (Byte 〈xC,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t04) (Byte 〈xC,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t05) (Byte 〈xC,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t06) (Byte 〈xC,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t07) (Byte 〈xC,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t08) (Byte 〈xC,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t09) (Byte 〈xC,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0A) (Byte 〈xC,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0B) (Byte 〈xC,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0C) (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0D) (Byte 〈xC,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0E) (Byte 〈xC,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0F) (Byte 〈xC,xF〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t10) (Byte 〈xD,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t11) (Byte 〈xD,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t12) (Byte 〈xD,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t13) (Byte 〈xD,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t14) (Byte 〈xD,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t15) (Byte 〈xD,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t16) (Byte 〈xD,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t17) (Byte 〈xD,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t18) (Byte 〈xD,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t19) (Byte 〈xD,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1A) (Byte 〈xD,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1B) (Byte 〈xD,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1C) (Byte 〈xD,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1D) (Byte 〈xD,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1E) (Byte 〈xD,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1F) (Byte 〈xD,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_20 ≝
-[
- quadruple … (anyOP RS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_21 ≝
-[
- quadruple … (anyOP RS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x3,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_22 ≝
-[
- quadruple … (anyOP RS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_23 ≝
-[
- quadruple … (anyOP RS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_24 ≝
-[
- quadruple … (anyOP RS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_25 ≝
-[
- quadruple … (anyOP RS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_26 ≝
-[
- quadruple … (anyOP RS08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t00) (Byte 〈xE,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t01) (Byte 〈xE,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t02) (Byte 〈xE,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t03) (Byte 〈xE,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t04) (Byte 〈xE,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t05) (Byte 〈xE,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t06) (Byte 〈xE,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t07) (Byte 〈xE,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t08) (Byte 〈xE,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t09) (Byte 〈xE,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0A) (Byte 〈xE,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0B) (Byte 〈xE,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0C) (Byte 〈xE,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0D) (Byte 〈xE,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0E) (Byte 〈xE,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0F) (Byte 〈xE,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t10) (Byte 〈xF,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t11) (Byte 〈xF,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t12) (Byte 〈xF,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t13) (Byte 〈xF,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t14) (Byte 〈xF,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t15) (Byte 〈xF,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t16) (Byte 〈xF,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t17) (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t18) (Byte 〈xF,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t19) (Byte 〈xF,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1A) (Byte 〈xF,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1B) (Byte 〈xF,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1C) (Byte 〈xF,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1D) (Byte 〈xF,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1E) (Byte 〈xF,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1F) (Byte 〈xF,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_RS08_27 ≝
-[
- quadruple … (anyOP RS08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x0) (Byte 〈x7,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x1) (Byte 〈x7,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x2) (Byte 〈x7,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x3) (Byte 〈x7,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x4) (Byte 〈x7,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x5) (Byte 〈x7,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x6) (Byte 〈x7,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x7) (Byte 〈x7,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x8) (Byte 〈x7,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x9) (Byte 〈x7,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xA) (Byte 〈x7,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xB) (Byte 〈x7,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xC) (Byte 〈x7,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xD) (Byte 〈x7,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xE) (Byte 〈x7,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xF) (Byte 〈x7,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08 ≝
-opcode_table_RS08_1 @ opcode_table_RS08_2 @ opcode_table_RS08_3 @ opcode_table_RS08_4 @
-opcode_table_RS08_5 @ opcode_table_RS08_6 @ opcode_table_RS08_7 @ opcode_table_RS08_8 @
-opcode_table_RS08_9 @ opcode_table_RS08_10 @ opcode_table_RS08_11 @ opcode_table_RS08_12 @
-opcode_table_RS08_13 @ opcode_table_RS08_14 @ opcode_table_RS08_15 @ opcode_table_RS08_16 @
-opcode_table_RS08_17 @ opcode_table_RS08_18 @ opcode_table_RS08_19 @ opcode_table_RS08_20 @
-opcode_table_RS08_21 @ opcode_table_RS08_22 @ opcode_table_RS08_23 @ opcode_table_RS08_24 @
-opcode_table_RS08_25 @ opcode_table_RS08_26 @ opcode_table_RS08_27.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/table_RS08.ma".
-
-(* ***************** *)
-(* TABELLA DELL'RS08 *)
-(* ***************** *)
-
-(* RS08: opcode non implementati come da manuale *)
-ndefinition RS08_not_impl_byte ≝
- [〈x3,x2〉;〈x3,x3〉;〈x3,xD〉
- ;〈x4,x0〉;〈x4,x7〉;〈x4,xD〉
- ;〈xA,x3〉;〈xA,x5〉;〈xA,x7〉
- ;〈xB,x3〉;〈xB,x5〉
- ].
-
-nlemma ok_byte_table_RS08 : forall_byte8 (λb.
- (test_not_impl_byte b RS08_not_impl_byte ⊙ eq_nat (get_byte_count RS08 b 0 opcode_table_RS08) 1) ⊗
- (⊖ (test_not_impl_byte b RS08_not_impl_byte) ⊙ eq_nat (get_byte_count RS08 b 0 opcode_table_RS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* RS08: pseudocodici non implementati come da manuale *)
-ndefinition RS08_not_impl_pseudo ≝
- [ AIS ; AIX ; ASR ; BGE ; BGT ; BHCC ; BHCS ; BHI ; BIH ; BIL ; BIT ; BLE ; BLS
- ; BLT ; BMC ; BMI ; BMS ; BPL ; BRN ; CBEQX ; CLI ; CPHX ; CPX ; DAA ; DIV
- ; LDHX ; LDX ; MUL ; NEG ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX ; RSP
- ; RTI ; SEI ; STHX ; STX ; SWI ; TAP ; TAX ; TPA ; TST ; TSX ; TXA ; TXS ].
-
-nlemma ok_pseudo_table_RS08 : forall_opcode (λo.
- (test_not_impl_pseudo o RS08_not_impl_pseudo ⊙ le_nat 1 (get_pseudo_count RS08 o 0 opcode_table_RS08)) ⊗
- (⊖ (test_not_impl_pseudo o RS08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count RS08 o 0 opcode_table_RS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-(* RS08: modalita' non implementate come da manuale *)
-ndefinition RS08_not_impl_mode ≝
- [ MODE_INHX ; MODE_INHH ; MODE_INHX0ADD ; MODE_INHX1ADD ; MODE_INHX2ADD ; MODE_IMM1EXT
- ; MODE_DIR2 ; MODE_IX0 ; MODE_IX1 ; MODE_IX2 ; MODE_SP1 ; MODE_SP2
- ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p ; MODE_INHX_and_IMM1 ; MODE_IX0_and_IMM1
- ; MODE_IX0p_and_IMM1 ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1 ].
-
-nlemma ok_mode_table_RS08 : forall_instr_mode (λi.
- (test_not_impl_mode i RS08_not_impl_mode ⊙ le_nat 1 (get_mode_count RS08 i 0 opcode_table_RS08)) ⊗
- (⊖ (test_not_impl_mode i RS08_not_impl_mode) ⊙ eq_nat (get_mode_count RS08 i 0 opcode_table_RS08) 0))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_RS08 :
- forall_instr_mode (λi:instr_mode.
- forall_opcode (λop:opcode.
- le_nat (get_OpIm_count RS08 (anyOP RS08 op) i 0 opcode_table_RS08) 1)) = true.
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| A.Asperti, C.Sacerdoti Coen, *)
-(* ||A|| E.Tassi, S.Zacchiroli *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU Lesser General Public License Version 2.1 *)
-(* *)
-(**************************************************************************)
-
-(* ********************************************************************** *)
-(* Progetto FreeScale *)
-(* *)
-(* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
-(* Cosimo Oliboni, oliboni@cs.unibo.it *)
-(* *)
-(* ********************************************************************** *)
-
-include "freescale/pts.ma".
-
-(* ********************************** *)
-(* SOTTOINSIEME MINIMALE DELLA TEORIA *)
-(* ********************************** *)
-
-(* logic/connectives.ma *)
-
-ninductive True: Prop ≝
- I : True.
-
-ninductive False: Prop ≝.
-
-ndefinition Not: Prop → Prop ≝
-λA.(A → False).
-
-interpretation "logical not" 'not x = (Not x).
-
-nlemma absurd : ∀A,C:Prop.A → ¬A → C.
- #A; #C; #H;
- nnormalize;
- #H1;
- nelim (H1 H);
-nqed.
-
-nlemma not_to_not : ∀A,B:Prop. (A → B) → ¬B →¬A.
- #A; #B; #H;
- nnormalize;
- #H1; #H2;
- nelim (H1 (H H2)).
-nqed.
-
-ninductive And (A,B:Prop) : Prop ≝
- conj : A → B → (And A B).
-
-interpretation "logical and" 'and x y = (And x y).
-
-nlemma proj1: ∀A,B:Prop.A ∧ B → A.
- #A; #B; #H;
- (* \ldots al posto di ??? *)
- napply (And_ind A B … H);
- #H1; #H2;
- napply H1.
-nqed.
-
-nlemma proj2: ∀A,B:Prop.A ∧ B → B.
- #A; #B; #H;
- napply (And_ind A B … H);
- #H1; #H2;
- napply H2.
-nqed.
-
-ninductive Or (A,B:Prop) : Prop ≝
- or_introl : A → (Or A B)
-| or_intror : B → (Or A B).
-
-interpretation "logical or" 'or x y = (Or x y).
-
-ndefinition decidable : Prop → Prop ≝ λA:Prop.A ∨ ¬A.
-
-ninductive ex (A:Type) (Q:A → Prop) : Prop ≝
- ex_intro: ∀x:A.Q x → ex A Q.
-
-interpretation "exists" 'exists x = (ex ? x).
-
-ninductive ex2 (A:Type) (Q,R:A → Prop) : Prop ≝
- ex_intro2: ∀x:A.Q x → R x → ex2 A Q R.
-
-ndefinition iff ≝
-λA,B.(A → B) ∧ (B → A).
-
-(* higher_order_defs/relations *)
-
-ndefinition relation : Type → Type ≝
-λA:Type.A → A → Prop.
-
-ndefinition reflexive : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x:A.R x x.
-
-ndefinition symmetric : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x,y:A.R x y → R y x.
-
-ndefinition transitive : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x,y,z:A.R x y → R y z → R x z.
-
-ndefinition irreflexive : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x:A.¬ (R x x).
-
-ndefinition cotransitive : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x,y:A.R x y → ∀z:A. R x z ∨ R z y.
-
-ndefinition tight_apart : ∀A:Type.∀eq,ap:relation A.Prop ≝
-λA.λeq,ap.∀x,y:A. (¬ (ap x y) → eq x y) ∧ (eq x y → ¬ (ap x y)).
-
-ndefinition antisymmetric : ∀A:Type.∀R:relation A.Prop ≝
-λA.λR.∀x,y:A.R x y → ¬ (R y x).
-
-(* logic/equality.ma *)
-
-ninductive eq (A:Type) (x:A) : A → Prop ≝
- refl_eq : eq A x x.
-
-interpretation "leibnitz's equality" 'eq t x y = (eq t x y).
-
-interpretation "leibnitz's non-equality" 'neq t x y = (Not (eq t x y)).
-
-nlemma symmetric_eq: ∀A:Type. symmetric A (eq A).
- #A;
- nnormalize;
- #x; #y; #H;
- nrewrite < H;
- napply refl_eq.
-nqed.
-
-nlemma eq_elim_r: ∀A:Type.∀x:A.∀P:A → Prop.P x → ∀y:A.y=x → P y.
- #A; #x; #P; #H; #y; #H1;
- nrewrite < (symmetric_eq … H1);
- napply H.
-nqed.
-
-ndefinition relationT : Type → Type → Type ≝
-λA,T:Type.A → A → T.
-
-ndefinition symmetricT: ∀A,T:Type.∀R:relationT A T.Prop ≝
-λA,T.λR.∀x,y:A.R x y = R y x.
-
-ndefinition associative : ∀A:Type.∀R:relationT A A.Prop ≝
-λA.λR.∀x,y,z:A.R (R x y) z = R x (R y z).
-
-(* list/list.ma *)
-
-ninductive list (A:Type) : Type ≝
- nil: list A
-| cons: A → list A → list A.
-
-nlet rec append A (l1: list A) l2 on l1 ≝
- match l1 with
- [ nil ⇒ l2
- | (cons hd tl) ⇒ cons A hd (append A tl l2) ].
-
-notation "hvbox(hd break :: tl)"
- right associative with precedence 47
- for @{'cons $hd $tl}.
-
-notation "[ list0 x sep ; ]"
- non associative with precedence 90
- for ${fold right @'nil rec acc @{'cons $x $acc}}.
-
-notation "hvbox(l1 break @ l2)"
- right associative with precedence 47
- for @{'append $l1 $l2 }.
-
-interpretation "nil" 'nil = (nil ?).
-interpretation "cons" 'cons hd tl = (cons ? hd tl).
-interpretation "append" 'append l1 l2 = (append ? l1 l2).
-
-nlemma list_destruct_1 : ∀T.∀x1,x2:T.∀y1,y2:list T.cons T x1 y1 = cons T x2 y2 → x1 = x2.
- #T; #x1; #x2; #y1; #y2; #H;
- nchange with (match cons T x2 y2 with [ nil ⇒ False | cons a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma list_destruct_2 : ∀T.∀x1,x2:T.∀y1,y2:list T.cons T x1 y1 = cons T x2 y2 → y1 = y2.
- #T; #x1; #x2; #y1; #y2; #H;
- nchange with (match cons T x2 y2 with [ nil ⇒ False | cons _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma list_destruct_cons_nil : ∀T.∀x:T.∀y:list T.cons T x y = nil T → False.
- #T; #x; #y; #H;
- nchange with (match cons T x y with [ nil ⇒ True | cons a b ⇒ False ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma list_destruct_nil_cons : ∀T.∀x:T.∀y:list T.nil T = cons T x y → False.
- #T; #x; #y; #H;
- nchange with (match cons T x y with [ nil ⇒ True | cons a b ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma append_nil : ∀T:Type.∀l:list T.(l@[]) = l.
- #T; #l;
- nelim l;
- nnormalize;
- ##[ ##1: napply refl_eq
- ##| ##2: #x; #y; #H;
- nrewrite > H;
- napply refl_eq
- ##]
-nqed.
-
-nlemma associative_list : ∀T.associative (list T) (append T).
- #T; #x; #y; #z;
- nelim x;
- nnormalize;
- ##[ ##1: napply refl_eq
- ##| ##2: #a; #b; #H;
- nrewrite > H;
- napply refl_eq
- ##]
-nqed.
-
-nlemma cons_append_commute : ∀T:Type.∀l1,l2:list T.∀a:T.a :: (l1 @ l2) = (a :: l1) @ l2.
- #T; #l1; #l2; #a;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma append_cons_commute : ∀T:Type.∀a:T.∀l,l1:list T.l @ (a::l1) = (l@[a]) @ l1.
- #T; #a; #l; #l1;
- nrewrite > (associative_list T l [a] l1);
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/table_HC05.ma".
-include "freescale/table_HC08.ma".
-include "freescale/table_HCS08.ma".
-include "freescale/table_RS08.ma".
-include "freescale/option.ma".
-
-(* ***************************** *)
-(* TRADUZIONE ESADECIMALE → INFO *)
-(* ***************************** *)
-
-(* accesso alla tabella della ALU prescelta *)
-ndefinition opcode_table ≝
-λm:mcu_type.
- match m
- return λm:mcu_type.list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)
- with
- [ HC05 ⇒ opcode_table_HC05
- | HC08 ⇒ opcode_table_HC08
- | HCS08 ⇒ opcode_table_HCS08
- | RS08 ⇒ opcode_table_RS08
- ].
-
-(* traduzione mcu+esadecimale → info *)
-(* NB: la ricerca per byte non matcha con una word con lo stesso byte superiore uguale *)
-(* NB: per matchare una word (precode+code) bisogna passare una word *)
-(* NB: il risultato e' sempre un'opzione, NON esiste un dummy opcode tipo UNKNOWN/ILLEGAL *)
-nlet rec full_info_of_word16_aux (m:mcu_type) (borw:byte8_or_word16)
- (param:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on param ≝
- match param with
- [ nil ⇒ None ?
- | cons hd tl ⇒
- match thd4T … hd with
- [ Byte b ⇒ match borw with
- [ Byte borw' ⇒ match eq_b8 borw' b with
- [ true ⇒ Some ? hd
- | false ⇒ full_info_of_word16_aux m borw tl ]
- | Word _ ⇒ full_info_of_word16_aux m borw tl ]
- | Word w ⇒ match borw with
- [ Byte _ ⇒ full_info_of_word16_aux m borw tl
- | Word borw' ⇒ match eq_w16 borw' w with
- [ true ⇒ Some ? hd
- | false ⇒ full_info_of_word16_aux m borw tl ]
- ]]].
-
-ndefinition full_info_of_word16 ≝
-λm:mcu_type.λborw:byte8_or_word16.
-full_info_of_word16_aux m borw (opcode_table m).
-
-(* ******************************************************* *)
-(* TRADUZIONE MCU+OPCODE+MODALITA'+ARGOMENTI → ESADECIMALE *)
-(* ******************************************************* *)
-
-(* introduzione di un tipo byte8 dipendente dall'mcu_type (phantom type) *)
-ninductive t_byte8 (m:mcu_type) : Type ≝
- TByte : byte8 → t_byte8 m.
-
-nlemma tbyte8_destruct : ∀m,b1,b2.TByte m b1 = TByte m b2 → b1 = b2.
- #m; #b1; #b2; #H;
- nchange with (match TByte m b2 with [ TByte a ⇒ b1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-(* introduzione di un tipo dipendente (dalla modalita') per gli argomenti *)
-ninductive MA_check : instr_mode → Type ≝
- maINH : MA_check MODE_INH
-| maINHA : MA_check MODE_INHA
-| maINHX : MA_check MODE_INHX
-| maINHH : MA_check MODE_INHH
-| maINHX0ADD : MA_check MODE_INHX0ADD
-| maINHX1ADD : byte8 → MA_check MODE_INHX1ADD
-| maINHX2ADD : word16 → MA_check MODE_INHX2ADD
-| maIMM1 : byte8 → MA_check MODE_IMM1
-| maIMM1EXT : byte8 → MA_check MODE_IMM1EXT
-| maIMM2 : word16 → MA_check MODE_IMM2
-| maDIR1 : byte8 → MA_check MODE_DIR1
-| maDIR2 : word16 → MA_check MODE_DIR2
-| maIX0 : MA_check MODE_IX0
-| maIX1 : byte8 → MA_check MODE_IX1
-| maIX2 : word16 → MA_check MODE_IX2
-| maSP1 : byte8 → MA_check MODE_SP1
-| maSP2 : word16 → MA_check MODE_SP2
-| maDIR1_to_DIR1 : byte8 → byte8 → MA_check MODE_DIR1_to_DIR1
-| maIMM1_to_DIR1 : byte8 → byte8 → MA_check MODE_IMM1_to_DIR1
-| maIX0p_to_DIR1 : byte8 → MA_check MODE_IX0p_to_DIR1
-| maDIR1_to_IX0p : byte8 → MA_check MODE_DIR1_to_IX0p
-| maINHA_and_IMM1 : byte8 → MA_check MODE_INHA_and_IMM1
-| maINHX_and_IMM1 : byte8 → MA_check MODE_INHX_and_IMM1
-| maIMM1_and_IMM1 : byte8 → byte8 → MA_check MODE_IMM1_and_IMM1
-| maDIR1_and_IMM1 : byte8 → byte8 → MA_check MODE_DIR1_and_IMM1
-| maIX0_and_IMM1 : byte8 → MA_check MODE_IX0_and_IMM1
-| maIX0p_and_IMM1 : byte8 → MA_check MODE_IX0p_and_IMM1
-| maIX1_and_IMM1 : byte8 → byte8 → MA_check MODE_IX1_and_IMM1
-| maIX1p_and_IMM1 : byte8 → byte8 → MA_check MODE_IX1p_and_IMM1
-| maSP1_and_IMM1 : byte8 → byte8 → MA_check MODE_SP1_and_IMM1
-| maDIRn : ∀n.byte8 → MA_check (MODE_DIRn n)
-| maDIRn_and_IMM1 : ∀n.byte8 → byte8 → MA_check (MODE_DIRn_and_IMM1 n)
-| maTNY : ∀e.MA_check (MODE_TNY e)
-| maSRT : ∀t.MA_check (MODE_SRT t)
-.
-
-(* picker: trasforma l'argomento necessario in input a bytes_of_pseudo_instr_mode_param:
- MA_check i → list (t_byte8 m) *)
-ndefinition args_picker ≝
-λm:mcu_type.λi:instr_mode.λargs:MA_check i.
- match args with
- (* inherent: legale se nessun operando *)
- [ maINH ⇒ nil ?
- | maINHA ⇒ nil ?
- | maINHX ⇒ nil ?
- | maINHH ⇒ nil ?
- (* inherent address: legale se nessun operando/1 byte/1 word *)
- | maINHX0ADD ⇒ nil ?
- | maINHX1ADD b ⇒ [ TByte m b ]
- | maINHX2ADD w ⇒ [ TByte m (w16h w); TByte m (w16l w) ]
- (* _0/1/2: legale se nessun operando/1 byte/1 word *)
- | maIMM1 b ⇒ [ TByte m b ]
- | maIMM1EXT b ⇒ [ TByte m b ]
- | maIMM2 w ⇒ [ TByte m (w16h w); TByte m (w16l w) ]
- | maDIR1 b ⇒ [ TByte m b ]
- | maDIR2 w ⇒ [ TByte m (w16h w); TByte m (w16l w) ]
- | maIX0 ⇒ nil ?
- | maIX1 b ⇒ [ TByte m b ]
- | maIX2 w ⇒ [ TByte m (w16h w); TByte m (w16l w) ]
- | maSP1 b ⇒ [ TByte m b ]
- | maSP2 w ⇒ [ TByte m (w16h w); TByte m (w16l w) ]
- (* movimento: legale se 2 operandi byte *)
- | maDIR1_to_DIR1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maIMM1_to_DIR1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maIX0p_to_DIR1 b ⇒ [ TByte m b]
- | maDIR1_to_IX0p b ⇒ [ TByte m b]
- (* cbeq/dbnz: legale se 1/2 operandi byte *)
- | maINHA_and_IMM1 b ⇒ [ TByte m b]
- | maINHX_and_IMM1 b ⇒ [ TByte m b]
- | maIMM1_and_IMM1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maDIR1_and_IMM1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maIX0_and_IMM1 b ⇒ [ TByte m b]
- | maIX0p_and_IMM1 b ⇒ [ TByte m b]
- | maIX1_and_IMM1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maIX1p_and_IMM1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- | maSP1_and_IMM1 b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- (* DIRn: legale se 1 operando byte *)
- | maDIRn _ b ⇒ [ TByte m b]
- (* DIRn_and_IMM1: legale se 2 operandi byte *)
- | maDIRn_and_IMM1 _ b1 b2 ⇒ [ TByte m b1 ; TByte m b2 ]
- (* TNY: legale se nessun operando *)
- | maTNY _ ⇒ nil ?
- (* SRT: legale se nessun operando *)
- | maSRT _ ⇒ nil ?
- ].
-
-(* trasformatore finale: mcu+opcode+instr_mode+args → list (t_byte8 m) *)
-nlet rec bytes_of_pseudo_instr_mode_param_aux (m:mcu_type) (o:any_opcode m) (i:instr_mode) (p:MA_check i)
- (param:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on param ≝
- match param with
- [ nil ⇒ None ? | cons hd tl ⇒
- match (eq_anyop m o (fst4T … hd)) ⊗ (eq_instrmode i (snd4T … hd)) with
- [ true ⇒ match thd4T … hd with
- [ Byte isab ⇒
- Some ? ([ (TByte m isab) ]@(args_picker m i p))
- | Word isaw ⇒
- Some ? ([ (TByte m (w16h isaw)) ; (TByte m (w16l isaw)) ]@(args_picker m i p))
- ]
- | false ⇒ bytes_of_pseudo_instr_mode_param_aux m o i p tl ]].
-
-ndefinition bytes_of_pseudo_instr_mode_param ≝
-λm:mcu_type.λo:any_opcode m.λi:instr_mode.λp:MA_check i.
-bytes_of_pseudo_instr_mode_param_aux m o i p (opcode_table m).
-
-(* ****************************** *)
-(* APPROCCIO COMPILAZIONE AL VOLO *)
-(* ****************************** *)
-
-(* ausiliario di compile *)
-ndefinition defined_option ≝
- λT:Type.λo:option T.
- match o with
- [ None ⇒ False
- | Some _ ⇒ True
- ].
-
-(* compila solo se l'intera istruzione+modalita'+argomenti ha riscontro nelle tabelle *)
-ndefinition compile ≝
-λmcu:mcu_type.λi:instr_mode.λop:opcode.λarg:MA_check i.
- match bytes_of_pseudo_instr_mode_param mcu (anyOP mcu op) i arg
- return λres:option ?.defined_option ? res → ?
- with
- [ None ⇒ λp:defined_option ? (None ?).False_rect_Type0 ? p
- | Some x ⇒ λp:defined_option ? (Some ? x).x
- ].
-
-(* detipatore del compilato: (t_byte8 m) → byte8 *)
-nlet rec source_to_byte8_HC05_aux (p1:list (t_byte8 HC05)) (p2:list byte8) ≝
- match p1 with
- [ nil ⇒ p2
- | cons hd tl ⇒ match hd with [ TByte b ⇒ source_to_byte8_HC05_aux tl (p2@[b]) ]
- ].
-
-nlet rec source_to_byte8_HC08_aux (p1:list (t_byte8 HC08)) (p2:list byte8) ≝
- match p1 with
- [ nil ⇒ p2
- | cons hd tl ⇒ match hd with [ TByte b ⇒ source_to_byte8_HC08_aux tl (p2@[b]) ]
- ].
-
-nlet rec source_to_byte8_HCS08_aux (p1:list (t_byte8 HCS08)) (p2:list byte8) ≝
- match p1 with
- [ nil ⇒ p2
- | cons hd tl ⇒ match hd with [ TByte b ⇒ source_to_byte8_HCS08_aux tl (p2@[b]) ]
- ].
-
-nlet rec source_to_byte8_RS08_aux (p1:list (t_byte8 RS08)) (p2:list byte8) ≝
- match p1 with
- [ nil ⇒ p2
- | cons hd tl ⇒ match hd with [ TByte b ⇒ source_to_byte8_RS08_aux tl (p2@[b]) ]
- ].
-
-ndefinition source_to_byte8 ≝
-λm:mcu_type.
- match m
- return λm:mcu_type.list (t_byte8 m) → list byte8
- with
- [ HC05 ⇒ λl:list (t_byte8 HC05).source_to_byte8_HC05_aux l []
- | HC08 ⇒ λl:list (t_byte8 HC08).source_to_byte8_HC08_aux l []
- | HCS08 ⇒ λl:list (t_byte8 HCS08).source_to_byte8_HCS08_aux l []
- | RS08 ⇒ λl:list (t_byte8 RS08).source_to_byte8_RS08_aux l []
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/byte8.ma".
-
-(* **** *)
-(* WORD *)
-(* **** *)
-
-nrecord word16 : Type ≝
- {
- w16h: byte8;
- w16l: byte8
- }.
-
-(* \langle \rangle *)
-notation "〈x:y〉" non associative with precedence 80
- for @{ 'mk_word16 $x $y }.
-interpretation "mk_word16" 'mk_word16 x y = (mk_word16 x y).
-
-(* operatore = *)
-ndefinition eq_w16 ≝ λw1,w2.(eq_b8 (w16h w1) (w16h w2)) ⊗ (eq_b8 (w16l w1) (w16l w2)).
-
-(* operatore < *)
-ndefinition lt_w16 ≝
-λw1,w2:word16.match lt_b8 (w16h w1) (w16h w2) with
- [ true ⇒ true
- | false ⇒ match gt_b8 (w16h w1) (w16h w2) with
- [ true ⇒ false
- | false ⇒ lt_b8 (w16l w1) (w16l w2) ]].
-
-(* operatore ≤ *)
-ndefinition le_w16 ≝ λw1,w2:word16.(eq_w16 w1 w2) ⊕ (lt_w16 w1 w2).
-
-(* operatore > *)
-ndefinition gt_w16 ≝ λw1,w2:word16.⊖ (le_w16 w1 w2).
-
-(* operatore ≥ *)
-ndefinition ge_w16 ≝ λw1,w2:word16.⊖ (lt_w16 w1 w2).
-
-(* operatore and *)
-ndefinition and_w16 ≝
-λw1,w2:word16.mk_word16 (and_b8 (w16h w1) (w16h w2)) (and_b8 (w16l w1) (w16l w2)).
-
-(* operatore or *)
-ndefinition or_w16 ≝
-λw1,w2:word16.mk_word16 (or_b8 (w16h w1) (w16h w2)) (or_b8 (w16l w1) (w16l w2)).
-
-(* operatore xor *)
-ndefinition xor_w16 ≝
-λw1,w2:word16.mk_word16 (xor_b8 (w16h w1) (w16h w2)) (xor_b8 (w16l w1) (w16l w2)).
-
-(* operatore rotazione destra con carry *)
-ndefinition rcr_w16 ≝
-λw:word16.λc:bool.match rcr_b8 (w16h w) c with
- [ pair wh' c' ⇒ match rcr_b8 (w16l w) c' with
- [ pair wl' c'' ⇒ pair … (mk_word16 wh' wl') c'' ]].
-
-(* operatore shift destro *)
-ndefinition shr_w16 ≝
-λw:word16.match rcr_b8 (w16h w) false with
- [ pair wh' c' ⇒ match rcr_b8 (w16l w) c' with
- [ pair wl' c'' ⇒ pair … (mk_word16 wh' wl') c'' ]].
-
-(* operatore rotazione destra *)
-ndefinition ror_w16 ≝
-λw:word16.match rcr_b8 (w16h w) false with
- [ pair wh' c' ⇒ match rcr_b8 (w16l w) c' with
- [ pair wl' c'' ⇒ match c'' with
- [ true ⇒ mk_word16 (or_b8 (mk_byte8 x8 x0) wh') wl'
- | false ⇒ mk_word16 wh' wl' ]]].
-
-(* operatore rotazione destra n-volte *)
-nlet rec ror_w16_n (w:word16) (n:exadecim) (r:rec_exadecim n) on r ≝
- match r with
- [ ex_O ⇒ w
- | ex_S t n' ⇒ ror_w16_n (ror_w16 w) t n' ].
-
-(* operatore rotazione sinistra con carry *)
-ndefinition rcl_w16 ≝
-λw:word16.λc:bool.match rcl_b8 (w16l w) c with
- [ pair wl' c' ⇒ match rcl_b8 (w16h w) c' with
- [ pair wh' c'' ⇒ pair … (mk_word16 wh' wl') c'' ]].
-
-(* operatore shift sinistro *)
-ndefinition shl_w16 ≝
-λw:word16.match rcl_b8 (w16l w) false with
- [ pair wl' c' ⇒ match rcl_b8 (w16h w) c' with
- [ pair wh' c'' ⇒ pair … (mk_word16 wh' wl') c'' ]].
-
-(* operatore rotazione sinistra *)
-ndefinition rol_w16 ≝
-λw:word16.match rcl_b8 (w16l w) false with
- [ pair wl' c' ⇒ match rcl_b8 (w16h w) c' with
- [ pair wh' c'' ⇒ match c'' with
- [ true ⇒ mk_word16 wh' (or_b8 (mk_byte8 x0 x1) wl')
- | false ⇒ mk_word16 wh' wl' ]]].
-
-(* operatore rotazione sinistra n-volte *)
-nlet rec rol_w16_n (w:word16) (n:exadecim) (r:rec_exadecim n) on r ≝
- match r with
- [ ex_O ⇒ w
- | ex_S t n' ⇒ rol_w16_n (rol_w16 w) t n' ].
-
-(* operatore not/complemento a 1 *)
-ndefinition not_w16 ≝
-λw:word16.mk_word16 (not_b8 (w16h w)) (not_b8 (w16l w)).
-
-(* operatore somma con data+carry → data+carry *)
-ndefinition plus_w16_dc_dc ≝
-λw1,w2:word16.λc:bool.
- match plus_b8_dc_dc (w16l w1) (w16l w2) c with
- [ pair l c ⇒ match plus_b8_dc_dc (w16h w1) (w16h w2) c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]].
-
-(* operatore somma con data+carry → data *)
-ndefinition plus_w16_dc_d ≝
-λw1,w2:word16.λc:bool.
- match plus_b8_dc_dc (w16l w1) (w16l w2) c with
- [ pair l c ⇒ 〈plus_b8_dc_d (w16h w1) (w16h w2) c:l〉 ].
-
-(* operatore somma con data+carry → c *)
-ndefinition plus_w16_dc_c ≝
-λw1,w2:word16.λc:bool.
- plus_b8_dc_c (w16h w1) (w16h w2) (plus_b8_dc_c (w16l w1) (w16l w2) c).
-
-(* operatore somma con data → data+carry *)
-ndefinition plus_w16_d_dc ≝
-λw1,w2:word16.
- match plus_b8_d_dc (w16l w1) (w16l w2) with
- [ pair l c ⇒ match plus_b8_dc_dc (w16h w1) (w16h w2) c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]].
-
-(* operatore somma con data → data *)
-ndefinition plus_w16_d_d ≝
-λw1,w2:word16.
- match plus_b8_d_dc (w16l w1) (w16l w2) with
- [ pair l c ⇒ 〈plus_b8_dc_d (w16h w1) (w16h w2) c:l〉 ].
-
-(* operatore somma con data → c *)
-ndefinition plus_w16_d_c ≝
-λw1,w2:word16.
- plus_b8_dc_c (w16h w1) (w16h w2) (plus_b8_d_c (w16l w1) (w16l w2)).
-
-(* operatore Most Significant Bit *)
-ndefinition MSB_w16 ≝ λw:word16.eq_ex x8 (and_ex x8 (b8h (w16h w))).
-
-(* operatore predecessore *)
-ndefinition pred_w16 ≝
-λw:word16.match eq_b8 (w16l w) (mk_byte8 x0 x0) with
- [ true ⇒ mk_word16 (pred_b8 (w16h w)) (pred_b8 (w16l w))
- | false ⇒ mk_word16 (w16h w) (pred_b8 (w16l w)) ].
-
-(* operatore successore *)
-ndefinition succ_w16 ≝
-λw:word16.match eq_b8 (w16l w) (mk_byte8 xF xF) with
- [ true ⇒ mk_word16 (succ_b8 (w16h w)) (succ_b8 (w16l w))
- | false ⇒ mk_word16 (w16h w) (succ_b8 (w16l w)) ].
-
-(* operatore neg/complemento a 2 *)
-ndefinition compl_w16 ≝
-λw:word16.match MSB_w16 w with
- [ true ⇒ succ_w16 (not_w16 w)
- | false ⇒ not_w16 (pred_w16 w) ].
-
-(*
- operatore moltiplicazione senza segno: b*b=[0x0000,0xFE01]
- ... in pratica (〈a,b〉*〈c,d〉) = (a*c)<<8+(a*d)<<4+(b*c)<<4+(b*d)
-*)
-ndefinition mul_b8 ≝
-λb1,b2:byte8.match b1 with
-[ mk_byte8 b1h b1l ⇒ match b2 with
-[ mk_byte8 b2h b2l ⇒ match mul_ex b1l b2l with
-[ mk_byte8 t1_h t1_l ⇒ match mul_ex b1h b2l with
-[ mk_byte8 t2_h t2_l ⇒ match mul_ex b2h b1l with
-[ mk_byte8 t3_h t3_l ⇒ match mul_ex b1h b2h with
-[ mk_byte8 t4_h t4_l ⇒
- plus_w16_d_d
- (plus_w16_d_d
- (plus_w16_d_d 〈〈x0,t3_h〉:〈t3_l,x0〉〉 〈〈x0,t2_h〉:〈t2_l,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈t1_h,t1_l〉〉
-]]]]]].
-
-(* divisione senza segno (secondo la logica delle ALU): (quoziente resto) overflow *)
-nlet rec div_b8_aux (divd:word16) (divs:word16) (molt:byte8) (q:byte8) (c:oct) (rc:rec_oct c) on rc ≝
- let w' ≝ plus_w16_d_d divd (compl_w16 divs) in
- match rc with
- [ oc_O ⇒ match le_w16 divs divd with
- [ true ⇒ triple … (or_b8 molt q) (w16l w') (⊖ (eq_b8 (w16h w') 〈x0,x0〉))
- | false ⇒ triple … q (w16l divd) (⊖ (eq_b8 (w16h divd) 〈x0,x0〉)) ]
- | oc_S t c' ⇒ match le_w16 divs divd with
- [ true ⇒ div_b8_aux w' (ror_w16 divs) (ror_b8 molt) (or_b8 molt q) t c'
- | false ⇒ div_b8_aux divd (ror_w16 divs) (ror_b8 molt) q t c' ]].
-
-ndefinition div_b8 ≝
-λw:word16.λb:byte8.match eq_b8 b 〈x0,x0〉 with
-(*
- la combinazione n/0 e' illegale, segnala solo overflow senza dare risultato
-*)
- [ true ⇒ triple … 〈xF,xF〉 (w16l w) true
- | false ⇒ match eq_w16 w 〈〈x0,x0〉:〈x0,x0〉〉 with
-(* 0 diviso qualsiasi cosa diverso da 0 da' q=0 r=0 o=false *)
- [ true ⇒ triple … 〈x0,x0〉 〈x0,x0〉 false
-(* 1) e' una divisione sensata che produrra' overflow/risultato *)
-(* 2) parametri: dividendo, divisore, moltiplicatore, quoziente, contatore *)
-(* 3) ad ogni ciclo il divisore e il moltiplicatore vengono scalati di 1 a dx *)
-(* 4) il moltiplicatore e' la quantita' aggiunta al quoziente se il divisore *)
-(* puo' essere sottratto al dividendo *)
- | false ⇒ div_b8_aux w (rol_w16_n 〈〈x0,x0〉:b〉 ? (ex_to_recex x7)) 〈x8,x0〉 〈x0,x0〉 ? (oct_to_recoct o7) ]].
-
-(* operatore x in [inf,sup] *)
-ndefinition inrange_w16 ≝
-λx,inf,sup:word16.(le_w16 inf sup) ⊗ (ge_w16 x inf) ⊗ (le_w16 x sup).
-
-(* iteratore sulle word *)
-ndefinition forall_w16 ≝
- λP.
- forall_b8 (λbh.
- forall_b8 (λbl.
- P (mk_word16 bh bl ))).
-
-(* word16 ricorsive *)
-ninductive rec_word16 : word16 → Type ≝
- w16_O : rec_word16 〈〈x0,x0〉:〈x0,x0〉〉
-| w16_S : ∀n.rec_word16 n → rec_word16 (succ_w16 n).
-
-(* word16 → word16 ricorsive *)
-ndefinition w16_to_recw16_aux1_1 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x1,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? recw
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_2 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x2,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_1 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_3 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x3,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_2 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_4 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x4,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_3 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_5 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x5,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_4 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_6 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x6,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_5 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_7 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x7,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_6 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_8 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x8,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_7 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_9 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈x9,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_8 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_10 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xA,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_9 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_11 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xB,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_10 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_12 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xC,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_11 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_13 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xD,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_12 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_14 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xE,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_13 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1_15 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈n:〈xF,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_14 ? recw)
- ))))))))))))))).
-
-ndefinition w16_to_recw16_aux1 : Πn.rec_word16 〈n:〈x0,x0〉〉 → rec_word16 〈(succ_b8 n):〈x0,x0〉〉 ≝
-λn.λrecw:rec_word16 〈n:〈x0,x0〉〉.
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (
- w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_S ? (w16_to_recw16_aux1_15 ? recw)
- ))))))))))))))).
-
-(* ... cifra byte superiore *)
-nlet rec w16_to_recw16_aux2 (n:byte8) (r:rec_byte8 n) on r ≝
- match r return λx.λy:rec_byte8 x.rec_word16 〈x:〈x0,x0〉〉 with
- [ b8_O ⇒ w16_O
- | b8_S t n' ⇒ w16_to_recw16_aux1 ? (w16_to_recw16_aux2 t n')
- ].
-
-(* ... cifra esadecimale n.2 *)
-ndefinition w16_to_recw16_aux3 ≝
-λb,n.λrecw:rec_word16 〈b:〈x0,x0〉〉.
- match n return λx.rec_word16 〈b:〈x,x0〉〉 with
- [ x0 ⇒ recw
- | x1 ⇒ w16_to_recw16_aux1_1 ? recw
- | x2 ⇒ w16_to_recw16_aux1_2 ? recw
- | x3 ⇒ w16_to_recw16_aux1_3 ? recw
- | x4 ⇒ w16_to_recw16_aux1_4 ? recw
- | x5 ⇒ w16_to_recw16_aux1_5 ? recw
- | x6 ⇒ w16_to_recw16_aux1_6 ? recw
- | x7 ⇒ w16_to_recw16_aux1_7 ? recw
- | x8 ⇒ w16_to_recw16_aux1_8 ? recw
- | x9 ⇒ w16_to_recw16_aux1_9 ? recw
- | xA ⇒ w16_to_recw16_aux1_10 ? recw
- | xB ⇒ w16_to_recw16_aux1_11 ? recw
- | xC ⇒ w16_to_recw16_aux1_12 ? recw
- | xD ⇒ w16_to_recw16_aux1_13 ? recw
- | xE ⇒ w16_to_recw16_aux1_14 ? recw
- | xF ⇒ w16_to_recw16_aux1_15 ? recw
- ].
-
-nlemma w16_to_recw16_aux4_1 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x1〉〉.
- #n; #e; nelim e;
- (* napply (exadecim_ind … e); funziona *)
- #input; napply (w16_S ? input).
-nqed.
-
-nlemma w16_to_recw16_aux4_2 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x2〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_1 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_3 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x3〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_2 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_4 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x4〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_3 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_5 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x5〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_4 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_6 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x6〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_5 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_7 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x7〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_6 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_8 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x8〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_7 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_9 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,x9〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_8 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_10 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xA〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_9 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_11 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xB〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_10 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_12 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xC〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_11 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_13 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xD〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_12 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_14 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xE〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_13 … input)).
-nqed.
-
-nlemma w16_to_recw16_aux4_15 : Πn,e.rec_word16 〈n:〈e,x0〉〉 → rec_word16 〈n:〈e,xF〉〉.
- #n; #e; nelim e; #input; napply (w16_S ? (w16_to_recw16_aux4_14 … input)).
-nqed.
-
-(* ... cifra esadecimale n.1 *)
-ndefinition w16_to_recw16_aux4 ≝
-λb,e,n.λrecw:rec_word16 〈b:〈e,x0〉〉.
- match n return λx.rec_word16 〈b:〈e,x〉〉 with
- [ x0 ⇒ recw
- | x1 ⇒ w16_to_recw16_aux4_1 … recw
- | x2 ⇒ w16_to_recw16_aux4_2 … recw
- | x3 ⇒ w16_to_recw16_aux4_3 … recw
- | x4 ⇒ w16_to_recw16_aux4_4 … recw
- | x5 ⇒ w16_to_recw16_aux4_5 … recw
- | x6 ⇒ w16_to_recw16_aux4_6 … recw
- | x7 ⇒ w16_to_recw16_aux4_7 … recw
- | x8 ⇒ w16_to_recw16_aux4_8 … recw
- | x9 ⇒ w16_to_recw16_aux4_9 … recw
- | xA ⇒ w16_to_recw16_aux4_10 … recw
- | xB ⇒ w16_to_recw16_aux4_11 … recw
- | xC ⇒ w16_to_recw16_aux4_12 … recw
- | xD ⇒ w16_to_recw16_aux4_13 … recw
- | xE ⇒ w16_to_recw16_aux4_14 … recw
- | 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).
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/byte8_lemmas.ma".
-include "freescale/word16.ma".
-
-(* **** *)
-(* WORD *)
-(* **** *)
-
-nlemma word16_destruct_1 :
-∀x1,x2,y1,y2.
- mk_word16 x1 y1 = mk_word16 x2 y2 → x1 = x2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_word16 x2 y2 with [ mk_word16 a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma word16_destruct_2 :
-∀x1,x2,y1,y2.
- mk_word16 x1 y1 = mk_word16 x2 y2 → y1 = y2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_word16 x2 y2 with [ mk_word16 _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqw16 : symmetricT word16 bool eq_w16.
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- nchange with (((eq_b8 b3 b1)⊗(eq_b8 b4 b2)) = ((eq_b8 b1 b3)⊗(eq_b8 b2 b4)));
- nrewrite > (symmetric_eqb8 b1 b3);
- nrewrite > (symmetric_eqb8 b2 b4);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_andw16 : symmetricT word16 word16 and_w16.
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- nchange with ((mk_word16 (and_b8 b3 b1) (and_b8 b4 b2)) = (mk_word16 (and_b8 b1 b3) (and_b8 b2 b4)));
- nrewrite > (symmetric_andb8 b1 b3);
- nrewrite > (symmetric_andb8 b2 b4);
- napply refl_eq.
-nqed.
-
-nlemma associative_andw16 : ∀w1,w2,w3.(and_w16 (and_w16 w1 w2) w3) = (and_w16 w1 (and_w16 w2 w3)).
- #w1; #w2; #w3;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nelim w3;
- #b5; #b6;
- nchange with (mk_word16 (and_b8 (and_b8 b1 b3) b5) (and_b8 (and_b8 b2 b4) b6) =
- mk_word16 (and_b8 b1 (and_b8 b3 b5)) (and_b8 b2 (and_b8 b4 b6)));
- nrewrite < (associative_andb8 b1 b3 b5);
- nrewrite < (associative_andb8 b2 b4 b6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_orw16 : symmetricT word16 word16 or_w16.
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- nchange with ((mk_word16 (or_b8 b3 b1) (or_b8 b4 b2)) = (mk_word16 (or_b8 b1 b3) (or_b8 b2 b4)));
- nrewrite > (symmetric_orb8 b1 b3);
- nrewrite > (symmetric_orb8 b2 b4);
- napply refl_eq.
-nqed.
-
-nlemma associative_orw16 : ∀w1,w2,w3.(or_w16 (or_w16 w1 w2) w3) = (or_w16 w1 (or_w16 w2 w3)).
- #w1; #w2; #w3;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nelim w3;
- #b5; #b6;
- nchange with (mk_word16 (or_b8 (or_b8 b1 b3) b5) (or_b8 (or_b8 b2 b4) b6) =
- mk_word16 (or_b8 b1 (or_b8 b3 b5)) (or_b8 b2 (or_b8 b4 b6)));
- nrewrite < (associative_orb8 b1 b3 b5);
- nrewrite < (associative_orb8 b2 b4 b6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_xorw16 : symmetricT word16 word16 xor_w16.
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- nchange with ((mk_word16 (xor_b8 b3 b1) (xor_b8 b4 b2)) = (mk_word16 (xor_b8 b1 b3) (xor_b8 b2 b4)));
- nrewrite > (symmetric_xorb8 b1 b3);
- nrewrite > (symmetric_xorb8 b2 b4);
- napply refl_eq.
-nqed.
-
-nlemma associative_xorw16 : ∀w1,w2,w3.(xor_w16 (xor_w16 w1 w2) w3) = (xor_w16 w1 (xor_w16 w2 w3)).
- #w1; #w2; #w3;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nelim w3;
- #b5; #b6;
- nchange with (mk_word16 (xor_b8 (xor_b8 b1 b3) b5) (xor_b8 (xor_b8 b2 b4) b6) =
- mk_word16 (xor_b8 b1 (xor_b8 b3 b5)) (xor_b8 b2 (xor_b8 b4 b6)));
- nrewrite < (associative_xorb8 b1 b3 b5);
- nrewrite < (associative_xorb8 b2 b4 b6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_dc_dc : ∀w1,w2,c.plus_w16_dc_dc w1 w2 c = plus_w16_dc_dc w2 w1 c.
- #w1; #w2; #c;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- match plus_b8_dc_dc b2 b4 c with
- [ pair l c ⇒ match plus_b8_dc_dc b1 b3 c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]] =
- match plus_b8_dc_dc b4 b2 c with
- [ pair l c ⇒ match plus_b8_dc_dc b3 b1 c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]]);
- nrewrite > (symmetric_plusb8_dc_dc b4 b2 c);
- ncases (plus_b8_dc_dc b2 b4 c);
- #b5; #c1;
- nchange with (
- match plus_b8_dc_dc b1 b3 c1 with
- [ pair h c' ⇒ pair … 〈h:b5〉 c' ] =
- match plus_b8_dc_dc b3 b1 c1 with
- [ pair h c' ⇒ pair … 〈h:b5〉 c' ]);
- nrewrite > (symmetric_plusb8_dc_dc b1 b3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_dc_d : ∀w1,w2,c.plus_w16_dc_d w1 w2 c = plus_w16_dc_d w2 w1 c.
- #w1; #w2; #c;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- match plus_b8_dc_dc b2 b4 c with
- [ pair l c ⇒ 〈plus_b8_dc_d b1 b3 c:l〉 ] =
- match plus_b8_dc_dc b4 b2 c with
- [ pair l c ⇒ 〈plus_b8_dc_d b3 b1 c:l〉 ]);
- nrewrite > (symmetric_plusb8_dc_dc b4 b2 c);
- ncases (plus_b8_dc_dc b2 b4 c);
- #b5; #c1;
- nchange with (〈plus_b8_dc_d b1 b3 c1:b5〉 = 〈plus_b8_dc_d b3 b1 c1:b5〉);
- nrewrite > (symmetric_plusb8_dc_d b1 b3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_dc_c : ∀w1,w2,c.plus_w16_dc_c w1 w2 c = plus_w16_dc_c w2 w1 c.
- #w1; #w2; #c;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- plus_b8_dc_c b1 b3 (plus_b8_dc_c b2 b4 c) =
- plus_b8_dc_c b3 b1 (plus_b8_dc_c b4 b2 c));
- nrewrite > (symmetric_plusb8_dc_c b4 b2 c);
- nrewrite > (symmetric_plusb8_dc_c b3 b1 (plus_b8_dc_c b2 b4 c));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_d_dc : ∀w1,w2.plus_w16_d_dc w1 w2 = plus_w16_d_dc w2 w1.
- #w1; #w2;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- match plus_b8_d_dc b2 b4 with
- [ pair l c ⇒ match plus_b8_dc_dc b1 b3 c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]] =
- match plus_b8_d_dc b4 b2 with
- [ pair l c ⇒ match plus_b8_dc_dc b3 b1 c with
- [ pair h c' ⇒ pair … 〈h:l〉 c' ]]);
- nrewrite > (symmetric_plusb8_d_dc b4 b2);
- ncases (plus_b8_d_dc b2 b4);
- #b5; #c;
- nchange with (
- match plus_b8_dc_dc b1 b3 c with
- [ pair h c' ⇒ pair … 〈h:b5〉 c' ] =
- match plus_b8_dc_dc b3 b1 c with
- [ pair h c' ⇒ pair … 〈h:b5〉 c' ]);
- nrewrite > (symmetric_plusb8_dc_dc b1 b3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_d_d : ∀w1,w2.plus_w16_d_d w1 w2 = plus_w16_d_d w2 w1.
- #w1; #w2;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- match plus_b8_d_dc b2 b4 with
- [ pair l c ⇒ 〈plus_b8_dc_d b1 b3 c:l〉 ] =
- match plus_b8_d_dc b4 b2 with
- [ pair l c ⇒ 〈plus_b8_dc_d b3 b1 c:l〉 ]);
- nrewrite > (symmetric_plusb8_d_dc b4 b2);
- ncases (plus_b8_d_dc b2 b4);
- #b5; #c;
- nchange with (〈plus_b8_dc_d b1 b3 c:b5〉 = 〈plus_b8_dc_d b3 b1 c:b5〉);
- nrewrite > (symmetric_plusb8_dc_d b1 b3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw16_d_c : ∀w1,w2.plus_w16_d_c w1 w2 = plus_w16_d_c w2 w1.
- #w1; #w2;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (
- plus_b8_dc_c b1 b3 (plus_b8_d_c b2 b4) =
- plus_b8_dc_c b3 b1 (plus_b8_d_c b4 b2));
- nrewrite > (symmetric_plusb8_d_c b4 b2);
- nrewrite > (symmetric_plusb8_dc_c b3 b1 (plus_b8_d_c b2 b4));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_mulb8 : symmetricT byte8 word16 mul_b8.
- #b1; #b2;
- nelim b1;
- #e1; #e2;
- nelim b2;
- #e3; #e4;
- nchange with (match mul_ex e2 e4 with
- [ mk_byte8 t1_h t1_l ⇒ match mul_ex e1 e4 with
- [ mk_byte8 t2_h t2_l ⇒ match mul_ex e3 e2 with
- [ mk_byte8 t3_h t3_l ⇒ match mul_ex e1 e3 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,t3_h〉:〈t3_l,x0〉〉 〈〈x0,t2_h〉:〈t2_l,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈t1_h,t1_l〉〉
- ]]]] = match mul_ex e4 e2 with
- [ mk_byte8 t1_h t1_l ⇒ match mul_ex e3 e2 with
- [ mk_byte8 t2_h t2_l ⇒ match mul_ex e1 e4 with
- [ mk_byte8 t3_h t3_l ⇒ match mul_ex e3 e1 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,t3_h〉:〈t3_l,x0〉〉 〈〈x0,t2_h〉:〈t2_l,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈t1_h,t1_l〉〉
- ]]]]);
- nrewrite < (symmetric_mulex e2 e4);
- ncases (mul_ex e2 e4);
- #e5; #e6;
- nchange with (match mul_ex e1 e4 with
- [ mk_byte8 t2_h t2_l ⇒ match mul_ex e3 e2 with
- [ mk_byte8 t3_h t3_l ⇒ match mul_ex e1 e3 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,t3_h〉:〈t3_l,x0〉〉 〈〈x0,t2_h〉:〈t2_l,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉
- ]]] = match mul_ex e3 e2 with
- [ mk_byte8 t2_h t2_l ⇒ match mul_ex e1 e4 with
- [ mk_byte8 t3_h t3_l ⇒ match mul_ex e3 e1 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,t3_h〉:〈t3_l,x0〉〉 〈〈x0,t2_h〉:〈t2_l,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉
- ]]]);
- ncases (mul_ex e3 e2);
- #e7; #e8;
- ncases (mul_ex e1 e4);
- #e9; #e10;
- nchange with (match mul_ex e1 e3 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,e7〉:〈e8,x0〉〉 〈〈x0,e9〉:〈e10,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉
- ] = match mul_ex e3 e1 with
- [ mk_byte8 t4_h t4_l ⇒ plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,e9〉:〈e10,x0〉〉 〈〈x0,e7〉:〈e8,x0〉〉) 〈〈t4_h,t4_l〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉
- ]);
- nrewrite < (symmetric_mulex e1 e3);
- ncases (mul_ex e1 e3);
- #e11; #e12;
- nchange with ((plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,e7〉:〈e8,x0〉〉 〈〈x0,e9〉:〈e10,x0〉〉) 〈〈e11,e12〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉) =
- (plus_w16_d_d (plus_w16_d_d (plus_w16_d_d 〈〈x0,e9〉:〈e10,x0〉〉 〈〈x0,e7〉:〈e8,x0〉〉) 〈〈e11,e12〉:〈x0,x0〉〉)〈〈x0,x0〉:〈e5,e6〉〉));
- nrewrite > (symmetric_plusw16_d_d 〈〈x0,e7〉:〈e8,x0〉〉 〈〈x0,e9〉:〈e10,x0〉〉);
- napply refl_eq.
-nqed.
-
-nlemma eqw16_to_eq : ∀w1,w2:word16.(eq_w16 w1 w2 = true) → (w1 = w2).
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- nchange in ⊢ (% → ?) with (((eq_b8 b3 b1)⊗(eq_b8 b4 b2)) = true);
- #H;
- nrewrite < (eqb8_to_eq … (andb_true_true_l … H));
- nrewrite < (eqb8_to_eq … (andb_true_true_r … H));
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqw16 : ∀w1,w2.w1 = w2 → eq_w16 w1 w2 = true.
- #w1; #w2;
- nelim w1;
- nelim w2;
- #b1; #b2; #b3; #b4;
- #H;
- nrewrite < (word16_destruct_1 … H);
- nrewrite < (word16_destruct_2 … H);
- nchange with (((eq_b8 b3 b3)⊗(eq_b8 b4 b4)) = true);
- nrewrite > (eq_to_eqb8 b3 b3 (refl_eq …));
- nrewrite > (eq_to_eqb8 b4 b4 (refl_eq …));
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/word16.ma".
-
-(* ***** *)
-(* DWORD *)
-(* ***** *)
-
-nrecord word32 : Type ≝
- {
- w32h: word16;
- w32l: word16
- }.
-
-(* \langle \rangle *)
-notation "〈x.y〉" non associative with precedence 80
- for @{ 'mk_word32 $x $y }.
-interpretation "mk_word32" 'mk_word32 x y = (mk_word32 x y).
-
-(* operatore = *)
-ndefinition eq_w32 ≝ λdw1,dw2.(eq_w16 (w32h dw1) (w32h dw2)) ⊗ (eq_w16 (w32l dw1) (w32l dw2)).
-
-(* operatore < *)
-ndefinition lt_w32 ≝
-λdw1,dw2:word32.match lt_w16 (w32h dw1) (w32h dw2) with
- [ true ⇒ true
- | false ⇒ match gt_w16 (w32h dw1) (w32h dw2) with
- [ true ⇒ false
- | false ⇒ lt_w16 (w32l dw1) (w32l dw2) ]].
-
-(* operatore ≤ *)
-ndefinition le_w32 ≝ λdw1,dw2:word32.(eq_w32 dw1 dw2) ⊕ (lt_w32 dw1 dw2).
-
-(* operatore > *)
-ndefinition gt_w32 ≝ λdw1,dw2:word32.⊖ (le_w32 dw1 dw2).
-
-(* operatore ≥ *)
-ndefinition ge_w32 ≝ λdw1,dw2:word32.⊖ (lt_w32 dw1 dw2).
-
-(* operatore and *)
-ndefinition and_w32 ≝
-λdw1,dw2:word32.mk_word32 (and_w16 (w32h dw1) (w32h dw2)) (and_w16 (w32l dw1) (w32l dw2)).
-
-(* operatore or *)
-ndefinition or_w32 ≝
-λdw1,dw2:word32.mk_word32 (or_w16 (w32h dw1) (w32h dw2)) (or_w16 (w32l dw1) (w32l dw2)).
-
-(* operatore xor *)
-ndefinition xor_w32 ≝
-λdw1,dw2:word32.mk_word32 (xor_w16 (w32h dw1) (w32h dw2)) (xor_w16 (w32l dw1) (w32l dw2)).
-
-(* operatore rotazione destra con carry *)
-ndefinition rcr_w32 ≝
-λdw:word32.λc:bool.match rcr_w16 (w32h dw) c with
- [ pair wh' c' ⇒ match rcr_w16 (w32l dw) c' with
- [ pair wl' c'' ⇒ pair … (mk_word32 wh' wl') c'' ]].
-
-(* operatore shift destro *)
-ndefinition shr_w32 ≝
-λdw:word32.match rcr_w16 (w32h dw) false with
- [ pair wh' c' ⇒ match rcr_w16 (w32l dw) c' with
- [ pair wl' c'' ⇒ pair … (mk_word32 wh' wl') c'' ]].
-
-(* operatore rotazione destra *)
-ndefinition ror_w32 ≝
-λdw:word32.match rcr_w16 (w32h dw) false with
- [ pair wh' c' ⇒ match rcr_w16 (w32l dw) c' with
- [ pair wl' c'' ⇒ match c'' with
- [ true ⇒ mk_word32 (or_w16 (mk_word16 (mk_byte8 x8 x0) (mk_byte8 x0 x0)) wh') wl'
- | false ⇒ mk_word32 wh' wl' ]]].
-
-(* operatore rotazione destra n-volte *)
-nlet rec ror_w32_n (dw:word32) (n:bitrigesim) (r:rec_bitrigesim n) on r ≝
- match r with
- [ bi_O ⇒ dw
- | bi_S t n' ⇒ ror_w32_n (ror_w32 dw) t n' ].
-
-(* operatore rotazione sinistra con carry *)
-ndefinition rcl_w32 ≝
-λdw:word32.λc:bool.match rcl_w16 (w32l dw) c with
- [ pair wl' c' ⇒ match rcl_w16 (w32h dw) c' with
- [ pair wh' c'' ⇒ pair … (mk_word32 wh' wl') c'' ]].
-
-(* operatore shift sinistro *)
-ndefinition shl_w32 ≝
-λdw:word32.match rcl_w16 (w32l dw) false with
- [ pair wl' c' ⇒ match rcl_w16 (w32h dw) c' with
- [ pair wh' c'' ⇒ pair … (mk_word32 wh' wl') c'' ]].
-
-(* operatore rotazione sinistra *)
-ndefinition rol_w32 ≝
-λdw:word32.match rcl_w16 (w32l dw) false with
- [ pair wl' c' ⇒ match rcl_w16 (w32h dw) c' with
- [ pair wh' c'' ⇒ match c'' with
- [ true ⇒ mk_word32 wh' (or_w16 (mk_word16 (mk_byte8 x0 x0) (mk_byte8 x0 x1)) wl')
- | false ⇒ mk_word32 wh' wl' ]]].
-
-(* operatore rotazione sinistra n-volte *)
-nlet rec rol_w32_n (dw:word32) (n:bitrigesim) (r:rec_bitrigesim n) on r ≝
- match r with
- [ bi_O ⇒ dw
- | bi_S t n' ⇒ rol_w32_n (rol_w32 dw) t n' ].
-
-(* operatore not/complemento a 1 *)
-ndefinition not_w32 ≝
-λdw:word32.mk_word32 (not_w16 (w32h dw)) (not_w16 (w32l dw)).
-
-(* operatore somma con data+carry → data+carry *)
-ndefinition plus_w32_dc_dc ≝
-λdw1,dw2:word32.λc:bool.
- match plus_w16_dc_dc (w32l dw1) (w32l dw2) c with
- [ pair l c ⇒ match plus_w16_dc_dc (w32h dw1) (w32h dw2) c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]].
-
-(* operatore somma con data+carry → data *)
-ndefinition plus_w32_dc_d ≝
-λdw1,dw2:word32.λc:bool.
- match plus_w16_dc_dc (w32l dw1) (w32l dw2) c with
- [ pair l c ⇒ 〈plus_w16_dc_d (w32h dw1) (w32h dw2) c.l〉 ].
-
-(* operatore somma con data+carry → c *)
-ndefinition plus_w32_dc_c ≝
-λdw1,dw2:word32.λc:bool.
- plus_w16_dc_c (w32h dw1) (w32h dw2) (plus_w16_dc_c (w32l dw1) (w32l dw2) c).
-
-(* operatore somma con data → data+carry *)
-ndefinition plus_w32_d_dc ≝
-λdw1,dw2:word32.
- match plus_w16_d_dc (w32l dw1) (w32l dw2) with
- [ pair l c ⇒ match plus_w16_dc_dc (w32h dw1) (w32h dw2) c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]].
-
-(* operatore somma con data → data *)
-ndefinition plus_w32_d_d ≝
-λdw1,dw2:word32.
- match plus_w16_d_dc (w32l dw1) (w32l dw2) with
- [ pair l c ⇒ 〈plus_w16_dc_d (w32h dw1) (w32h dw2) c.l〉 ].
-
-(* operatore somma con data → c *)
-ndefinition plus_w32_d_c ≝
-λdw1,dw2:word32.
- plus_w16_dc_c (w32h dw1) (w32h dw2) (plus_w16_d_c (w32l dw1) (w32l dw2)).
-
-(* operatore Most Significant Bit *)
-ndefinition MSB_w32 ≝ λdw:word32.eq_ex x8 (and_ex x8 (b8h (w16h (w32h dw)))).
-
-(* operatore predecessore *)
-ndefinition pred_w32 ≝
-λdw:word32.match eq_w16 (w32l dw) (mk_word16 (mk_byte8 x0 x0) (mk_byte8 x0 x0)) with
- [ true ⇒ mk_word32 (pred_w16 (w32h dw)) (pred_w16 (w32l dw))
- | false ⇒ mk_word32 (w32h dw) (pred_w16 (w32l dw)) ].
-
-(* operatore successore *)
-ndefinition succ_w32 ≝
-λdw:word32.match eq_w16 (w32l dw) (mk_word16 (mk_byte8 xF xF) (mk_byte8 xF xF)) with
- [ true ⇒ mk_word32 (succ_w16 (w32h dw)) (succ_w16 (w32l dw))
- | false ⇒ mk_word32 (w32h dw) (succ_w16 (w32l dw)) ].
-
-(* operatore neg/complemento a 2 *)
-ndefinition compl_w32 ≝
-λdw:word32.match MSB_w32 dw with
- [ true ⇒ succ_w32 (not_w32 dw)
- | false ⇒ not_w32 (pred_w32 dw) ].
-
-(*
- operatore moltiplicazione senza segno: b*b=[0x00000000,0xFFFE0001]
- ... in pratica (〈a:b〉*〈c:d〉) = (a*c)<<16+(a*d)<<8+(b*c)<<8+(b*d)
-*)
-ndefinition mul_w16 ≝
-λw1,w2:word16.match w1 with
-[ mk_word16 b1h b1l ⇒ match w2 with
-[ mk_word16 b2h b2l ⇒ match mul_b8 b1l b2l with
-[ mk_word16 t1_h t1_l ⇒ match mul_b8 b1h b2l with
-[ mk_word16 t2_h t2_l ⇒ match mul_b8 b2h b1l with
-[ mk_word16 t3_h t3_l ⇒ match mul_b8 b1h b2h with
-[ mk_word16 t4_h t4_l ⇒
- plus_w32_d_d
- (plus_w32_d_d
- (plus_w32_d_d 〈〈〈x0,x0〉:t3_h〉.〈t3_l:〈x0,x0〉〉〉 〈〈〈x0,x0〉:t2_h〉.〈t2_l:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈t1_h:t1_l〉〉
-]]]]]].
-
-(* divisione senza segno (secondo la logica delle ALU): (quoziente resto) overflow *)
-nlet rec div_w16_aux (divd:word32) (divs:word32) (molt:word16) (q:word16) (c:exadecim) (rc:rec_exadecim c) on rc ≝
- let w' ≝ plus_w32_d_d divd (compl_w32 divs) in
- match rc with
- [ ex_O ⇒ match le_w32 divs divd with
- [ true ⇒ triple … (or_w16 molt q) (w32l w') (⊖ (eq_w16 (w32h w') 〈〈x0,x0〉:〈x0,x0〉〉))
- | false ⇒ triple … q (w32l divd) (⊖ (eq_w16 (w32h divd) 〈〈x0,x0〉:〈x0,x0〉〉)) ]
- | ex_S t c' ⇒ match le_w32 divs divd with
- [ true ⇒ div_w16_aux w' (ror_w32 divs) (ror_w16 molt) (or_w16 molt q) t c'
- | false ⇒ div_w16_aux divd (ror_w32 divs) (ror_w16 molt) q t c' ]].
-
-ndefinition div_w16 ≝
-λw:word32.λb:word16.match eq_w16 b 〈〈x0,x0〉:〈x0,x0〉〉 with
-(*
- la combinazione n/0 e' illegale, segnala solo overflow senza dare risultato
-*)
- [ true ⇒ triple … 〈〈xF,xF〉:〈xF,xF〉〉 (w32l w) true
- | false ⇒ match eq_w32 w 〈〈〈x0,x0〉:〈x0,x0〉〉.〈〈x0,x0〉:〈x0,x0〉〉〉 with
-(* 0 diviso qualsiasi cosa diverso da 0 da' q=0 r=0 o=false *)
- [ true ⇒ triple … 〈〈x0,x0〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x0,x0〉〉 false
-(* 1) e' una divisione sensata che produrra' overflow/risultato *)
-(* 2) parametri: dividendo, divisore, moltiplicatore, quoziente, contatore *)
-(* 3) ad ogni ciclo il divisore e il moltiplicatore vengono scalati di 1 a dx *)
-(* 4) il moltiplicatore e' la quantita' aggiunta al quoziente se il divisore *)
-(* puo' essere sottratto al dividendo *)
- | false ⇒ div_w16_aux w (rol_w32_n 〈〈〈x0,x0〉:〈x0,x0〉〉.b〉 ? (bit_to_recbit t0F)) 〈〈x8,x0〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x0,x0〉〉 ? (ex_to_recex xF) ]].
-
-(* operatore x in [inf,sup] *)
-ndefinition inrange_w32 ≝
-λx,inf,sup:word32.(le_w32 inf sup) ⊗ (ge_w32 x inf) ⊗ (le_w32 x sup).
-
-(* iteratore sulle word *)
-ndefinition forall_w32 ≝
- λP.
- forall_w16 (λbh.
- forall_w16 (λbl.
- P (mk_word32 bh bl ))).
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/word16_lemmas.ma".
-include "freescale/word32.ma".
-
-(* ***** *)
-(* DWORD *)
-(* ***** *)
-
-nlemma word32_destruct_1 :
-∀x1,x2,y1,y2.
- mk_word32 x1 y1 = mk_word32 x2 y2 → x1 = x2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_word32 x2 y2 with [ mk_word32 a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma word32_destruct_2 :
-∀x1,x2,y1,y2.
- mk_word32 x1 y1 = mk_word32 x2 y2 → y1 = y2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_word32 x2 y2 with [ mk_word32 _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqw32 : symmetricT word32 bool eq_w32.
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- nchange with (((eq_w16 w3 w1)⊗(eq_w16 w4 w2)) = ((eq_w16 w1 w3)⊗(eq_w16 w2 w4)));
- nrewrite > (symmetric_eqw16 w1 w3);
- nrewrite > (symmetric_eqw16 w2 w4);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_andw32 : symmetricT word32 word32 and_w32.
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- nchange with ((mk_word32 (and_w16 w3 w1) (and_w16 w4 w2)) = (mk_word32 (and_w16 w1 w3) (and_w16 w2 w4)));
- nrewrite > (symmetric_andw16 w1 w3);
- nrewrite > (symmetric_andw16 w2 w4);
- napply refl_eq.
-nqed.
-
-nlemma associative_andw32 : ∀dw1,dw2,dw3.(and_w32 (and_w32 dw1 dw2) dw3) = (and_w32 dw1 (and_w32 dw2 dw3)).
- #dw1; #dw2; #dw3;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nelim dw3;
- #w5; #w6;
- nchange with (mk_word32 (and_w16 (and_w16 w1 w3) w5) (and_w16 (and_w16 w2 w4) w6) =
- mk_word32 (and_w16 w1 (and_w16 w3 w5)) (and_w16 w2 (and_w16 w4 w6)));
- nrewrite < (associative_andw16 w1 w3 w5);
- nrewrite < (associative_andw16 w2 w4 w6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_orw32 : symmetricT word32 word32 or_w32.
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- nchange with ((mk_word32 (or_w16 w3 w1) (or_w16 w4 w2)) = (mk_word32 (or_w16 w1 w3) (or_w16 w2 w4)));
- nrewrite > (symmetric_orw16 w1 w3);
- nrewrite > (symmetric_orw16 w2 w4);
- napply refl_eq.
-nqed.
-
-nlemma associative_orw32 : ∀dw1,dw2,dw3.(or_w32 (or_w32 dw1 dw2) dw3) = (or_w32 dw1 (or_w32 dw2 dw3)).
- #dw1; #dw2; #dw3;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nelim dw3;
- #w5; #w6;
- nchange with (mk_word32 (or_w16 (or_w16 w1 w3) w5) (or_w16 (or_w16 w2 w4) w6) =
- mk_word32 (or_w16 w1 (or_w16 w3 w5)) (or_w16 w2 (or_w16 w4 w6)));
- nrewrite < (associative_orw16 w1 w3 w5);
- nrewrite < (associative_orw16 w2 w4 w6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_xorw32 : symmetricT word32 word32 xor_w32.
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- nchange with ((mk_word32 (xor_w16 w3 w1) (xor_w16 w4 w2)) = (mk_word32 (xor_w16 w1 w3) (xor_w16 w2 w4)));
- nrewrite > (symmetric_xorw16 w1 w3);
- nrewrite > (symmetric_xorw16 w2 w4);
- napply refl_eq.
-nqed.
-
-nlemma associative_xorw32 : ∀dw1,dw2,dw3.(xor_w32 (xor_w32 dw1 dw2) dw3) = (xor_w32 dw1 (xor_w32 dw2 dw3)).
- #dw1; #dw2; #dw3;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nelim dw3;
- #w5; #w6;
- nchange with (mk_word32 (xor_w16 (xor_w16 w1 w3) w5) (xor_w16 (xor_w16 w2 w4) w6) =
- mk_word32 (xor_w16 w1 (xor_w16 w3 w5)) (xor_w16 w2 (xor_w16 w4 w6)));
- nrewrite < (associative_xorw16 w1 w3 w5);
- nrewrite < (associative_xorw16 w2 w4 w6);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_dc_dc : ∀dw1,dw2,c.plus_w32_dc_dc dw1 dw2 c = plus_w32_dc_dc dw2 dw1 c.
- #dw1; #dw2; #c;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- match plus_w16_dc_dc w2 w4 c with
- [ pair l c ⇒ match plus_w16_dc_dc w1 w3 c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]] =
- match plus_w16_dc_dc w4 w2 c with
- [ pair l c ⇒ match plus_w16_dc_dc w3 w1 c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]]);
- nrewrite > (symmetric_plusw16_dc_dc w4 w2 c);
- ncases (plus_w16_dc_dc w2 w4 c);
- #w5; #c1;
- nchange with (
- match plus_w16_dc_dc w1 w3 c1 with
- [ pair h c' ⇒ pair … 〈h.w5〉 c' ] =
- match plus_w16_dc_dc w3 w1 c1 with
- [ pair h c' ⇒ pair … 〈h.w5〉 c' ]);
- nrewrite > (symmetric_plusw16_dc_dc w1 w3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_dc_d : ∀dw1,dw2,c.plus_w32_dc_d dw1 dw2 c = plus_w32_dc_d dw2 dw1 c.
- #dw1; #dw2; #c;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- match plus_w16_dc_dc w2 w4 c with
- [ pair l c ⇒ 〈plus_w16_dc_d w1 w3 c.l〉 ] =
- match plus_w16_dc_dc w4 w2 c with
- [ pair l c ⇒ 〈plus_w16_dc_d w3 w1 c.l〉 ]);
- nrewrite > (symmetric_plusw16_dc_dc w4 w2 c);
- ncases (plus_w16_dc_dc w2 w4 c);
- #w5; #c1;
- nchange with (〈plus_w16_dc_d w1 w3 c1.w5〉 = 〈plus_w16_dc_d w3 w1 c1.w5〉);
- nrewrite > (symmetric_plusw16_dc_d w1 w3 c1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_dc_c : ∀dw1,dw2,c.plus_w32_dc_c dw1 dw2 c = plus_w32_dc_c dw2 dw1 c.
- #dw1; #dw2; #c;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- plus_w16_dc_c w1 w3 (plus_w16_dc_c w2 w4 c) =
- plus_w16_dc_c w3 w1 (plus_w16_dc_c w4 w2 c));
- nrewrite > (symmetric_plusw16_dc_c w4 w2 c);
- nrewrite > (symmetric_plusw16_dc_c w3 w1 (plus_w16_dc_c w2 w4 c));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_d_dc : ∀dw1,dw2.plus_w32_d_dc dw1 dw2 = plus_w32_d_dc dw2 dw1.
- #dw1; #dw2;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- match plus_w16_d_dc w2 w4 with
- [ pair l c ⇒ match plus_w16_dc_dc w1 w3 c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]] =
- match plus_w16_d_dc w4 w2 with
- [ pair l c ⇒ match plus_w16_dc_dc w3 w1 c with
- [ pair h c' ⇒ pair … 〈h.l〉 c' ]]);
- nrewrite > (symmetric_plusw16_d_dc w4 w2);
- ncases (plus_w16_d_dc w2 w4);
- #w5; #c;
- nchange with (
- match plus_w16_dc_dc w1 w3 c with
- [ pair h c' ⇒ pair … 〈h.w5〉 c' ] =
- match plus_w16_dc_dc w3 w1 c with
- [ pair h c' ⇒ pair … 〈h.w5〉 c' ]);
- nrewrite > (symmetric_plusw16_dc_dc w1 w3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_d_d : ∀dw1,dw2.plus_w32_d_d dw1 dw2 = plus_w32_d_d dw2 dw1.
- #dw1; #dw2;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- match plus_w16_d_dc w2 w4 with
- [ pair l c ⇒ 〈plus_w16_dc_d w1 w3 c.l〉 ] =
- match plus_w16_d_dc w4 w2 with
- [ pair l c ⇒ 〈plus_w16_dc_d w3 w1 c.l〉 ]);
- nrewrite > (symmetric_plusw16_d_dc w4 w2);
- ncases (plus_w16_d_dc w2 w4);
- #w5; #c;
- nchange with (〈plus_w16_dc_d w1 w3 c.w5〉 = 〈plus_w16_dc_d w3 w1 c.w5〉);
- nrewrite > (symmetric_plusw16_dc_d w1 w3 c);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_plusw32_d_c : ∀dw1,dw2.plus_w32_d_c dw1 dw2 = plus_w32_d_c dw2 dw1.
- #dw1; #dw2;
- nelim dw1;
- #w1; #w2;
- nelim dw2;
- #w3; #w4;
- nchange with (
- plus_w16_dc_c w1 w3 (plus_w16_d_c w2 w4) =
- plus_w16_dc_c w3 w1 (plus_w16_d_c w4 w2));
- nrewrite > (symmetric_plusw16_d_c w4 w2);
- nrewrite > (symmetric_plusw16_dc_c w3 w1 (plus_w16_d_c w2 w4));
- napply refl_eq.
-nqed.
-
-nlemma symmetric_mulw16 : symmetricT word16 word32 mul_w16.
- #w1; #w2;
- nelim w1;
- #b1; #b2;
- nelim w2;
- #b3; #b4;
- nchange with (match mul_b8 b2 b4 with
- [ mk_word16 t1_h t1_l ⇒ match mul_b8 b1 b4 with
- [ mk_word16 t2_h t2_l ⇒ match mul_b8 b3 b2 with
- [ mk_word16 t3_h t3_l ⇒ match mul_b8 b1 b3 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:t3_h〉.〈t3_l:〈x0,x0〉〉〉 〈〈〈x0,x0〉:t2_h〉.〈t2_l:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈t1_h:t1_l〉〉
- ]]]] = match mul_b8 b4 b2 with
- [ mk_word16 t1_h t1_l ⇒ match mul_b8 b3 b2 with
- [ mk_word16 t2_h t2_l ⇒ match mul_b8 b1 b4 with
- [ mk_word16 t3_h t3_l ⇒ match mul_b8 b3 b1 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:t3_h〉.〈t3_l:〈x0,x0〉〉〉 〈〈〈x0,x0〉:t2_h〉.〈t2_l:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈t1_h:t1_l〉〉
- ]]]]);
- nrewrite < (symmetric_mulb8 b2 b4);
- ncases (mul_b8 b2 b4);
- #b5; #b6;
- nchange with (match mul_b8 b1 b4 with
- [ mk_word16 t2_h t2_l ⇒ match mul_b8 b3 b2 with
- [ mk_word16 t3_h t3_l ⇒ match mul_b8 b1 b3 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:t3_h〉.〈t3_l:〈x0,x0〉〉〉 〈〈〈x0,x0〉:t2_h〉.〈t2_l:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉
- ]]] = match mul_b8 b3 b2 with
- [ mk_word16 t2_h t2_l ⇒ match mul_b8 b1 b4 with
- [ mk_word16 t3_h t3_l ⇒ match mul_b8 b3 b1 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:t3_h〉.〈t3_l:〈x0,x0〉〉〉 〈〈〈x0,x0〉:t2_h〉.〈t2_l:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉
- ]]]);
- ncases (mul_b8 b3 b2);
- #b7; #b8;
- ncases (mul_b8 b1 b4);
- #b9; #b10;
- nchange with (match mul_b8 b1 b3 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:b7〉.〈b8:〈x0,x0〉〉〉 〈〈〈x0,x0〉:b9〉.〈b10:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉
- ] = match mul_b8 b3 b1 with
- [ mk_word16 t4_h t4_l ⇒ plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:b9〉.〈b10:〈x0,x0〉〉〉 〈〈〈x0,x0〉:b7〉.〈b8:〈x0,x0〉〉〉) 〈〈t4_h:t4_l〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉
- ]);
- nrewrite < (symmetric_mulb8 b1 b3);
- ncases (mul_b8 b1 b3);
- #b11; #b12;
- nchange with ((plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:b7〉.〈b8:〈x0,x0〉〉〉 〈〈〈x0,x0〉:b9〉.〈b10:〈x0,x0〉〉〉) 〈〈b11:b12〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉) =
- (plus_w32_d_d (plus_w32_d_d (plus_w32_d_d 〈〈〈x0,x0〉:b9〉.〈b10:〈x0,x0〉〉〉 〈〈〈x0,x0〉:b7〉.〈b8:〈x0,x0〉〉〉) 〈〈b11:b12〉.〈〈x0,x0〉:〈x0,x0〉〉〉)〈〈〈x0,x0〉:〈x0,x0〉〉.〈b5:b6〉〉));
- nrewrite > (symmetric_plusw32_d_d 〈〈〈x0,x0〉:b7〉.〈b8:〈x0,x0〉〉〉 〈〈〈x0,x0〉:b9〉.〈b10:〈x0,x0〉〉〉);
- napply refl_eq.
-nqed.
-
-nlemma eqw32_to_eq : ∀dw1,dw2:word32.(eq_w32 dw1 dw2 = true) → (dw1 = dw2).
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- nchange in ⊢ (% → ?) with (((eq_w16 w3 w1)⊗(eq_w16 w4 w2)) = true);
- #H;
- nrewrite < (eqw16_to_eq … (andb_true_true_l … H));
- nrewrite < (eqw16_to_eq … (andb_true_true_r … H));
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqw32 : ∀dw1,dw2.dw1 = dw2 → eq_w32 dw1 dw2 = true.
- #dw1; #dw2;
- nelim dw1;
- nelim dw2;
- #w1; #w2; #w3; #w4;
- #H;
- nrewrite < (word32_destruct_1 … H);
- nrewrite < (word32_destruct_2 … H);
- nchange with (((eq_w16 w3 w3)⊗(eq_w16 w4 w4)) = true);
- nrewrite > (eq_to_eqw16 w3 w3 (refl_eq …));
- nrewrite > (eq_to_eqw16 w4 w4 (refl_eq …));
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/bool.ma".
-
-(* ************************** *)
-(* DEFINIZIONE ASCII MINIMALE *)
-(* ************************** *)
-
-ninductive ascii : Type ≝
-(* numeri *)
- ch_0: ascii
-| ch_1: ascii
-| ch_2: ascii
-| ch_3: ascii
-| ch_4: ascii
-| ch_5: ascii
-| ch_6: ascii
-| ch_7: ascii
-| ch_8: ascii
-| ch_9: ascii
-
-(* simboli *)
-| ch__: ascii
-
-(* maiuscole *)
-| ch_A: ascii
-| ch_B: ascii
-| ch_C: ascii
-| ch_D: ascii
-| ch_E: ascii
-| ch_F: ascii
-| ch_G: ascii
-| ch_H: ascii
-| ch_I: ascii
-| ch_J: ascii
-| ch_K: ascii
-| ch_L: ascii
-| ch_M: ascii
-| ch_N: ascii
-| ch_O: ascii
-| ch_P: ascii
-| ch_Q: ascii
-| ch_R: ascii
-| ch_S: ascii
-| ch_T: ascii
-| ch_U: ascii
-| ch_V: ascii
-| ch_W: ascii
-| ch_X: ascii
-| ch_Y: ascii
-| ch_Z: ascii
-
-(* minuscole *)
-| ch_a: ascii
-| ch_b: ascii
-| ch_c: ascii
-| ch_d: ascii
-| ch_e: ascii
-| ch_f: ascii
-| ch_g: ascii
-| ch_h: ascii
-| ch_i: ascii
-| ch_j: ascii
-| ch_k: ascii
-| ch_l: ascii
-| ch_m: ascii
-| ch_n: ascii
-| ch_o: ascii
-| ch_p: ascii
-| ch_q: ascii
-| ch_r: ascii
-| ch_s: ascii
-| ch_t: ascii
-| ch_u: ascii
-| ch_v: ascii
-| ch_w: ascii
-| ch_x: ascii
-| ch_y: ascii
-| ch_z: ascii.
-
-(* confronto fra ascii *)
-ndefinition eq_ascii ≝
-λc,c':ascii.match c with
- [ ch_0 ⇒ match c' with [ ch_0 ⇒ true | _ ⇒ false ]
- | ch_1 ⇒ match c' with [ ch_1 ⇒ true | _ ⇒ false ]
- | ch_2 ⇒ match c' with [ ch_2 ⇒ true | _ ⇒ false ]
- | ch_3 ⇒ match c' with [ ch_3 ⇒ true | _ ⇒ false ]
- | ch_4 ⇒ match c' with [ ch_4 ⇒ true | _ ⇒ false ]
- | ch_5 ⇒ match c' with [ ch_5 ⇒ true | _ ⇒ false ]
- | ch_6 ⇒ match c' with [ ch_6 ⇒ true | _ ⇒ false ]
- | ch_7 ⇒ match c' with [ ch_7 ⇒ true | _ ⇒ false ]
- | ch_8 ⇒ match c' with [ ch_8 ⇒ true | _ ⇒ false ]
- | ch_9 ⇒ match c' with [ ch_9 ⇒ true | _ ⇒ false ]
- | ch__ ⇒ match c' with [ ch__ ⇒ true | _ ⇒ false ]
- | ch_A ⇒ match c' with [ ch_A ⇒ true | _ ⇒ false ]
- | ch_B ⇒ match c' with [ ch_B ⇒ true | _ ⇒ false ]
- | ch_C ⇒ match c' with [ ch_C ⇒ true | _ ⇒ false ]
- | ch_D ⇒ match c' with [ ch_D ⇒ true | _ ⇒ false ]
- | ch_E ⇒ match c' with [ ch_E ⇒ true | _ ⇒ false ]
- | ch_F ⇒ match c' with [ ch_F ⇒ true | _ ⇒ false ]
- | ch_G ⇒ match c' with [ ch_G ⇒ true | _ ⇒ false ]
- | ch_H ⇒ match c' with [ ch_H ⇒ true | _ ⇒ false ]
- | ch_I ⇒ match c' with [ ch_I ⇒ true | _ ⇒ false ]
- | ch_J ⇒ match c' with [ ch_J ⇒ true | _ ⇒ false ]
- | ch_K ⇒ match c' with [ ch_K ⇒ true | _ ⇒ false ]
- | ch_L ⇒ match c' with [ ch_L ⇒ true | _ ⇒ false ]
- | ch_M ⇒ match c' with [ ch_M ⇒ true | _ ⇒ false ]
- | ch_N ⇒ match c' with [ ch_N ⇒ true | _ ⇒ false ]
- | ch_O ⇒ match c' with [ ch_O ⇒ true | _ ⇒ false ]
- | ch_P ⇒ match c' with [ ch_P ⇒ true | _ ⇒ false ]
- | ch_Q ⇒ match c' with [ ch_Q ⇒ true | _ ⇒ false ]
- | ch_R ⇒ match c' with [ ch_R ⇒ true | _ ⇒ false ]
- | ch_S ⇒ match c' with [ ch_S ⇒ true | _ ⇒ false ]
- | ch_T ⇒ match c' with [ ch_T ⇒ true | _ ⇒ false ]
- | ch_U ⇒ match c' with [ ch_U ⇒ true | _ ⇒ false ]
- | ch_V ⇒ match c' with [ ch_V ⇒ true | _ ⇒ false ]
- | ch_W ⇒ match c' with [ ch_W ⇒ true | _ ⇒ false ]
- | ch_X ⇒ match c' with [ ch_X ⇒ true | _ ⇒ false ]
- | ch_Y ⇒ match c' with [ ch_Y ⇒ true | _ ⇒ false ]
- | ch_Z ⇒ match c' with [ ch_Z ⇒ true | _ ⇒ false ]
- | ch_a ⇒ match c' with [ ch_a ⇒ true | _ ⇒ false ]
- | ch_b ⇒ match c' with [ ch_b ⇒ true | _ ⇒ false ]
- | ch_c ⇒ match c' with [ ch_c ⇒ true | _ ⇒ false ]
- | ch_d ⇒ match c' with [ ch_d ⇒ true | _ ⇒ false ]
- | ch_e ⇒ match c' with [ ch_e ⇒ true | _ ⇒ false ]
- | ch_f ⇒ match c' with [ ch_f ⇒ true | _ ⇒ false ]
- | ch_g ⇒ match c' with [ ch_g ⇒ true | _ ⇒ false ]
- | ch_h ⇒ match c' with [ ch_h ⇒ true | _ ⇒ false ]
- | ch_i ⇒ match c' with [ ch_i ⇒ true | _ ⇒ false ]
- | ch_j ⇒ match c' with [ ch_j ⇒ true | _ ⇒ false ]
- | ch_k ⇒ match c' with [ ch_k ⇒ true | _ ⇒ false ]
- | ch_l ⇒ match c' with [ ch_l ⇒ true | _ ⇒ false ]
- | ch_m ⇒ match c' with [ ch_m ⇒ true | _ ⇒ false ]
- | ch_n ⇒ match c' with [ ch_n ⇒ true | _ ⇒ false ]
- | ch_o ⇒ match c' with [ ch_o ⇒ true | _ ⇒ false ]
- | ch_p ⇒ match c' with [ ch_p ⇒ true | _ ⇒ false ]
- | ch_q ⇒ match c' with [ ch_q ⇒ true | _ ⇒ false ]
- | ch_r ⇒ match c' with [ ch_r ⇒ true | _ ⇒ false ]
- | ch_s ⇒ match c' with [ ch_s ⇒ true | _ ⇒ false ]
- | ch_t ⇒ match c' with [ ch_t ⇒ true | _ ⇒ false ]
- | ch_u ⇒ match c' with [ ch_u ⇒ true | _ ⇒ false ]
- | ch_v ⇒ match c' with [ ch_v ⇒ true | _ ⇒ false ]
- | ch_w ⇒ match c' with [ ch_w ⇒ true | _ ⇒ false ]
- | ch_x ⇒ match c' with [ ch_x ⇒ true | _ ⇒ false ]
- | ch_y ⇒ match c' with [ ch_y ⇒ true | _ ⇒ false ]
- | ch_z ⇒ match c' with [ ch_z ⇒ true | _ ⇒ false ]
- ].
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/ascii.ma".
-include "freescale/theory.ma".
-
-(* ************************** *)
-(* DEFINIZIONE ASCII MINIMALE *)
-(* ************************** *)
-
-ndefinition ascii_destruct1 : Πc2.ΠP:Prop.ch_0 = c2 → match c2 with [ ch_0 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##1: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_0 with [ ch_0 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct2 : Πc2.ΠP:Prop.ch_1 = c2 → match c2 with [ ch_1 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##2: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_1 with [ ch_1 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct3 : Πc2.ΠP:Prop.ch_2 = c2 → match c2 with [ ch_2 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##3: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_2 with [ ch_2 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct4 : Πc2.ΠP:Prop.ch_3 = c2 → match c2 with [ ch_3 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##4: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_3 with [ ch_3 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct5 : Πc2.ΠP:Prop.ch_4 = c2 → match c2 with [ ch_4 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##5: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_4 with [ ch_4 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct6 : Πc2.ΠP:Prop.ch_5 = c2 → match c2 with [ ch_5 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##6: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_5 with [ ch_5 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct7 : Πc2.ΠP:Prop.ch_6 = c2 → match c2 with [ ch_6 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##7: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_6 with [ ch_6 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct8 : Πc2.ΠP:Prop.ch_7 = c2 → match c2 with [ ch_7 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##8: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_7 with [ ch_7 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct9 : Πc2.ΠP:Prop.ch_8 = c2 → match c2 with [ ch_8 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##9: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_8 with [ ch_8 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct10 : Πc2.ΠP:Prop.ch_9 = c2 → match c2 with [ ch_9 ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##10: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_9 with [ ch_9 ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct11 : Πc2.ΠP:Prop.ch__ = c2 → match c2 with [ ch__ ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##11: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch__ with [ ch__ ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct12 : Πc2.ΠP:Prop.ch_A = c2 → match c2 with [ ch_A ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##12: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_A with [ ch_A ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct13 : Πc2.ΠP:Prop.ch_B = c2 → match c2 with [ ch_B ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##13: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_B with [ ch_B ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct14 : Πc2.ΠP:Prop.ch_C = c2 → match c2 with [ ch_C ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##14: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_C with [ ch_C ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct15 : Πc2.ΠP:Prop.ch_D = c2 → match c2 with [ ch_D ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##15: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_D with [ ch_D ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct16 : Πc2.ΠP:Prop.ch_E = c2 → match c2 with [ ch_E ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##16: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_E with [ ch_E ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct17 : Πc2.ΠP:Prop.ch_F = c2 → match c2 with [ ch_F ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##17: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_F with [ ch_F ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct18 : Πc2.ΠP:Prop.ch_G = c2 → match c2 with [ ch_G ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##18: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_G with [ ch_G ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct19 : Πc2.ΠP:Prop.ch_H = c2 → match c2 with [ ch_H ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##19: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_H with [ ch_H ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct20 : Πc2.ΠP:Prop.ch_I = c2 → match c2 with [ ch_I ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##20: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_I with [ ch_I ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct21 : Πc2.ΠP:Prop.ch_J = c2 → match c2 with [ ch_J ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##21: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_J with [ ch_J ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct22 : Πc2.ΠP:Prop.ch_K = c2 → match c2 with [ ch_K ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##22: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_K with [ ch_K ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct23 : Πc2.ΠP:Prop.ch_L = c2 → match c2 with [ ch_L ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##23: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_L with [ ch_L ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct24 : Πc2.ΠP:Prop.ch_M = c2 → match c2 with [ ch_M ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##24: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_M with [ ch_M ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct25 : Πc2.ΠP:Prop.ch_N = c2 → match c2 with [ ch_N ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##25: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_N with [ ch_N ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct26 : Πc2.ΠP:Prop.ch_O = c2 → match c2 with [ ch_O ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##26: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_O with [ ch_O ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct27 : Πc2.ΠP:Prop.ch_P = c2 → match c2 with [ ch_P ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##27: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_P with [ ch_P ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct28 : Πc2.ΠP:Prop.ch_Q = c2 → match c2 with [ ch_Q ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##28: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_Q with [ ch_Q ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct29 : Πc2.ΠP:Prop.ch_R = c2 → match c2 with [ ch_R ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##29: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_R with [ ch_R ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct30 : Πc2.ΠP:Prop.ch_S = c2 → match c2 with [ ch_S ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##30: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_S with [ ch_S ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct31 : Πc2.ΠP:Prop.ch_T = c2 → match c2 with [ ch_T ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##31: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_T with [ ch_T ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct32 : Πc2.ΠP:Prop.ch_U = c2 → match c2 with [ ch_U ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##32: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_U with [ ch_U ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct33 : Πc2.ΠP:Prop.ch_V = c2 → match c2 with [ ch_V ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##33: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_V with [ ch_V ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct34 : Πc2.ΠP:Prop.ch_W = c2 → match c2 with [ ch_W ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##34: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_W with [ ch_W ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct35 : Πc2.ΠP:Prop.ch_X = c2 → match c2 with [ ch_X ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##35: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_X with [ ch_X ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct36 : Πc2.ΠP:Prop.ch_Y = c2 → match c2 with [ ch_Y ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##36: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_Y with [ ch_Y ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct37 : Πc2.ΠP:Prop.ch_Z = c2 → match c2 with [ ch_Z ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##37: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_Z with [ ch_Z ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct38 : Πc2.ΠP:Prop.ch_a = c2 → match c2 with [ ch_a ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##38: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_a with [ ch_a ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct39 : Πc2.ΠP:Prop.ch_b = c2 → match c2 with [ ch_b ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##39: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_b with [ ch_b ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct40 : Πc2.ΠP:Prop.ch_c = c2 → match c2 with [ ch_c ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##40: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_c with [ ch_c ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct41 : Πc2.ΠP:Prop.ch_d = c2 → match c2 with [ ch_d ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##41: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_d with [ ch_d ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct42 : Πc2.ΠP:Prop.ch_e = c2 → match c2 with [ ch_e ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##42: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_e with [ ch_e ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct43 : Πc2.ΠP:Prop.ch_f = c2 → match c2 with [ ch_f ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##43: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_f with [ ch_f ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct44 : Πc2.ΠP:Prop.ch_g = c2 → match c2 with [ ch_g ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##44: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_g with [ ch_g ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct45 : Πc2.ΠP:Prop.ch_h = c2 → match c2 with [ ch_h ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##45: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_h with [ ch_h ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct46 : Πc2.ΠP:Prop.ch_i = c2 → match c2 with [ ch_i ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##46: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_i with [ ch_i ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct47 : Πc2.ΠP:Prop.ch_j = c2 → match c2 with [ ch_j ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##47: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_j with [ ch_j ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct48 : Πc2.ΠP:Prop.ch_k = c2 → match c2 with [ ch_k ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##48: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_k with [ ch_k ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct49 : Πc2.ΠP:Prop.ch_l = c2 → match c2 with [ ch_l ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##49: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_l with [ ch_l ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct50 : Πc2.ΠP:Prop.ch_m = c2 → match c2 with [ ch_m ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##50: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_m with [ ch_m ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct51 : Πc2.ΠP:Prop.ch_n = c2 → match c2 with [ ch_n ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##51: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_n with [ ch_n ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct52 : Πc2.ΠP:Prop.ch_o = c2 → match c2 with [ ch_o ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##52: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_o with [ ch_o ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct53 : Πc2.ΠP:Prop.ch_p = c2 → match c2 with [ ch_p ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##53: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_p with [ ch_p ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct54 : Πc2.ΠP:Prop.ch_q = c2 → match c2 with [ ch_q ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##54: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_q with [ ch_q ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct55 : Πc2.ΠP:Prop.ch_r = c2 → match c2 with [ ch_r ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##55: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_r with [ ch_r ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct56 : Πc2.ΠP:Prop.ch_s = c2 → match c2 with [ ch_s ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##56: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_s with [ ch_s ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct57 : Πc2.ΠP:Prop.ch_t = c2 → match c2 with [ ch_t ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##57: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_t with [ ch_t ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct58 : Πc2.ΠP:Prop.ch_u = c2 → match c2 with [ ch_u ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##58: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_u with [ ch_u ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct59 : Πc2.ΠP:Prop.ch_v = c2 → match c2 with [ ch_v ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##59: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_v with [ ch_v ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct60 : Πc2.ΠP:Prop.ch_w = c2 → match c2 with [ ch_w ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##60: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_w with [ ch_w ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct61 : Πc2.ΠP:Prop.ch_x = c2 → match c2 with [ ch_x ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##61: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_x with [ ch_x ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct62 : Πc2.ΠP:Prop.ch_y = c2 → match c2 with [ ch_y ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##62: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_y with [ ch_y ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct63 : Πc2.ΠP:Prop.ch_z = c2 → match c2 with [ ch_z ⇒ P → P | _ ⇒ P ].
- #c2; #P; ncases c2; nnormalize;
- ##[ ##63: #H; napply (λx:P.x)
- ##| ##*: #H; napply (False_ind (λ_.?) ?); nchange with (match ch_z with [ ch_z ⇒ False | _ ⇒ True ]); nrewrite > H; nnormalize; napply I
- ##]
-nqed.
-
-ndefinition ascii_destruct_aux ≝
-Πc1,c2.ΠP:Prop.c1 = c2 →
- match c1 with
- [ ch_0 ⇒ match c2 with [ ch_0 ⇒ P → P | _ ⇒ P ] | ch_1 ⇒ match c2 with [ ch_1 ⇒ P → P | _ ⇒ P ]
- | ch_2 ⇒ match c2 with [ ch_2 ⇒ P → P | _ ⇒ P ] | ch_3 ⇒ match c2 with [ ch_3 ⇒ P → P | _ ⇒ P ]
- | ch_4 ⇒ match c2 with [ ch_4 ⇒ P → P | _ ⇒ P ] | ch_5 ⇒ match c2 with [ ch_5 ⇒ P → P | _ ⇒ P ]
- | ch_6 ⇒ match c2 with [ ch_6 ⇒ P → P | _ ⇒ P ] | ch_7 ⇒ match c2 with [ ch_7 ⇒ P → P | _ ⇒ P ]
- | ch_8 ⇒ match c2 with [ ch_8 ⇒ P → P | _ ⇒ P ] | ch_9 ⇒ match c2 with [ ch_9 ⇒ P → P | _ ⇒ P ]
- | ch__ ⇒ match c2 with [ ch__ ⇒ P → P | _ ⇒ P ] | ch_A ⇒ match c2 with [ ch_A ⇒ P → P | _ ⇒ P ]
- | ch_B ⇒ match c2 with [ ch_B ⇒ P → P | _ ⇒ P ] | ch_C ⇒ match c2 with [ ch_C ⇒ P → P | _ ⇒ P ]
- | ch_D ⇒ match c2 with [ ch_D ⇒ P → P | _ ⇒ P ] | ch_E ⇒ match c2 with [ ch_E ⇒ P → P | _ ⇒ P ]
- | ch_F ⇒ match c2 with [ ch_F ⇒ P → P | _ ⇒ P ] | ch_G ⇒ match c2 with [ ch_G ⇒ P → P | _ ⇒ P ]
- | ch_H ⇒ match c2 with [ ch_H ⇒ P → P | _ ⇒ P ] | ch_I ⇒ match c2 with [ ch_I ⇒ P → P | _ ⇒ P ]
- | ch_J ⇒ match c2 with [ ch_J ⇒ P → P | _ ⇒ P ] | ch_K ⇒ match c2 with [ ch_K ⇒ P → P | _ ⇒ P ]
- | ch_L ⇒ match c2 with [ ch_L ⇒ P → P | _ ⇒ P ] | ch_M ⇒ match c2 with [ ch_M ⇒ P → P | _ ⇒ P ]
- | ch_N ⇒ match c2 with [ ch_N ⇒ P → P | _ ⇒ P ] | ch_O ⇒ match c2 with [ ch_O ⇒ P → P | _ ⇒ P ]
- | ch_P ⇒ match c2 with [ ch_P ⇒ P → P | _ ⇒ P ] | ch_Q ⇒ match c2 with [ ch_Q ⇒ P → P | _ ⇒ P ]
- | ch_R ⇒ match c2 with [ ch_R ⇒ P → P | _ ⇒ P ] | ch_S ⇒ match c2 with [ ch_S ⇒ P → P | _ ⇒ P ]
- | ch_T ⇒ match c2 with [ ch_T ⇒ P → P | _ ⇒ P ] | ch_U ⇒ match c2 with [ ch_U ⇒ P → P | _ ⇒ P ]
- | ch_V ⇒ match c2 with [ ch_V ⇒ P → P | _ ⇒ P ] | ch_W ⇒ match c2 with [ ch_W ⇒ P → P | _ ⇒ P ]
- | ch_X ⇒ match c2 with [ ch_X ⇒ P → P | _ ⇒ P ] | ch_Y ⇒ match c2 with [ ch_Y ⇒ P → P | _ ⇒ P ]
- | ch_Z ⇒ match c2 with [ ch_Z ⇒ P → P | _ ⇒ P ] | ch_a ⇒ match c2 with [ ch_a ⇒ P → P | _ ⇒ P ]
- | ch_b ⇒ match c2 with [ ch_b ⇒ P → P | _ ⇒ P ] | ch_c ⇒ match c2 with [ ch_c ⇒ P → P | _ ⇒ P ]
- | ch_d ⇒ match c2 with [ ch_d ⇒ P → P | _ ⇒ P ] | ch_e ⇒ match c2 with [ ch_e ⇒ P → P | _ ⇒ P ]
- | ch_f ⇒ match c2 with [ ch_f ⇒ P → P | _ ⇒ P ] | ch_g ⇒ match c2 with [ ch_g ⇒ P → P | _ ⇒ P ]
- | ch_h ⇒ match c2 with [ ch_h ⇒ P → P | _ ⇒ P ] | ch_i ⇒ match c2 with [ ch_i ⇒ P → P | _ ⇒ P ]
- | ch_j ⇒ match c2 with [ ch_j ⇒ P → P | _ ⇒ P ] | ch_k ⇒ match c2 with [ ch_k ⇒ P → P | _ ⇒ P ]
- | ch_l ⇒ match c2 with [ ch_l ⇒ P → P | _ ⇒ P ] | ch_m ⇒ match c2 with [ ch_m ⇒ P → P | _ ⇒ P ]
- | ch_n ⇒ match c2 with [ ch_n ⇒ P → P | _ ⇒ P ] | ch_o ⇒ match c2 with [ ch_o ⇒ P → P | _ ⇒ P ]
- | ch_p ⇒ match c2 with [ ch_p ⇒ P → P | _ ⇒ P ] | ch_q ⇒ match c2 with [ ch_q ⇒ P → P | _ ⇒ P ]
- | ch_r ⇒ match c2 with [ ch_r ⇒ P → P | _ ⇒ P ] | ch_s ⇒ match c2 with [ ch_s ⇒ P → P | _ ⇒ P ]
- | ch_t ⇒ match c2 with [ ch_t ⇒ P → P | _ ⇒ P ] | ch_u ⇒ match c2 with [ ch_u ⇒ P → P | _ ⇒ P ]
- | ch_v ⇒ match c2 with [ ch_v ⇒ P → P | _ ⇒ P ] | ch_w ⇒ match c2 with [ ch_w ⇒ P → P | _ ⇒ P ]
- | ch_x ⇒ match c2 with [ ch_x ⇒ P → P | _ ⇒ P ] | ch_y ⇒ match c2 with [ ch_y ⇒ P → P | _ ⇒ P ]
- | ch_z ⇒ match c2 with [ ch_z ⇒ P → P | _ ⇒ P ]].
-
-nlemma ascii_destruct : ascii_destruct_aux.
- #c1; ncases c1;
- ##[ ##1: napply ascii_destruct1 ##| ##2: napply ascii_destruct2
- ##| ##3: napply ascii_destruct3 ##| ##4: napply ascii_destruct4
- ##| ##5: napply ascii_destruct5 ##| ##6: napply ascii_destruct6
- ##| ##7: napply ascii_destruct7 ##| ##8: napply ascii_destruct8
- ##| ##9: napply ascii_destruct9 ##| ##10: napply ascii_destruct10
- ##| ##11: napply ascii_destruct11 ##| ##12: napply ascii_destruct12
- ##| ##13: napply ascii_destruct13 ##| ##14: napply ascii_destruct14
- ##| ##15: napply ascii_destruct15 ##| ##16: napply ascii_destruct16
- ##| ##17: napply ascii_destruct17 ##| ##18: napply ascii_destruct18
- ##| ##19: napply ascii_destruct19 ##| ##20: napply ascii_destruct20
- ##| ##21: napply ascii_destruct21 ##| ##22: napply ascii_destruct22
- ##| ##23: napply ascii_destruct23 ##| ##24: napply ascii_destruct24
- ##| ##25: napply ascii_destruct25 ##| ##26: napply ascii_destruct26
- ##| ##27: napply ascii_destruct27 ##| ##28: napply ascii_destruct28
- ##| ##29: napply ascii_destruct29 ##| ##30: napply ascii_destruct30
- ##| ##31: napply ascii_destruct31 ##| ##32: napply ascii_destruct32
- ##| ##33: napply ascii_destruct33 ##| ##34: napply ascii_destruct34
- ##| ##35: napply ascii_destruct35 ##| ##36: napply ascii_destruct36
- ##| ##37: napply ascii_destruct37 ##| ##38: napply ascii_destruct38
- ##| ##39: napply ascii_destruct39 ##| ##40: napply ascii_destruct40
- ##| ##41: napply ascii_destruct41 ##| ##42: napply ascii_destruct42
- ##| ##43: napply ascii_destruct43 ##| ##44: napply ascii_destruct44
- ##| ##45: napply ascii_destruct45 ##| ##46: napply ascii_destruct46
- ##| ##47: napply ascii_destruct47 ##| ##48: napply ascii_destruct48
- ##| ##49: napply ascii_destruct49 ##| ##50: napply ascii_destruct50
- ##| ##51: napply ascii_destruct51 ##| ##52: napply ascii_destruct52
- ##| ##53: napply ascii_destruct53 ##| ##54: napply ascii_destruct54
- ##| ##55: napply ascii_destruct55 ##| ##56: napply ascii_destruct56
- ##| ##57: napply ascii_destruct57 ##| ##58: napply ascii_destruct58
- ##| ##59: napply ascii_destruct59 ##| ##60: napply ascii_destruct60
- ##| ##61: napply ascii_destruct61 ##| ##62: napply ascii_destruct62
- ##| ##63: napply ascii_destruct63 ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/ascii_lemmas1.ma".
-include "freescale/bool_lemmas.ma".
-
-(* ************************** *)
-(* DEFINIZIONE ASCII MINIMALE *)
-(* ************************** *)
-
-nlemma symmetric_eqascii1 : ∀a2.eq_ascii ch_0 a2 = eq_ascii a2 ch_0. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii2 : ∀a2.eq_ascii ch_1 a2 = eq_ascii a2 ch_1. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii3 : ∀a2.eq_ascii ch_2 a2 = eq_ascii a2 ch_2. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii4 : ∀a2.eq_ascii ch_3 a2 = eq_ascii a2 ch_3. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii5 : ∀a2.eq_ascii ch_4 a2 = eq_ascii a2 ch_4. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii6 : ∀a2.eq_ascii ch_5 a2 = eq_ascii a2 ch_5. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii7 : ∀a2.eq_ascii ch_6 a2 = eq_ascii a2 ch_6. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii8 : ∀a2.eq_ascii ch_7 a2 = eq_ascii a2 ch_7. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii9 : ∀a2.eq_ascii ch_8 a2 = eq_ascii a2 ch_8. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii10 : ∀a2.eq_ascii ch_9 a2 = eq_ascii a2 ch_9. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii11 : ∀a2.eq_ascii ch__ a2 = eq_ascii a2 ch__. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii12 : ∀a2.eq_ascii ch_A a2 = eq_ascii a2 ch_A. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii13 : ∀a2.eq_ascii ch_B a2 = eq_ascii a2 ch_B. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii14 : ∀a2.eq_ascii ch_C a2 = eq_ascii a2 ch_C. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii15 : ∀a2.eq_ascii ch_D a2 = eq_ascii a2 ch_D. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii16 : ∀a2.eq_ascii ch_E a2 = eq_ascii a2 ch_E. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii17 : ∀a2.eq_ascii ch_F a2 = eq_ascii a2 ch_F. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii18 : ∀a2.eq_ascii ch_G a2 = eq_ascii a2 ch_G. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii19 : ∀a2.eq_ascii ch_H a2 = eq_ascii a2 ch_H. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii20 : ∀a2.eq_ascii ch_I a2 = eq_ascii a2 ch_I. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii21 : ∀a2.eq_ascii ch_J a2 = eq_ascii a2 ch_J. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii22 : ∀a2.eq_ascii ch_K a2 = eq_ascii a2 ch_K. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii23 : ∀a2.eq_ascii ch_L a2 = eq_ascii a2 ch_L. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii24 : ∀a2.eq_ascii ch_M a2 = eq_ascii a2 ch_M. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii25 : ∀a2.eq_ascii ch_N a2 = eq_ascii a2 ch_N. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii26 : ∀a2.eq_ascii ch_O a2 = eq_ascii a2 ch_O. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii27 : ∀a2.eq_ascii ch_P a2 = eq_ascii a2 ch_P. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii28 : ∀a2.eq_ascii ch_Q a2 = eq_ascii a2 ch_Q. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii29 : ∀a2.eq_ascii ch_R a2 = eq_ascii a2 ch_R. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii30 : ∀a2.eq_ascii ch_S a2 = eq_ascii a2 ch_S. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii31 : ∀a2.eq_ascii ch_T a2 = eq_ascii a2 ch_T. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii32 : ∀a2.eq_ascii ch_U a2 = eq_ascii a2 ch_U. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii33 : ∀a2.eq_ascii ch_V a2 = eq_ascii a2 ch_V. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii34 : ∀a2.eq_ascii ch_W a2 = eq_ascii a2 ch_W. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii35 : ∀a2.eq_ascii ch_X a2 = eq_ascii a2 ch_X. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii36 : ∀a2.eq_ascii ch_Y a2 = eq_ascii a2 ch_Y. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii37 : ∀a2.eq_ascii ch_Z a2 = eq_ascii a2 ch_Z. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii38 : ∀a2.eq_ascii ch_a a2 = eq_ascii a2 ch_a. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii39 : ∀a2.eq_ascii ch_b a2 = eq_ascii a2 ch_b. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii40 : ∀a2.eq_ascii ch_c a2 = eq_ascii a2 ch_c. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii41 : ∀a2.eq_ascii ch_d a2 = eq_ascii a2 ch_d. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii42 : ∀a2.eq_ascii ch_e a2 = eq_ascii a2 ch_e. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii43 : ∀a2.eq_ascii ch_f a2 = eq_ascii a2 ch_f. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii44 : ∀a2.eq_ascii ch_g a2 = eq_ascii a2 ch_g. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii45 : ∀a2.eq_ascii ch_h a2 = eq_ascii a2 ch_h. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii46 : ∀a2.eq_ascii ch_i a2 = eq_ascii a2 ch_i. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii47 : ∀a2.eq_ascii ch_j a2 = eq_ascii a2 ch_j. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii48 : ∀a2.eq_ascii ch_k a2 = eq_ascii a2 ch_k. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii49 : ∀a2.eq_ascii ch_l a2 = eq_ascii a2 ch_l. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii50 : ∀a2.eq_ascii ch_m a2 = eq_ascii a2 ch_m. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii51 : ∀a2.eq_ascii ch_n a2 = eq_ascii a2 ch_n. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii52 : ∀a2.eq_ascii ch_o a2 = eq_ascii a2 ch_o. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii53 : ∀a2.eq_ascii ch_p a2 = eq_ascii a2 ch_p. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii54 : ∀a2.eq_ascii ch_q a2 = eq_ascii a2 ch_q. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii55 : ∀a2.eq_ascii ch_r a2 = eq_ascii a2 ch_r. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii56 : ∀a2.eq_ascii ch_s a2 = eq_ascii a2 ch_s. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii57 : ∀a2.eq_ascii ch_t a2 = eq_ascii a2 ch_t. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii58 : ∀a2.eq_ascii ch_u a2 = eq_ascii a2 ch_u. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii59 : ∀a2.eq_ascii ch_v a2 = eq_ascii a2 ch_v. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii60 : ∀a2.eq_ascii ch_w a2 = eq_ascii a2 ch_w. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii61 : ∀a2.eq_ascii ch_x a2 = eq_ascii a2 ch_x. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii62 : ∀a2.eq_ascii ch_y a2 = eq_ascii a2 ch_y. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-nlemma symmetric_eqascii63 : ∀a2.eq_ascii ch_z a2 = eq_ascii a2 ch_z. #a2; ncases a2; nnormalize; napply refl_eq.nqed.
-
-nlemma symmetric_eqascii : symmetricT ascii bool eq_ascii.
- #a1; ncases a1;
- ##[ ##1: napply symmetric_eqascii1 ##| ##2: napply symmetric_eqascii2
- ##| ##3: napply symmetric_eqascii3 ##| ##4: napply symmetric_eqascii4
- ##| ##5: napply symmetric_eqascii5 ##| ##6: napply symmetric_eqascii6
- ##| ##7: napply symmetric_eqascii7 ##| ##8: napply symmetric_eqascii8
- ##| ##9: napply symmetric_eqascii9 ##| ##10: napply symmetric_eqascii10
- ##| ##11: napply symmetric_eqascii11 ##| ##12: napply symmetric_eqascii12
- ##| ##13: napply symmetric_eqascii13 ##| ##14: napply symmetric_eqascii14
- ##| ##15: napply symmetric_eqascii15 ##| ##16: napply symmetric_eqascii16
- ##| ##17: napply symmetric_eqascii17 ##| ##18: napply symmetric_eqascii18
- ##| ##19: napply symmetric_eqascii19 ##| ##20: napply symmetric_eqascii20
- ##| ##21: napply symmetric_eqascii21 ##| ##22: napply symmetric_eqascii22
- ##| ##23: napply symmetric_eqascii23 ##| ##24: napply symmetric_eqascii24
- ##| ##25: napply symmetric_eqascii25 ##| ##26: napply symmetric_eqascii26
- ##| ##27: napply symmetric_eqascii27 ##| ##28: napply symmetric_eqascii28
- ##| ##29: napply symmetric_eqascii29 ##| ##30: napply symmetric_eqascii30
- ##| ##31: napply symmetric_eqascii31 ##| ##32: napply symmetric_eqascii32
- ##| ##33: napply symmetric_eqascii33 ##| ##34: napply symmetric_eqascii34
- ##| ##35: napply symmetric_eqascii35 ##| ##36: napply symmetric_eqascii36
- ##| ##37: napply symmetric_eqascii37 ##| ##38: napply symmetric_eqascii38
- ##| ##39: napply symmetric_eqascii39 ##| ##40: napply symmetric_eqascii40
- ##| ##41: napply symmetric_eqascii41 ##| ##42: napply symmetric_eqascii42
- ##| ##43: napply symmetric_eqascii43 ##| ##44: napply symmetric_eqascii44
- ##| ##45: napply symmetric_eqascii45 ##| ##46: napply symmetric_eqascii46
- ##| ##47: napply symmetric_eqascii47 ##| ##48: napply symmetric_eqascii48
- ##| ##49: napply symmetric_eqascii49 ##| ##50: napply symmetric_eqascii50
- ##| ##51: napply symmetric_eqascii51 ##| ##52: napply symmetric_eqascii52
- ##| ##53: napply symmetric_eqascii53 ##| ##54: napply symmetric_eqascii54
- ##| ##55: napply symmetric_eqascii55 ##| ##56: napply symmetric_eqascii56
- ##| ##57: napply symmetric_eqascii57 ##| ##58: napply symmetric_eqascii58
- ##| ##59: napply symmetric_eqascii59 ##| ##60: napply symmetric_eqascii60
- ##| ##61: napply symmetric_eqascii61 ##| ##62: napply symmetric_eqascii62
- ##| ##63: napply symmetric_eqascii63 ##]
-nqed.
-
-nlemma eqascii_to_eq1 : ∀a2.eq_ascii ch_0 a2 = true → ch_0 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##1: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq2 : ∀a2.eq_ascii ch_1 a2 = true → ch_1 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##2: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq3 : ∀a2.eq_ascii ch_2 a2 = true → ch_2 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##3: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq4 : ∀a2.eq_ascii ch_3 a2 = true → ch_3 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##4: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq5 : ∀a2.eq_ascii ch_4 a2 = true → ch_4 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##5: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq6 : ∀a2.eq_ascii ch_5 a2 = true → ch_5 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##6: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq7 : ∀a2.eq_ascii ch_6 a2 = true → ch_6 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##7: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq8 : ∀a2.eq_ascii ch_7 a2 = true → ch_7 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##8: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq9 : ∀a2.eq_ascii ch_8 a2 = true → ch_8 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##9: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq10 : ∀a2.eq_ascii ch_9 a2 = true → ch_9 = a2. #a2; ncases a2; nnormalize; #H; ##[ ##10: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq11 : ∀a2.eq_ascii ch__ a2 = true → ch__ = a2. #a2; ncases a2; nnormalize; #H; ##[ ##11: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq12 : ∀a2.eq_ascii ch_A a2 = true → ch_A = a2. #a2; ncases a2; nnormalize; #H; ##[ ##12: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq13 : ∀a2.eq_ascii ch_B a2 = true → ch_B = a2. #a2; ncases a2; nnormalize; #H; ##[ ##13: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq14 : ∀a2.eq_ascii ch_C a2 = true → ch_C = a2. #a2; ncases a2; nnormalize; #H; ##[ ##14: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq15 : ∀a2.eq_ascii ch_D a2 = true → ch_D = a2. #a2; ncases a2; nnormalize; #H; ##[ ##15: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq16 : ∀a2.eq_ascii ch_E a2 = true → ch_E = a2. #a2; ncases a2; nnormalize; #H; ##[ ##16: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq17 : ∀a2.eq_ascii ch_F a2 = true → ch_F = a2. #a2; ncases a2; nnormalize; #H; ##[ ##17: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq18 : ∀a2.eq_ascii ch_G a2 = true → ch_G = a2. #a2; ncases a2; nnormalize; #H; ##[ ##18: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq19 : ∀a2.eq_ascii ch_H a2 = true → ch_H = a2. #a2; ncases a2; nnormalize; #H; ##[ ##19: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq20 : ∀a2.eq_ascii ch_I a2 = true → ch_I = a2. #a2; ncases a2; nnormalize; #H; ##[ ##20: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq21 : ∀a2.eq_ascii ch_J a2 = true → ch_J = a2. #a2; ncases a2; nnormalize; #H; ##[ ##21: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq22 : ∀a2.eq_ascii ch_K a2 = true → ch_K = a2. #a2; ncases a2; nnormalize; #H; ##[ ##22: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq23 : ∀a2.eq_ascii ch_L a2 = true → ch_L = a2. #a2; ncases a2; nnormalize; #H; ##[ ##23: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq24 : ∀a2.eq_ascii ch_M a2 = true → ch_M = a2. #a2; ncases a2; nnormalize; #H; ##[ ##24: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq25 : ∀a2.eq_ascii ch_N a2 = true → ch_N = a2. #a2; ncases a2; nnormalize; #H; ##[ ##25: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq26 : ∀a2.eq_ascii ch_O a2 = true → ch_O = a2. #a2; ncases a2; nnormalize; #H; ##[ ##26: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq27 : ∀a2.eq_ascii ch_P a2 = true → ch_P = a2. #a2; ncases a2; nnormalize; #H; ##[ ##27: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq28 : ∀a2.eq_ascii ch_Q a2 = true → ch_Q = a2. #a2; ncases a2; nnormalize; #H; ##[ ##28: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq29 : ∀a2.eq_ascii ch_R a2 = true → ch_R = a2. #a2; ncases a2; nnormalize; #H; ##[ ##29: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq30 : ∀a2.eq_ascii ch_S a2 = true → ch_S = a2. #a2; ncases a2; nnormalize; #H; ##[ ##30: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq31 : ∀a2.eq_ascii ch_T a2 = true → ch_T = a2. #a2; ncases a2; nnormalize; #H; ##[ ##31: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq32 : ∀a2.eq_ascii ch_U a2 = true → ch_U = a2. #a2; ncases a2; nnormalize; #H; ##[ ##32: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq33 : ∀a2.eq_ascii ch_V a2 = true → ch_V = a2. #a2; ncases a2; nnormalize; #H; ##[ ##33: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq34 : ∀a2.eq_ascii ch_W a2 = true → ch_W = a2. #a2; ncases a2; nnormalize; #H; ##[ ##34: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq35 : ∀a2.eq_ascii ch_X a2 = true → ch_X = a2. #a2; ncases a2; nnormalize; #H; ##[ ##35: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq36 : ∀a2.eq_ascii ch_Y a2 = true → ch_Y = a2. #a2; ncases a2; nnormalize; #H; ##[ ##36: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq37 : ∀a2.eq_ascii ch_Z a2 = true → ch_Z = a2. #a2; ncases a2; nnormalize; #H; ##[ ##37: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq38 : ∀a2.eq_ascii ch_a a2 = true → ch_a = a2. #a2; ncases a2; nnormalize; #H; ##[ ##38: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq39 : ∀a2.eq_ascii ch_b a2 = true → ch_b = a2. #a2; ncases a2; nnormalize; #H; ##[ ##39: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq40 : ∀a2.eq_ascii ch_c a2 = true → ch_c = a2. #a2; ncases a2; nnormalize; #H; ##[ ##40: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq41 : ∀a2.eq_ascii ch_d a2 = true → ch_d = a2. #a2; ncases a2; nnormalize; #H; ##[ ##41: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq42 : ∀a2.eq_ascii ch_e a2 = true → ch_e = a2. #a2; ncases a2; nnormalize; #H; ##[ ##42: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq43 : ∀a2.eq_ascii ch_f a2 = true → ch_f = a2. #a2; ncases a2; nnormalize; #H; ##[ ##43: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq44 : ∀a2.eq_ascii ch_g a2 = true → ch_g = a2. #a2; ncases a2; nnormalize; #H; ##[ ##44: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq45 : ∀a2.eq_ascii ch_h a2 = true → ch_h = a2. #a2; ncases a2; nnormalize; #H; ##[ ##45: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq46 : ∀a2.eq_ascii ch_i a2 = true → ch_i = a2. #a2; ncases a2; nnormalize; #H; ##[ ##46: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq47 : ∀a2.eq_ascii ch_j a2 = true → ch_j = a2. #a2; ncases a2; nnormalize; #H; ##[ ##47: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq48 : ∀a2.eq_ascii ch_k a2 = true → ch_k = a2. #a2; ncases a2; nnormalize; #H; ##[ ##48: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq49 : ∀a2.eq_ascii ch_l a2 = true → ch_l = a2. #a2; ncases a2; nnormalize; #H; ##[ ##49: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq50 : ∀a2.eq_ascii ch_m a2 = true → ch_m = a2. #a2; ncases a2; nnormalize; #H; ##[ ##50: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq51 : ∀a2.eq_ascii ch_n a2 = true → ch_n = a2. #a2; ncases a2; nnormalize; #H; ##[ ##51: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq52 : ∀a2.eq_ascii ch_o a2 = true → ch_o = a2. #a2; ncases a2; nnormalize; #H; ##[ ##52: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq53 : ∀a2.eq_ascii ch_p a2 = true → ch_p = a2. #a2; ncases a2; nnormalize; #H; ##[ ##53: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq54 : ∀a2.eq_ascii ch_q a2 = true → ch_q = a2. #a2; ncases a2; nnormalize; #H; ##[ ##54: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq55 : ∀a2.eq_ascii ch_r a2 = true → ch_r = a2. #a2; ncases a2; nnormalize; #H; ##[ ##55: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq56 : ∀a2.eq_ascii ch_s a2 = true → ch_s = a2. #a2; ncases a2; nnormalize; #H; ##[ ##56: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq57 : ∀a2.eq_ascii ch_t a2 = true → ch_t = a2. #a2; ncases a2; nnormalize; #H; ##[ ##57: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq58 : ∀a2.eq_ascii ch_u a2 = true → ch_u = a2. #a2; ncases a2; nnormalize; #H; ##[ ##58: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq59 : ∀a2.eq_ascii ch_v a2 = true → ch_v = a2. #a2; ncases a2; nnormalize; #H; ##[ ##59: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq60 : ∀a2.eq_ascii ch_w a2 = true → ch_w = a2. #a2; ncases a2; nnormalize; #H; ##[ ##60: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq61 : ∀a2.eq_ascii ch_x a2 = true → ch_x = a2. #a2; ncases a2; nnormalize; #H; ##[ ##61: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq62 : ∀a2.eq_ascii ch_y a2 = true → ch_y = a2. #a2; ncases a2; nnormalize; #H; ##[ ##62: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-nlemma eqascii_to_eq63 : ∀a2.eq_ascii ch_z a2 = true → ch_z = a2. #a2; ncases a2; nnormalize; #H; ##[ ##63: napply refl_eq | ##*: napply (bool_destruct … H) ##] nqed.
-
-nlemma eqascii_to_eq : ∀c1,c2.eq_ascii c1 c2 = true → c1 = c2.
- #c1; ncases c1;
- ##[ ##1: napply eqascii_to_eq1 ##| ##2: napply eqascii_to_eq2
- ##| ##3: napply eqascii_to_eq3 ##| ##4: napply eqascii_to_eq4
- ##| ##5: napply eqascii_to_eq5 ##| ##6: napply eqascii_to_eq6
- ##| ##7: napply eqascii_to_eq7 ##| ##8: napply eqascii_to_eq8
- ##| ##9: napply eqascii_to_eq9 ##| ##10: napply eqascii_to_eq10
- ##| ##11: napply eqascii_to_eq11 ##| ##12: napply eqascii_to_eq12
- ##| ##13: napply eqascii_to_eq13 ##| ##14: napply eqascii_to_eq14
- ##| ##15: napply eqascii_to_eq15 ##| ##16: napply eqascii_to_eq16
- ##| ##17: napply eqascii_to_eq17 ##| ##18: napply eqascii_to_eq18
- ##| ##19: napply eqascii_to_eq19 ##| ##20: napply eqascii_to_eq20
- ##| ##21: napply eqascii_to_eq21 ##| ##22: napply eqascii_to_eq22
- ##| ##23: napply eqascii_to_eq23 ##| ##24: napply eqascii_to_eq24
- ##| ##25: napply eqascii_to_eq25 ##| ##26: napply eqascii_to_eq26
- ##| ##27: napply eqascii_to_eq27 ##| ##28: napply eqascii_to_eq28
- ##| ##29: napply eqascii_to_eq29 ##| ##30: napply eqascii_to_eq30
- ##| ##31: napply eqascii_to_eq31 ##| ##32: napply eqascii_to_eq32
- ##| ##33: napply eqascii_to_eq33 ##| ##34: napply eqascii_to_eq34
- ##| ##35: napply eqascii_to_eq35 ##| ##36: napply eqascii_to_eq36
- ##| ##37: napply eqascii_to_eq37 ##| ##38: napply eqascii_to_eq38
- ##| ##39: napply eqascii_to_eq39 ##| ##40: napply eqascii_to_eq40
- ##| ##41: napply eqascii_to_eq41 ##| ##42: napply eqascii_to_eq42
- ##| ##43: napply eqascii_to_eq43 ##| ##44: napply eqascii_to_eq44
- ##| ##45: napply eqascii_to_eq45 ##| ##46: napply eqascii_to_eq46
- ##| ##47: napply eqascii_to_eq47 ##| ##48: napply eqascii_to_eq48
- ##| ##49: napply eqascii_to_eq49 ##| ##50: napply eqascii_to_eq50
- ##| ##51: napply eqascii_to_eq51 ##| ##52: napply eqascii_to_eq52
- ##| ##53: napply eqascii_to_eq53 ##| ##54: napply eqascii_to_eq54
- ##| ##55: napply eqascii_to_eq55 ##| ##56: napply eqascii_to_eq56
- ##| ##57: napply eqascii_to_eq57 ##| ##58: napply eqascii_to_eq58
- ##| ##59: napply eqascii_to_eq59 ##| ##60: napply eqascii_to_eq60
- ##| ##61: napply eqascii_to_eq61 ##| ##62: napply eqascii_to_eq62
- ##| ##63: napply eqascii_to_eq63 ##]
-nqed.
-
-nlemma eq_to_eqascii1 : ∀a2.ch_0 = a2 → eq_ascii ch_0 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##1: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii2 : ∀a2.ch_1 = a2 → eq_ascii ch_1 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##2: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii3 : ∀a2.ch_2 = a2 → eq_ascii ch_2 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##3: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii4 : ∀a2.ch_3 = a2 → eq_ascii ch_3 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##4: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii5 : ∀a2.ch_4 = a2 → eq_ascii ch_4 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##5: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii6 : ∀a2.ch_5 = a2 → eq_ascii ch_5 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##6: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii7 : ∀a2.ch_6 = a2 → eq_ascii ch_6 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##7: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii8 : ∀a2.ch_7 = a2 → eq_ascii ch_7 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##8: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii9 : ∀a2.ch_8 = a2 → eq_ascii ch_8 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##9: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii10 : ∀a2.ch_9 = a2 → eq_ascii ch_9 a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##10: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii11 : ∀a2.ch__ = a2 → eq_ascii ch__ a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##11: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii12 : ∀a2.ch_A = a2 → eq_ascii ch_A a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##12: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii13 : ∀a2.ch_B = a2 → eq_ascii ch_B a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##13: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii14 : ∀a2.ch_C = a2 → eq_ascii ch_C a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##14: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii15 : ∀a2.ch_D = a2 → eq_ascii ch_D a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##15: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii16 : ∀a2.ch_E = a2 → eq_ascii ch_E a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##16: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii17 : ∀a2.ch_F = a2 → eq_ascii ch_F a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##17: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii18 : ∀a2.ch_G = a2 → eq_ascii ch_G a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##18: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii19 : ∀a2.ch_H = a2 → eq_ascii ch_H a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##19: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii20 : ∀a2.ch_I = a2 → eq_ascii ch_I a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##20: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii21 : ∀a2.ch_J = a2 → eq_ascii ch_J a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##21: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii22 : ∀a2.ch_K = a2 → eq_ascii ch_K a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##22: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii23 : ∀a2.ch_L = a2 → eq_ascii ch_L a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##23: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii24 : ∀a2.ch_M = a2 → eq_ascii ch_M a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##24: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii25 : ∀a2.ch_N = a2 → eq_ascii ch_N a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##25: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii26 : ∀a2.ch_O = a2 → eq_ascii ch_O a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##26: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii27 : ∀a2.ch_P = a2 → eq_ascii ch_P a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##27: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii28 : ∀a2.ch_Q = a2 → eq_ascii ch_Q a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##28: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii29 : ∀a2.ch_R = a2 → eq_ascii ch_R a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##29: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii30 : ∀a2.ch_S = a2 → eq_ascii ch_S a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##30: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii31 : ∀a2.ch_T = a2 → eq_ascii ch_T a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##31: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii32 : ∀a2.ch_U = a2 → eq_ascii ch_U a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##32: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii33 : ∀a2.ch_V = a2 → eq_ascii ch_V a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##33: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii34 : ∀a2.ch_W = a2 → eq_ascii ch_W a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##34: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii35 : ∀a2.ch_X = a2 → eq_ascii ch_X a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##35: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii36 : ∀a2.ch_Y = a2 → eq_ascii ch_Y a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##36: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii37 : ∀a2.ch_Z = a2 → eq_ascii ch_Z a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##37: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii38 : ∀a2.ch_a = a2 → eq_ascii ch_a a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##38: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii39 : ∀a2.ch_b = a2 → eq_ascii ch_b a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##39: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii40 : ∀a2.ch_c = a2 → eq_ascii ch_c a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##40: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii41 : ∀a2.ch_d = a2 → eq_ascii ch_d a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##41: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii42 : ∀a2.ch_e = a2 → eq_ascii ch_e a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##42: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii43 : ∀a2.ch_f = a2 → eq_ascii ch_f a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##43: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii44 : ∀a2.ch_g = a2 → eq_ascii ch_g a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##44: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii45 : ∀a2.ch_h = a2 → eq_ascii ch_h a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##45: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii46 : ∀a2.ch_i = a2 → eq_ascii ch_i a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##46: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii47 : ∀a2.ch_j = a2 → eq_ascii ch_j a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##47: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii48 : ∀a2.ch_k = a2 → eq_ascii ch_k a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##48: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii49 : ∀a2.ch_l = a2 → eq_ascii ch_l a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##49: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii50 : ∀a2.ch_m = a2 → eq_ascii ch_m a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##50: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii51 : ∀a2.ch_n = a2 → eq_ascii ch_n a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##51: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii52 : ∀a2.ch_o = a2 → eq_ascii ch_o a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##52: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii53 : ∀a2.ch_p = a2 → eq_ascii ch_p a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##53: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii54 : ∀a2.ch_q = a2 → eq_ascii ch_q a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##54: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii55 : ∀a2.ch_r = a2 → eq_ascii ch_r a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##55: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii56 : ∀a2.ch_s = a2 → eq_ascii ch_s a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##56: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii57 : ∀a2.ch_t = a2 → eq_ascii ch_t a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##57: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii58 : ∀a2.ch_u = a2 → eq_ascii ch_u a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##58: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii59 : ∀a2.ch_v = a2 → eq_ascii ch_v a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##59: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii60 : ∀a2.ch_w = a2 → eq_ascii ch_w a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##60: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii61 : ∀a2.ch_x = a2 → eq_ascii ch_x a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##61: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii62 : ∀a2.ch_y = a2 → eq_ascii ch_y a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##62: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-nlemma eq_to_eqascii63 : ∀a2.ch_z = a2 → eq_ascii ch_z a2 = true. #a2; ncases a2; nnormalize; #H; ##[ ##63: napply refl_eq | ##*: napply (ascii_destruct … H) ##] nqed.
-
-nlemma eq_to_eqascii : ∀c1,c2.c1 = c2 → eq_ascii c1 c2 = true.
- #c1; ncases c1;
- ##[ ##1: napply eq_to_eqascii1 ##| ##2: napply eq_to_eqascii2
- ##| ##3: napply eq_to_eqascii3 ##| ##4: napply eq_to_eqascii4
- ##| ##5: napply eq_to_eqascii5 ##| ##6: napply eq_to_eqascii6
- ##| ##7: napply eq_to_eqascii7 ##| ##8: napply eq_to_eqascii8
- ##| ##9: napply eq_to_eqascii9 ##| ##10: napply eq_to_eqascii10
- ##| ##11: napply eq_to_eqascii11 ##| ##12: napply eq_to_eqascii12
- ##| ##13: napply eq_to_eqascii13 ##| ##14: napply eq_to_eqascii14
- ##| ##15: napply eq_to_eqascii15 ##| ##16: napply eq_to_eqascii16
- ##| ##17: napply eq_to_eqascii17 ##| ##18: napply eq_to_eqascii18
- ##| ##19: napply eq_to_eqascii19 ##| ##20: napply eq_to_eqascii20
- ##| ##21: napply eq_to_eqascii21 ##| ##22: napply eq_to_eqascii22
- ##| ##23: napply eq_to_eqascii23 ##| ##24: napply eq_to_eqascii24
- ##| ##25: napply eq_to_eqascii25 ##| ##26: napply eq_to_eqascii26
- ##| ##27: napply eq_to_eqascii27 ##| ##28: napply eq_to_eqascii28
- ##| ##29: napply eq_to_eqascii29 ##| ##30: napply eq_to_eqascii30
- ##| ##31: napply eq_to_eqascii31 ##| ##32: napply eq_to_eqascii32
- ##| ##33: napply eq_to_eqascii33 ##| ##34: napply eq_to_eqascii34
- ##| ##35: napply eq_to_eqascii35 ##| ##36: napply eq_to_eqascii36
- ##| ##37: napply eq_to_eqascii37 ##| ##38: napply eq_to_eqascii38
- ##| ##39: napply eq_to_eqascii39 ##| ##40: napply eq_to_eqascii40
- ##| ##41: napply eq_to_eqascii41 ##| ##42: napply eq_to_eqascii42
- ##| ##43: napply eq_to_eqascii43 ##| ##44: napply eq_to_eqascii44
- ##| ##45: napply eq_to_eqascii45 ##| ##46: napply eq_to_eqascii46
- ##| ##47: napply eq_to_eqascii47 ##| ##48: napply eq_to_eqascii48
- ##| ##49: napply eq_to_eqascii49 ##| ##50: napply eq_to_eqascii50
- ##| ##51: napply eq_to_eqascii51 ##| ##52: napply eq_to_eqascii52
- ##| ##53: napply eq_to_eqascii53 ##| ##54: napply eq_to_eqascii54
- ##| ##55: napply eq_to_eqascii55 ##| ##56: napply eq_to_eqascii56
- ##| ##57: napply eq_to_eqascii57 ##| ##58: napply eq_to_eqascii58
- ##| ##59: napply eq_to_eqascii59 ##| ##60: napply eq_to_eqascii60
- ##| ##61: napply eq_to_eqascii61 ##| ##62: napply eq_to_eqascii62
- ##| ##63: napply eq_to_eqascii63 ##]
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/ascii.ma".
-include "freescale/theory.ma".
-include "utility/utility.ma".
-
-(* ************************ *)
-(* MANIPOLAZIONE DI STRINGA *)
-(* ************************ *)
-
-(* tipo pubblico *)
-ndefinition aux_str_type ≝ list ascii.
-
-(* strcmp *)
-ndefinition eq_str ≝
- bfold_right_list2 ascii (λx,y.eq_ascii x y).
-
-(* ************ *)
-(* STRINGA + ID *)
-(* ************ *)
-
-(* tipo pubblico *)
-nrecord strId : Type ≝
- {
- str_elem: aux_str_type;
- id_elem: nat
- }.
-
-(* confronto *)
-ndefinition eq_strId ≝
-λsid,sid':strId.
- (eq_str (str_elem sid) (str_elem sid'))⊗
- (eq_nat (id_elem sid) (id_elem sid')).
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/string.ma".
-include "utility/ascii_lemmas2.ma".
-include "utility/utility_lemmas.ma".
-
-(* ************************ *)
-(* MANIPOLAZIONE DI STRINGA *)
-(* ************************ *)
-
-nlemma symmetric_eqstr : symmetricT (list ascii) bool eq_str.
- #s1; #s2;
- napply (symmetric_bfoldrightlist2 ascii eq_ascii s1 s2 symmetric_eqascii).
-nqed.
-
-nlemma eqstr_to_eq : ∀s,s'.eq_str s s' = true → s = s'.
- #s1; #s2;
- napply (bfoldrightlist2_to_eq ascii eq_ascii s1 s2 eqascii_to_eq).
-nqed.
-
-nlemma eq_to_eqstr : ∀s,s'.s = s' → eq_str s s' = true.
- #s1; #s2;
- napply (eq_to_bfoldrightlist2 ascii eq_ascii s1 s2 eq_to_eqascii).
-nqed.
-
-(* ************ *)
-(* STRINGA + ID *)
-(* ************ *)
-
-nlemma strid_destruct_1 : ∀x1,x2,y1,y2.mk_strId x1 y1 = mk_strId x2 y2 → x1 = x2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_strId x2 y2 with [ mk_strId a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma strid_destruct_2 : ∀x1,x2,y1,y2.mk_strId x1 y1 = mk_strId x2 y2 → y1 = y2.
- #x1; #x2; #y1; #y2; #H;
- nchange with (match mk_strId x2 y2 with [ mk_strId _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqstrid : symmetricT strId bool eq_strId.
- #si1; #si2;
- nchange with (
- ((eq_str (str_elem si1) (str_elem si2))⊗(eq_nat (id_elem si1) (id_elem si2))) =
- ((eq_str (str_elem si2) (str_elem si1))⊗(eq_nat (id_elem si2) (id_elem si1))));
- nrewrite > (symmetric_eqstr (str_elem si1) (str_elem si2));
- nrewrite > (symmetric_eqnat (id_elem si1) (id_elem si2));
- napply refl_eq.
-nqed.
-
-nlemma eqstrid_to_eq : ∀s,s'.eq_strId s s' = true → s = s'.
- #si1; #si2;
- nelim si1;
- #l1; #n1;
- nelim si2;
- #l2; #n2; #H;
- nchange in H:(%) with (((eq_str l1 l2)⊗(eq_nat n1 n2)) = true);
- nrewrite > (eqstr_to_eq l1 l2 (andb_true_true_l … H));
- nrewrite > (eqnat_to_eq n1 n2 (andb_true_true_r … H));
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqstrid : ∀s,s'.s = s' → eq_strId s s' = true.
- #si1; #si2;
- nelim si1;
- #l1; #n1;
- nelim si2;
- #l2; #n2; #H;
- nchange with (((eq_str l1 l2)⊗(eq_nat n1 n2)) = true);
- nrewrite > (strid_destruct_1 … H);
- nrewrite > (strid_destruct_2 … H);
- nrewrite > (eq_to_eqstr l2 l2 (refl_eq …));
- nrewrite > (eq_to_eqnat n2 n2 (refl_eq …));
- nnormalize;
- napply refl_eq.
-nqed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/theory.ma".
-include "freescale/option.ma".
-
-(* ************** *)
-(* Non-Empty List *)
-(* ************** *)
-
-(* lista non vuota *)
-ninductive ne_list (A:Type) : Type ≝
- | ne_nil: A → ne_list A
- | ne_cons: A → ne_list A → ne_list A.
-
-(* append *)
-nlet rec ne_append (A:Type) (l1,l2:ne_list A) on l1 ≝
- match l1 with
- [ ne_nil hd ⇒ ne_cons A hd l2
- | ne_cons hd tl ⇒ ne_cons A hd (ne_append A tl l2) ].
-
-notation "hvbox(hd break §§ tl)"
- right associative with precedence 46
- for @{'ne_cons $hd $tl}.
-
-notation "« list0 x sep ; break £ y break »"
- non associative with precedence 90
- for ${fold right @{'ne_nil $y } rec acc @{'ne_cons $x $acc}}.
-
-notation "hvbox(l1 break & l2)"
- right associative with precedence 47
- for @{'ne_append $l1 $l2 }.
-
-interpretation "ne_nil" 'ne_nil hd = (ne_nil ? hd).
-interpretation "ne_cons" 'ne_cons hd tl = (ne_cons ? hd tl).
-interpretation "ne_append" 'ne_append l1 l2 = (ne_append ? l1 l2).
-
-(* ************ *)
-(* List Utility *)
-(* ************ *)
-
-(* listlen *)
-nlet rec len_list (T:Type) (l:list T) on l ≝
- match l with [ nil ⇒ O | cons _ t ⇒ S (len_list T t) ].
-
-nlet rec len_neList (T:Type) (nl:ne_list T) on nl ≝
- match nl with [ ne_nil _ ⇒ 1 | ne_cons _ t ⇒ S (len_neList T t) ].
-
-(* vuota? *)
-ndefinition is_empty_list ≝
-λT:Type.λl:list T.match l with [ nil ⇒ True | cons _ _ ⇒ False ].
-
-ndefinition isb_empty_list ≝
-λT:Type.λl:list T.match l with [ nil ⇒ true | cons _ _ ⇒ false ].
-
-ndefinition isnot_empty_list ≝
-λT:Type.λl:list T.match l with [ nil ⇒ False | cons _ _ ⇒ True ].
-
-ndefinition isnotb_empty_list ≝
-λT:Type.λl:list T.match l with [ nil ⇒ false | cons _ _ ⇒ true ].
-
-(* conversione *)
-nlet rec neList_to_list (T:Type) (nl:ne_list T) on nl : list T ≝
- match nl with [ ne_nil h ⇒ [h] | ne_cons h t ⇒ [h]@(neList_to_list T t) ].
-
-nlet rec list_to_neList_aux (T:Type) (l:list T) on l : option (ne_list T) ≝
- match l with
- [ nil ⇒ None (ne_list T)
- | cons h t ⇒ match list_to_neList_aux T t with
- [ None ⇒ Some (ne_list T) «£h»
- | Some t' ⇒ Some (ne_list T) («£h»&t') ]].
-
-ndefinition list_to_neList ≝
-λT:Type.λl:list T.
- match l
- return λl:list T.isnot_empty_list T l → ne_list T
- with
- [ nil ⇒ λp:isnot_empty_list T (nil T).False_rect_Type0 ? p
- | cons h t ⇒ λp:isnot_empty_list T (cons T h t).
- match list_to_neList_aux T t with
- [ None ⇒ «£h»
- | Some t' ⇒ «£h»&t'
- ]
- ].
-
-(* nth elem *)
-nlet rec nth_list (T:Type) (l:list T) (n:nat) on l ≝
- match l with
- [ nil ⇒ None ?
- | cons h t ⇒ match n with
- [ O ⇒ Some ? h | S n' ⇒ nth_list T t n' ]
- ].
-
-nlet rec nth_neList (T:Type) (nl:ne_list T) (n:nat) on nl ≝
- match nl with
- [ ne_nil h ⇒ match n with
- [ O ⇒ Some ? h | S _ ⇒ None ? ]
- | ne_cons h t ⇒ match n with
- [ O ⇒ Some ? h | S n' ⇒ nth_neList T t n' ]
- ].
-
-nlet rec abs_nth_neList (T:Type) (nl:ne_list T) (n:nat) on nl ≝
- match nl with
- [ ne_nil h ⇒ h
- | ne_cons h t ⇒ match n with
- [ O ⇒ h | S n' ⇒ abs_nth_neList T t n' ]
- ].
-
-(* reverse *)
-nlet rec reverse_list (T:Type) (l:list T) on l ≝
- match l with
- [ nil ⇒ nil T
- | cons h t ⇒ (reverse_list T t)@[h]
- ].
-
-nlet rec reverse_neList (T:Type) (nl:ne_list T) on nl ≝
- match nl with
- [ ne_nil h ⇒ ne_nil T h
- | ne_cons h t ⇒ (reverse_neList T t)&(ne_nil T h)
- ].
-
-(* getLast *)
-ndefinition get_last_list ≝
-λT:Type.λl:list T.match reverse_list T l with
- [ nil ⇒ None ?
- | cons h _ ⇒ Some ? h ].
-
-ndefinition get_last_neList ≝
-λT:Type.λnl:ne_list T.match reverse_neList T nl with
- [ ne_nil h ⇒ h
- | ne_cons h _ ⇒ h ].
-
-(* cutLast *)
-ndefinition cut_last_list ≝
-λT:Type.λl:list T.match reverse_list T l with
- [ nil ⇒ nil T
- | cons _ t ⇒ reverse_list T t ].
-
-ndefinition cut_last_neList ≝
-λT:Type.λnl:ne_list T.match reverse_neList T nl with
- [ ne_nil h ⇒ ne_nil T h
- | ne_cons _ t ⇒ reverse_neList T t ].
-
-(* getFirst *)
-ndefinition get_first_list ≝
-λT:Type.λl:list T.match l with
- [ nil ⇒ None ?
- | cons h _ ⇒ Some ? h ].
-
-ndefinition get_first_neList ≝
-λT:Type.λnl:ne_list T.match nl with
- [ ne_nil h ⇒ h
- | ne_cons h _ ⇒ h ].
-
-(* cutFirst *)
-ndefinition cut_first_list ≝
-λT:Type.λl:list T.match l with
- [ nil ⇒ nil T
- | cons _ t ⇒ t ].
-
-ndefinition cut_first_neList ≝
-λT:Type.λnl:ne_list T.match nl with
- [ ne_nil h ⇒ ne_nil T h
- | ne_cons _ t ⇒ t ].
-
-(* apply f *)
-nlet rec apply_f_list (T1,T2:Type) (l:list T1) (f:T1 → T2) on l ≝
-match l with
- [ nil ⇒ nil T2
- | cons h t ⇒ cons T2 (f h) (apply_f_list T1 T2 t f) ].
-
-nlet rec apply_f_neList (T1,T2:Type) (nl:ne_list T1) (f:T1 → T2) on nl ≝
-match nl with
- [ ne_nil h ⇒ ne_nil T2 (f h)
- | ne_cons h t ⇒ ne_cons T2 (f h) (apply_f_neList T1 T2 t f) ].
-
-(* fold right *)
-nlet rec fold_right_list (T1,T2:Type) (f:T1 → T2 → T2) (acc:T2) (l:list T1) on l ≝
- match l with
- [ nil ⇒ acc
- | cons h t ⇒ f h (fold_right_list T1 T2 f acc t)
- ].
-
-nlet rec fold_right_neList (T1,T2:Type) (f:T1 → T2 → T2) (acc:T2) (nl:ne_list T1) on nl ≝
- match nl with
- [ ne_nil h ⇒ f h acc
- | ne_cons h t ⇒ f h (fold_right_neList T1 T2 f acc t)
- ].
-
-(* double fold right *)
-nlemma fold_right_list2_aux1 :
-∀T.∀h,t.len_list T [] = len_list T (h::t) → False.
- #T; #h; #t;
- nnormalize;
- #H;
- napply (nat_destruct_0_S ? H).
-nqed.
-
-nlemma fold_right_list2_aux2 :
-∀T.∀h,t.len_list T (h::t) = len_list T [] → False.
- #T; #h; #t;
- nnormalize;
- #H;
- napply (nat_destruct_S_0 ? H).
-nqed.
-
-nlemma fold_right_list2_aux3 :
-∀T.∀h,h',t,t'.len_list T (h::t) = len_list T (h'::t') → len_list T t = len_list T t'.
- #T; #h; #h'; #t; #t';
- nelim t;
- nelim t';
- ##[ ##1: nnormalize; #H; napply refl_eq
- ##| ##2: #a; #l'; #H; #H1;
- nchange in H1:(%) with ((S O) = (S (S (len_list T l'))));
- nelim (nat_destruct_0_S ? (nat_destruct_S_S … H1))
- ##| ##3: #a; #l'; #H; #H1;
- nchange in H1:(%) with ((S (S (len_list T l'))) = (S O));
- nelim (nat_destruct_S_0 ? (nat_destruct_S_S … H1))
- ##| ##4: #a; #l; #H; #a1; #l1; #H1; #H2;
- nchange in H2:(%) with ((S (S (len_list T l1))) = (S (S (len_list T l))));
- nchange with ((S (len_list T l1)) = (S (len_list T l)));
- nrewrite > (nat_destruct_S_S … H2);
- napply refl_eq
- ##]
-nqed.
-
-nlet rec fold_right_list2 (T1,T2:Type) (f:T1 → T1 → T2 → T2) (acc:T2) (l1:list T1) on l1 ≝
- match l1
- return λl1.Πl2.len_list T1 l1 = len_list T1 l2 → T2
- with
- [ nil ⇒ λl2.match l2 return λl2.len_list T1 [] = len_list T1 l2 → T2 with
- [ nil ⇒ λp:len_list T1 [] = len_list T1 [].acc
- | cons h t ⇒ λp:len_list T1 [] = len_list T1 (h::t).
- False_rect_Type0 ? (fold_right_list2_aux1 T1 h t p)
- ]
- | cons h t ⇒ λl2.match l2 return λl2.len_list T1 (h::t) = len_list T1 l2 → T2 with
- [ nil ⇒ λp:len_list T1 (h::t) = len_list T1 [].
- False_rect_Type0 ? (fold_right_list2_aux2 T1 h t p)
- | cons h' t' ⇒ λp:len_list T1 (h::t) = len_list T1 (h'::t').
- f h h' (fold_right_list2 T1 T2 f acc t t' (fold_right_list2_aux3 T1 h h' t t' p))
- ]
- ].
-
-nlet rec bfold_right_list2 (T1:Type) (f:T1 → T1 → bool) (l1,l2:list T1) on l1 ≝
- match l1 with
- [ nil ⇒ match l2 with
- [ nil ⇒ true | cons h t ⇒ false ]
- | cons h t ⇒ match l2 with
- [ nil ⇒ false | cons h' t' ⇒ (f h h') ⊗ (bfold_right_list2 T1 f t t')
- ]
- ].
-
-nlemma fold_right_neList2_aux1 :
-∀T.∀h,h',t'.len_neList T «£h» = len_neList T (h'§§t') → False.
- #T; #h; #h'; #t';
- nnormalize;
- ncases t';
- nnormalize;
- ##[ ##1: #x; #H; nelim (nat_destruct_0_S ? (nat_destruct_S_S … H))
- ##| ##2: #x; #l; #H; nelim (nat_destruct_0_S ? (nat_destruct_S_S … H))
- ##]
-nqed.
-
-nlemma fold_right_neList2_aux2 :
-∀T.∀h,h',t.len_neList T (h§§t) = len_neList T «£h'» → False.
- #T; #h; #h'; #t;
- nnormalize;
- ncases t;
- nnormalize;
- ##[ ##1: #x; #H; nelim (nat_destruct_S_0 ? (nat_destruct_S_S … H))
- ##| ##2: #x; #l; #H; nelim (nat_destruct_S_0 ? (nat_destruct_S_S … H))
- ##]
-nqed.
-
-nlemma fold_right_neList2_aux3 :
-∀T.∀h,h',t,t'.len_neList T (h§§t) = len_neList T (h'§§t') → len_neList T t = len_neList T t'.
- #T; #h; #h'; #t; #t';
- nelim t;
- nelim t';
- ##[ ##1: nnormalize; #x; #y; #H; napply refl_eq
- ##| ##2: #a; #l'; #H; #x; #H1;
- nchange in H1:(%) with ((S (len_neList T «£x»)) = (S (len_neList T (a§§l'))));
- nrewrite > (nat_destruct_S_S … H1);
- napply refl_eq
- ##| ##3: #x; #a; #l'; #H; #H1;
- nchange in H1:(%) with ((S (len_neList T (a§§l')))= (S (len_neList T «£x»)));
- nrewrite > (nat_destruct_S_S … H1);
- napply refl_eq
- ##| ##4: #a; #l; #H; #a1; #l1; #H1; #H2;
- nchange in H2:(%) with ((S (len_neList T (a1§§l1))) = (S (len_neList T (a§§l))));
- nrewrite > (nat_destruct_S_S … H2);
- napply refl_eq
- ##]
-nqed.
-
-nlet rec fold_right_neList2 (T1,T2:Type) (f:T1 → T1 → T2 → T2) (acc:T2) (l1:ne_list T1) on l1 ≝
- match l1
- return λl1.Πl2.len_neList T1 l1 = len_neList T1 l2 → T2
- with
- [ ne_nil h ⇒ λl2.match l2 return λl2.len_neList T1 «£h» = len_neList T1 l2 → T2 with
- [ ne_nil h' ⇒ λp:len_neList T1 «£h» = len_neList T1 «£h'».
- f h h' acc
- | ne_cons h' t' ⇒ λp:len_neList T1 «£h» = len_neList T1 (h'§§t').
- False_rect_Type0 ? (fold_right_neList2_aux1 T1 h h' t' p)
- ]
- | ne_cons h t ⇒ λl2.match l2 return λl2.len_neList T1 (h§§t) = len_neList T1 l2 → T2 with
- [ ne_nil h' ⇒ λp:len_neList T1 (h§§t) = len_neList T1 «£h'».
- False_rect_Type0 ? (fold_right_neList2_aux2 T1 h h' t p)
- | ne_cons h' t' ⇒ λp:len_neList T1 (h§§t) = len_neList T1 (h'§§t').
- f h h' (fold_right_neList2 T1 T2 f acc t t' (fold_right_neList2_aux3 T1 h h' t t' p))
- ]
- ].
-
-nlet rec bfold_right_neList2 (T1:Type) (f:T1 → T1 → bool) (l1,l2:ne_list T1) on l1 ≝
- match l1 with
- [ ne_nil h ⇒ match l2 with
- [ ne_nil h' ⇒ f h h' | ne_cons h' t' ⇒ false ]
- | ne_cons h t ⇒ match l2 with
- [ ne_nil h' ⇒ false | ne_cons h' t' ⇒ (f h h') ⊗ (bfold_right_neList2 T1 f t t')
- ]
- ].
-
-(* ******** *)
-(* naturali *)
-(* ******** *)
-
-ndefinition isZero ≝ λn:nat.match n with [ O ⇒ True | S _ ⇒ False ].
-
-ndefinition isZerob ≝ λn:nat.match n with [ O ⇒ true | S _ ⇒ false ].
-
-ndefinition ltb ≝ λn1,n2:nat.(le_nat n1 n2) ⊗ (⊖ (eq_nat n1 n2)).
-
-ndefinition geb ≝ λn1,n2:nat.(⊖ (le_nat n1 n2)) ⊕ (eq_nat n1 n2).
-
-ndefinition gtb ≝ λn1,n2:nat.⊖ (le_nat n1 n2).
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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 "utility/utility.ma".
-
-(* ************ *)
-(* List Utility *)
-(* ************ *)
-
-nlemma nelist_destruct_nil_nil : ∀T.∀x1,x2:T.ne_nil T x1 = ne_nil T x2 → x1 = x2.
- #T; #x1; #x2; #H;
- nchange with (match ne_nil T x2 with [ ne_cons _ _ ⇒ False | ne_nil a ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma nelist_destruct_cons_cons_1 : ∀T.∀x1,x2:T.∀y1,y2:ne_list T.ne_cons T x1 y1 = ne_cons T x2 y2 → x1 = x2.
- #T; #x1; #x2; #y1; #y2; #H;
- nchange with (match ne_cons T x2 y2 with [ ne_nil _ ⇒ False | ne_cons a _ ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma nelist_destruct_cons_cons_2 : ∀T.∀x1,x2:T.∀y1,y2:ne_list T.ne_cons T x1 y1 = ne_cons T x2 y2 → y1 = y2.
- #T; #x1; #x2; #y1; #y2; #H;
- nchange with (match ne_cons T x2 y2 with [ ne_nil _ ⇒ False | ne_cons _ b ⇒ y1 = b ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma nelist_destruct_cons_nil : ∀T.∀x1,x2:T.∀y1:ne_list T.ne_cons T x1 y1 = ne_nil T x2 → False.
- #T; #x1; #x2; #y1; #H;
- nchange with (match ne_cons T x1 y1 with [ ne_nil _ ⇒ True | ne_cons a b ⇒ False ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma nelist_destruct_nil_cons : ∀T.∀x1,x2:T.∀y2:ne_list T.ne_nil T x1 = ne_cons T x2 y2 → False.
- #T; #x1; #x2; #y2; #H;
- nchange with (match ne_cons T x2 y2 with [ ne_nil _ ⇒ True | ne_cons a b ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma symmetric_eqlenlist : ∀T.∀l1,l2:list T.len_list T l1 = len_list T l2 → len_list T l2 = len_list T l1.
- #T; #l1;
- nelim l1;
- ##[ ##1: #l2; ncases l2; nnormalize;
- ##[ ##1: #H; napply refl_eq
- ##| ##2: #h; #t; #H; nelim (nat_destruct_0_S ? H)
- ##]
- ##| ##2: #h; #l2; ncases l2; nnormalize;
- ##[ ##1: #H; #l; #H1; nrewrite < H1; napply refl_eq
- ##| ##2: #h; #l; #H; #l3; #H1; nrewrite < H1; napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma symmetric_foldrightlist2_aux
- : ∀T1,T2:Type.∀f:T1 → T1 → T2 → T2.∀acc:T2.∀l1,l2:list T1.
- ∀H1:len_list T1 l1 = len_list T1 l2.∀H2:len_list T1 l2 = len_list T1 l1.
- (∀x,y,z.f x y z = f y x z) →
- fold_right_list2 T1 T2 f acc l1 l2 H1 = fold_right_list2 T1 T2 f acc l2 l1 H2.
- #T1; #T2; #f; #acc; #l1;
- nelim l1;
- ##[ ##1: #l2; ncases l2;
- ##[ ##1: nnormalize; #H1; #H2; #H3; napply refl_eq
- ##| ##2: #h; #l; #H1; #H2; #H3;
- nchange in H1:(%) with (O = (S (len_list ? l)));
- nelim (nat_destruct_0_S ? H1)
- ##]
- ##| ##2: #h3; #l3; #H; #l2; ncases l2;
- ##[ ##1: #H1; #H2; #H3; nchange in H1:(%) with ((S (len_list ? l3)) = O);
- nelim (nat_destruct_S_0 ? H1)
- ##| ##2: #h4; #l4; #H1; #H2; #H3;
- nchange in H1:(%) with ((S (len_list ? l3)) = (S (len_list ? l4)));
- nchange in H2:(%) with ((S (len_list ? l4)) = (S (len_list ? l3)));
- nchange with ((f h3 h4 (fold_right_list2 T1 T2 f acc l3 l4 (fold_right_list2_aux3 T1 h3 h4 l3 l4 ?))) =
- (f h4 h3 (fold_right_list2 T1 T2 f acc l4 l3 (fold_right_list2_aux3 T1 h4 h3 l4 l3 ?))));
- nrewrite < (H l4 (fold_right_list2_aux3 T1 h3 h4 l3 l4 H1) (fold_right_list2_aux3 T1 h4 h3 l4 l3 H2) H3);
- nrewrite > (H3 h3 h4 (fold_right_list2 T1 T2 f acc l3 l4 ?));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma symmetric_foldrightlist2
- : ∀T1,T2:Type.∀f:T1 → T1 → T2 → T2.∀acc:T2.∀l1,l2:list T1.∀H:len_list T1 l1 = len_list T1 l2.
- (∀x,y,z.f x y z = f y x z) →
- fold_right_list2 T1 T2 f acc l1 l2 H = fold_right_list2 T1 T2 f acc l2 l1 (symmetric_eqlenlist T1 l1 l2 H).
- #T1; #T2; #f; #acc; #l1; #l2; #H; #H1;
- nrewrite > (symmetric_foldrightlist2_aux T1 T2 f acc l1 l2 H (symmetric_eqlenlist T1 l1 l2 H) H1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_bfoldrightlist2
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:list T1.
- (∀x,y.f x y = f y x) →
- bfold_right_list2 T1 f l1 l2 = bfold_right_list2 T1 f l2 l1.
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #l2; ncases l2;
- ##[ ##1: #H; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; #H; nnormalize; napply refl_eq
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #H1; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; #H1; nnormalize;
- nrewrite > (H ll2 H1);
- nrewrite > (H1 hh1 hh2);
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma bfoldrightlist2_to_eq
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:list T1.
- (∀x,y.(f x y = true → x = y)) →
- (bfold_right_list2 T1 f l1 l2 = true → l1 = l2).
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #l2; ncases l2;
- ##[ ##1: #H; #H1; napply refl_eq
- ##| ##2: #hh2; #ll2; #H; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #H1; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #hh2; #ll2; #H1; #H2;
- nchange in H2:(%) with (((f hh1 hh2)⊗(bfold_right_list2 T f ll1 ll2)) = true);
- nrewrite > (H1 hh1 hh2 (andb_true_true_l … H2));
- nrewrite > (H ll2 H1 (andb_true_true_r … H2));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma eq_to_bfoldrightlist2
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:list T1.
- (∀x,y.(x = y → f x y = true)) →
- (l1 = l2 → bfold_right_list2 T1 f l1 l2 = true).
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #l2; ncases l2;
- ##[ ##1: #H; #H1; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; #H; #H1; nelim (list_destruct_nil_cons ??? H1)
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #H1; #H2; nelim (list_destruct_cons_nil ??? H2)
- ##| ##2: #hh2; #ll2; #H1; #H2; nnormalize;
- nrewrite > (list_destruct_1 … H2);
- nrewrite > (H1 hh2 hh2 (refl_eq …));
- nnormalize;
- nrewrite > (H ll2 H1 (list_destruct_2 … H2));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma symmetric_eqlennelist : ∀T.∀l1,l2:ne_list T.len_neList T l1 = len_neList T l2 → len_neList T l2 = len_neList T l1.
- #T; #l1;
- nelim l1;
- ##[ ##1: #h; #l2; ncases l2; nnormalize;
- ##[ ##1: #H; #H1; napply refl_eq
- ##| ##2: #h; #t; #H; nrewrite > H; napply refl_eq
- ##]
- ##| ##2: #h; #l2; ncases l2; nnormalize;
- ##[ ##1: #h1; #H; #l; #H1; nrewrite < H1; napply refl_eq
- ##| ##2: #h; #l; #H; #l3; #H1; nrewrite < H1; napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma symmetric_foldrightnelist2_aux
- : ∀T1,T2:Type.∀f:T1 → T1 → T2 → T2.∀acc:T2.∀l1,l2:ne_list T1.
- ∀H1:len_neList T1 l1 = len_neList T1 l2.∀H2:len_neList T1 l2 = len_neList T1 l1.
- (∀x,y,z.f x y z = f y x z) →
- fold_right_neList2 T1 T2 f acc l1 l2 H1 = fold_right_neList2 T1 T2 f acc l2 l1 H2.
- #T1; #T2; #f; #acc; #l1;
- nelim l1;
- ##[ ##1: #h; #l2; ncases l2;
- ##[ ##1: #h1; nnormalize; #H1; #H2; #H3; nrewrite > (H3 h h1 acc); napply refl_eq
- ##| ##2: #h1; #l; ncases l;
- ##[ ##1: #h3; #H1; #H2; #H3;
- nchange in H1:(%) with ((S O) = (S (S O)));
- nelim (nat_destruct_0_S ? (nat_destruct_S_S … H1))
- ##| ##2: #h3; #l3; #H1; #H2; #H3;
- nchange in H1:(%) with ((S O) = (S (S (len_neList ? l3))));
- nelim (nat_destruct_0_S ? (nat_destruct_S_S … H1))
- ##]
- ##]
- ##| ##2: #h3; #l3; #H; #l2; ncases l2;
- ##[ ##1: #h4; ncases l3;
- ##[ ##1: #h5; #H1; #H2; #H3;
- nchange in H1:(%) with ((S (S O)) = (S O));
- nelim (nat_destruct_S_0 ? (nat_destruct_S_S … H1))
- ##| ##2: #h5; #l5; #H1; #H2; #H3;
- nchange in H1:(%) with ((S (S (len_neList ? l5))) = (S O));
- nelim (nat_destruct_S_0 ? (nat_destruct_S_S … H1))
- ##]
- ##| ##2: #h4; #l4; #H1; #H2; #H3;
- nchange in H1:(%) with ((S (len_neList ? l3)) = (S (len_neList ? l4)));
- nchange in H2:(%) with ((S (len_neList ? l4)) = (S (len_neList ? l3)));
- nchange with ((f h3 h4 (fold_right_neList2 T1 T2 f acc l3 l4 (fold_right_neList2_aux3 T1 h3 h4 l3 l4 ?))) =
- (f h4 h3 (fold_right_neList2 T1 T2 f acc l4 l3 (fold_right_neList2_aux3 T1 h4 h3 l4 l3 ?))));
- nrewrite < (H l4 (fold_right_neList2_aux3 T1 h3 h4 l3 l4 H1) (fold_right_neList2_aux3 T1 h4 h3 l4 l3 H2) H3);
- nrewrite > (H3 h3 h4 (fold_right_neList2 T1 T2 f acc l3 l4 ?));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma symmetric_foldrightnelist2
- : ∀T1,T2:Type.∀f:T1 → T1 → T2 → T2.∀acc:T2.∀l1,l2:ne_list T1.∀H:len_neList T1 l1 = len_neList T1 l2.
- (∀x,y,z.f x y z = f y x z) →
- fold_right_neList2 T1 T2 f acc l1 l2 H = fold_right_neList2 T1 T2 f acc l2 l1 (symmetric_eqlennelist T1 l1 l2 H).
- #T1; #T2; #f; #acc; #l1; #l2; #H; #H1;
- nrewrite > (symmetric_foldrightnelist2_aux T1 T2 f acc l1 l2 H (symmetric_eqlennelist T1 l1 l2 H) H1);
- napply refl_eq.
-nqed.
-
-nlemma symmetric_bfoldrightnelist2
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:ne_list T1.
- (∀x,y.f x y = f y x) →
- bfold_right_neList2 T1 f l1 l2 = bfold_right_neList2 T1 f l2 l1.
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #hh1; #l2; ncases l2;
- ##[ ##1: #hh2; #H; nnormalize; nrewrite > (H hh1 hh2); napply refl_eq
- ##| ##2: #hh2; #ll2; #H; nnormalize; napply refl_eq
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #hh2; #H1; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; #H1; nnormalize;
- nrewrite > (H ll2 H1);
- nrewrite > (H1 hh1 hh2);
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma bfoldrightnelist2_to_eq
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:ne_list T1.
- (∀x,y.(f x y = true → x = y)) →
- (bfold_right_neList2 T1 f l1 l2 = true → l1 = l2).
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #hh1; #l2; ncases l2;
- ##[ ##1: #hh2; #H; #H1; nnormalize in H1:(%); nrewrite > (H hh1 hh2 H1); napply refl_eq
- ##| ##2: #hh2; #ll2; #H; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #hh2; #H1; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #hh2; #ll2; #H1; #H2;
- nchange in H2:(%) with (((f hh1 hh2)⊗(bfold_right_neList2 T f ll1 ll2)) = true);
- nrewrite > (H1 hh1 hh2 (andb_true_true_l … H2));
- nrewrite > (H ll2 H1 (andb_true_true_r … H2));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma eq_to_bfoldrightnelist2
- : ∀T1:Type.∀f:T1 → T1 → bool.∀l1,l2:ne_list T1.
- (∀x,y.(x = y → f x y = true)) →
- (l1 = l2 → bfold_right_neList2 T1 f l1 l2 = true).
- #T; #f; #l1;
- nelim l1;
- ##[ ##1: #hh1; #l2; ncases l2;
- ##[ ##1: #hh2; #H; #H1; nnormalize;
- nrewrite > (H hh1 hh2 (nelist_destruct_nil_nil … H1));
- napply refl_eq
- ##| ##2: #hh2; #ll2; #H; #H1; nelim (nelist_destruct_nil_cons ???? H1)
- ##]
- ##| ##2: #hh1; #ll1; #H; #l2; ncases l2;
- ##[ ##1: #hh2; #H1; #H2; nelim (nelist_destruct_cons_nil ???? H2)
- ##| ##2: #hh2; #ll2; #H1; #H2; nnormalize;
- nrewrite > (nelist_destruct_cons_cons_1 … H2);
- nrewrite > (H1 hh2 hh2 (refl_eq …));
- nnormalize;
- nrewrite > (H ll2 H1 (nelist_destruct_cons_cons_2 … H2));
- napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma isbemptylist_to_isemptylist : ∀T,l.isb_empty_list T l = true → is_empty_list T l.
- #T; #l;
- ncases l;
- nnormalize;
- ##[ ##1: #H; napply I
- ##| ##2: #x; #l; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma isnotbemptylist_to_isnotemptylist : ∀T,l.isnotb_empty_list T l = true → isnot_empty_list T l.
- #T; #l;
- ncases l;
- nnormalize;
- ##[ ##1: #H; napply (bool_destruct … H)
- ##| ##2: #x; #l; #H; napply I
- ##]
-nqed.
-
-(* ******** *)
-(* naturali *)
-(* ******** *)
-
-nlemma iszerob_to_iszero : ∀n.isZerob n = true → isZero n.
- #n;
- ncases n;
- ##[ ##1: nnormalize; #H; napply I
- ##| ##2: #n1; nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.