]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/ng_assembly/freescale/byte8.ma
896bf6e66a3f54bab329d751a7bd39cc6a8a193c
[helm.git] / helm / software / matita / contribs / ng_assembly / freescale / byte8.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* ********************************************************************** *)
16 (*                          Progetto FreeScale                            *)
17 (*                                                                        *)
18 (*   Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it                   *)
19 (*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
20 (*                                                                        *)
21 (* ********************************************************************** *)
22
23 include "freescale/exadecim.ma".
24
25 (* **** *)
26 (* BYTE *)
27 (* **** *)
28
29 nrecord byte8 : Type ≝
30  {
31  b8h: exadecim;
32  b8l: exadecim
33  }.
34
35 (* \langle \rangle *)
36 notation "〈x,y〉" non associative with precedence 80
37  for @{ 'mk_byte8 $x $y }.
38 interpretation "mk_byte8" 'mk_byte8 x y = (mk_byte8 x y).
39
40 (* operatore = *)
41 ndefinition eq_b8 ≝ λb1,b2:byte8.(eq_ex (b8h b1) (b8h b2)) ⊗ (eq_ex (b8l b1) (b8l b2)).
42
43 (* operatore < *)
44 ndefinition lt_b8 ≝
45 λb1,b2:byte8.match lt_ex (b8h b1) (b8h b2) with
46  [ true ⇒ true
47  | false ⇒ match gt_ex (b8h b1) (b8h b2) with
48   [ true ⇒ false
49   | false ⇒ lt_ex (b8l b1) (b8l b2) ]].
50
51 (* operatore ≤ *)
52 ndefinition le_b8 ≝ λb1,b2:byte8.(eq_b8 b1 b2) ⊕ (lt_b8 b1 b2). 
53
54 (* operatore > *)
55 ndefinition gt_b8 ≝ λb1,b2:byte8.⊖ (le_b8 b1 b2).
56
57 (* operatore ≥ *)
58 ndefinition ge_b8 ≝ λb1,b2:byte8.⊖ (lt_b8 b1 b2).
59
60 (* operatore and *)
61 ndefinition and_b8 ≝
62 λb1,b2:byte8.mk_byte8 (and_ex (b8h b1) (b8h b2)) (and_ex (b8l b1) (b8l b2)).
63
64 (* operatore or *)
65 ndefinition or_b8 ≝
66 λb1,b2:byte8.mk_byte8 (or_ex (b8h b1) (b8h b2)) (or_ex (b8l b1) (b8l b2)).
67
68 (* operatore xor *)
69 ndefinition xor_b8 ≝
70 λb1,b2:byte8.mk_byte8 (xor_ex (b8h b1) (b8h b2)) (xor_ex (b8l b1) (b8l b2)).
71
72 (* operatore rotazione destra con carry *)
73 ndefinition rcr_b8 ≝
74 λb:byte8.λc:bool.match rcr_ex (b8h b) c with
75  [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
76   [ pair bl' c'' ⇒ pair ?? (mk_byte8 bh' bl') c'' ]]. 
77
78 (* operatore shift destro *)
79 ndefinition shr_b8 ≝
80 λb:byte8.match rcr_ex (b8h b) false with
81  [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
82   [ pair bl' c'' ⇒ pair ?? (mk_byte8 bh' bl') c'' ]].
83
84 (* operatore rotazione destra *)
85 ndefinition ror_b8 ≝
86 λb:byte8.match rcr_ex (b8h b) false with
87  [ pair bh' c' ⇒ match rcr_ex (b8l b) c' with
88   [ pair bl' c'' ⇒ match c'' with
89    [ true ⇒ mk_byte8 (or_ex x8 bh') bl'
90    | false ⇒ mk_byte8 bh' bl' ]]].
91
92 (* operatore rotazione destra n-volte *)
93 nlet rec ror_b8_n (b:byte8) (n:nat) on n ≝
94  match n with
95   [ O ⇒ b
96   | S n' ⇒ ror_b8_n (ror_b8 b) n' ].
97
98 (* operatore rotazione sinistra con carry *)
99 ndefinition rcl_b8 ≝
100 λb:byte8.λc:bool.match rcl_ex (b8l b) c with
101  [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
102   [ pair bh' c'' ⇒ pair ?? (mk_byte8 bh' bl') c'' ]]. 
103
104 (* operatore shift sinistro *)
105 ndefinition shl_b8 ≝
106 λb:byte8.match rcl_ex (b8l b) false with
107  [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
108   [ pair bh' c'' ⇒ pair ?? (mk_byte8 bh' bl') c'' ]].
109
110 (* operatore rotazione sinistra *)
111 ndefinition rol_b8 ≝
112 λb:byte8.match rcl_ex (b8l b) false with
113  [ pair bl' c' ⇒ match rcl_ex (b8h b) c' with
114   [ pair bh' c'' ⇒ match c'' with
115    [ true ⇒ mk_byte8 bh' (or_ex x1 bl')
116    | false ⇒ mk_byte8 bh' bl' ]]].
117
118 (* operatore rotazione sinistra n-volte *)
119 nlet rec rol_b8_n (b:byte8) (n:nat) on n ≝
120  match n with
121   [ O ⇒ b
122   | S n' ⇒ rol_b8_n (rol_b8 b) n' ].
123
124 (* operatore not/complemento a 1 *)
125 ndefinition not_b8 ≝
126 λb:byte8.mk_byte8 (not_ex (b8h b)) (not_ex (b8l b)).
127
128 (* operatore somma con data+carry → data+carry *)
129 ndefinition plus_b8_dc_dc ≝
130 λb1,b2:byte8.λc:bool.
131  match plus_ex_dc_dc (b8l b1) (b8l b2) c with
132   [ pair l c ⇒ match plus_ex_dc_dc (b8h b1) (b8h b2) c with
133    [ pair h c' ⇒ pair ?? 〈h,l〉 c' ]].
134
135 (* operatore somma con data+carry → data *)
136 ndefinition plus_b8_dc_d ≝
137 λb1,b2:byte8.λc:bool.
138  match plus_ex_dc_dc (b8l b1) (b8l b2) c with
139   [ pair l c ⇒ 〈plus_ex_dc_d (b8h b1) (b8h b2) c,l〉 ].
140
141 (* operatore somma con data+carry → c *)
142 ndefinition plus_b8_dc_c ≝
143 λb1,b2:byte8.λc:bool.
144  plus_ex_dc_c (b8h b1) (b8h b2) (plus_ex_dc_c (b8l b1) (b8l b2) c).
145
146 (* operatore somma con data → data+carry *)
147 ndefinition plus_b8_d_dc ≝
148 λb1,b2:byte8.
149  match plus_ex_d_dc (b8l b1) (b8l b2) with
150   [ pair l c ⇒ match plus_ex_dc_dc (b8h b1) (b8h b2) c with
151    [ pair h c' ⇒ pair ?? 〈h,l〉 c' ]].
152
153 (* operatore somma con data → data *)
154 ndefinition plus_b8_d_d ≝
155 λb1,b2:byte8.
156  match plus_ex_d_dc (b8l b1) (b8l b2) with
157   [ pair l c ⇒ 〈plus_ex_dc_d (b8h b1) (b8h b2) c,l〉 ].
158
159 (* operatore somma con data → c *)
160 ndefinition plus_b8_d_c ≝
161 λb1,b2:byte8.
162  plus_ex_dc_c (b8h b1) (b8h b2) (plus_ex_d_c (b8l b1) (b8l b2)).
163
164 (* operatore Most Significant Bit *)
165 ndefinition MSB_b8 ≝ λb:byte8.eq_ex x8 (and_ex x8 (b8h b)).
166
167 (* byte → naturali *)
168 ndefinition nat_of_byte8 ≝ λb:byte8.(16*(nat_of_exadecim (b8h b))) + (nat_of_exadecim (b8l b)).
169
170 (* operatore predecessore *)
171 ndefinition pred_b8 ≝
172 λb:byte8.match eq_ex (b8l b) x0 with
173  [ true ⇒ mk_byte8 (pred_ex (b8h b)) (pred_ex (b8l b))
174  | false ⇒ mk_byte8 (b8h b) (pred_ex (b8l b)) ]. 
175
176 (* operatore successore *)
177 ndefinition succ_b8 ≝
178 λb:byte8.match eq_ex (b8l b) xF with
179  [ true ⇒ mk_byte8 (succ_ex (b8h b)) (succ_ex (b8l b))
180  | false ⇒ mk_byte8 (b8h b) (succ_ex (b8l b)) ]. 
181
182 (* operatore neg/complemento a 2 *)
183 ndefinition compl_b8 ≝
184 λb:byte8.match MSB_b8 b with
185  [ true ⇒ succ_b8 (not_b8 b)
186  | false ⇒ not_b8 (pred_b8 b) ].
187
188 (* operatore moltiplicazione senza segno: e*e=[0x00,0xE1] *)
189 ndefinition mul_ex ≝
190 λe1,e2:exadecim.match e1 with
191  [ x0 ⇒ match e2 with
192   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x0〉   | x2 ⇒ 〈x0,x0〉   | x3 ⇒ 〈x0,x0〉
193   | x4 ⇒ 〈x0,x0〉   | x5 ⇒ 〈x0,x0〉   | x6 ⇒ 〈x0,x0〉   | x7 ⇒ 〈x0,x0〉
194   | x8 ⇒ 〈x0,x0〉   | x9 ⇒ 〈x0,x0〉   | xA ⇒ 〈x0,x0〉   | xB ⇒ 〈x0,x0〉
195   | xC ⇒ 〈x0,x0〉   | xD ⇒ 〈x0,x0〉   | xE ⇒ 〈x0,x0〉   | xF ⇒ 〈x0,x0〉 ]
196  | x1 ⇒ match e2 with
197   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x1〉   | x2 ⇒ 〈x0,x2〉   | x3 ⇒ 〈x0,x3〉
198   | x4 ⇒ 〈x0,x4〉   | x5 ⇒ 〈x0,x5〉   | x6 ⇒ 〈x0,x6〉   | x7 ⇒ 〈x0,x7〉
199   | x8 ⇒ 〈x0,x8〉   | x9 ⇒ 〈x0,x9〉   | xA ⇒ 〈x0,xA〉   | xB ⇒ 〈x0,xB〉
200   | xC ⇒ 〈x0,xC〉   | xD ⇒ 〈x0,xD〉   | xE ⇒ 〈x0,xE〉   | xF ⇒ 〈x0,xF〉 ]
201  | x2 ⇒ match e2 with
202   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x2〉   | x2 ⇒ 〈x0,x4〉   | x3 ⇒ 〈x0,x6〉
203   | x4 ⇒ 〈x0,x8〉   | x5 ⇒ 〈x0,xA〉   | x6 ⇒ 〈x0,xC〉   | x7 ⇒ 〈x0,xE〉
204   | x8 ⇒ 〈x1,x0〉   | x9 ⇒ 〈x1,x2〉   | xA ⇒ 〈x1,x4〉   | xB ⇒ 〈x1,x6〉
205   | xC ⇒ 〈x1,x8〉   | xD ⇒ 〈x1,xA〉   | xE ⇒ 〈x1,xC〉   | xF ⇒ 〈x1,xE〉 ]
206  | x3 ⇒ match e2 with
207   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x3〉   | x2 ⇒ 〈x0,x6〉   | x3 ⇒ 〈x0,x9〉
208   | x4 ⇒ 〈x0,xC〉   | x5 ⇒ 〈x0,xF〉   | x6 ⇒ 〈x1,x2〉   | x7 ⇒ 〈x1,x5〉
209   | x8 ⇒ 〈x1,x8〉   | x9 ⇒ 〈x1,xB〉   | xA ⇒ 〈x1,xE〉   | xB ⇒ 〈x2,x1〉
210   | xC ⇒ 〈x2,x4〉   | xD ⇒ 〈x2,x7〉   | xE ⇒ 〈x2,xA〉   | xF ⇒ 〈x2,xD〉 ]
211  | x4 ⇒ match e2 with
212   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x4〉   | x2 ⇒ 〈x0,x8〉   | x3 ⇒ 〈x0,xC〉
213   | x4 ⇒ 〈x1,x0〉   | x5 ⇒ 〈x1,x4〉   | x6 ⇒ 〈x1,x8〉   | x7 ⇒ 〈x1,xC〉
214   | x8 ⇒ 〈x2,x0〉   | x9 ⇒ 〈x2,x4〉   | xA ⇒ 〈x2,x8〉   | xB ⇒ 〈x2,xC〉
215   | xC ⇒ 〈x3,x0〉   | xD ⇒ 〈x3,x4〉   | xE ⇒ 〈x3,x8〉   | xF ⇒ 〈x3,xC〉 ]
216  | x5 ⇒ match e2 with
217   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x5〉   | x2 ⇒ 〈x0,xA〉   | x3 ⇒ 〈x0,xF〉
218   | x4 ⇒ 〈x1,x4〉   | x5 ⇒ 〈x1,x9〉   | x6 ⇒ 〈x1,xE〉   | x7 ⇒ 〈x2,x3〉
219   | x8 ⇒ 〈x2,x8〉   | x9 ⇒ 〈x2,xD〉   | xA ⇒ 〈x3,x2〉   | xB ⇒ 〈x3,x7〉
220   | xC ⇒ 〈x3,xC〉   | xD ⇒ 〈x4,x1〉   | xE ⇒ 〈x4,x6〉   | xF ⇒ 〈x4,xB〉 ]
221  | x6 ⇒ match e2 with
222   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x6〉   | x2 ⇒ 〈x0,xC〉   | x3 ⇒ 〈x1,x2〉
223   | x4 ⇒ 〈x1,x8〉   | x5 ⇒ 〈x1,xE〉   | x6 ⇒ 〈x2,x4〉   | x7 ⇒ 〈x2,xA〉
224   | x8 ⇒ 〈x3,x0〉   | x9 ⇒ 〈x3,x6〉   | xA ⇒ 〈x3,xC〉   | xB ⇒ 〈x4,x2〉
225   | xC ⇒ 〈x4,x8〉   | xD ⇒ 〈x4,xE〉   | xE ⇒ 〈x5,x4〉   | xF ⇒ 〈x5,xA〉 ]
226  | x7 ⇒ match e2 with
227   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x7〉   | x2 ⇒ 〈x0,xE〉   | x3 ⇒ 〈x1,x5〉
228   | x4 ⇒ 〈x1,xC〉   | x5 ⇒ 〈x2,x3〉   | x6 ⇒ 〈x2,xA〉   | x7 ⇒ 〈x3,x1〉
229   | x8 ⇒ 〈x3,x8〉   | x9 ⇒ 〈x3,xF〉   | xA ⇒ 〈x4,x6〉   | xB ⇒ 〈x4,xD〉
230   | xC ⇒ 〈x5,x4〉   | xD ⇒ 〈x5,xB〉   | xE ⇒ 〈x6,x2〉   | xF ⇒ 〈x6,x9〉 ]
231  | x8 ⇒ match e2 with
232   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x8〉   | x2 ⇒ 〈x1,x0〉   | x3 ⇒ 〈x1,x8〉
233   | x4 ⇒ 〈x2,x0〉   | x5 ⇒ 〈x2,x8〉   | x6 ⇒ 〈x3,x0〉   | x7 ⇒ 〈x3,x8〉
234   | x8 ⇒ 〈x4,x0〉   | x9 ⇒ 〈x4,x8〉   | xA ⇒ 〈x5,x0〉   | xB ⇒ 〈x5,x8〉
235   | xC ⇒ 〈x6,x0〉   | xD ⇒ 〈x6,x8〉   | xE ⇒ 〈x7,x0〉   | xF ⇒ 〈x7,x8〉 ]
236  | x9 ⇒ match e2 with
237   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,x9〉   | x2 ⇒ 〈x1,x2〉   | x3 ⇒ 〈x1,xB〉
238   | x4 ⇒ 〈x2,x4〉   | x5 ⇒ 〈x2,xD〉   | x6 ⇒ 〈x3,x6〉   | x7 ⇒ 〈x3,xF〉
239   | x8 ⇒ 〈x4,x8〉   | x9 ⇒ 〈x5,x1〉   | xA ⇒ 〈x5,xA〉   | xB ⇒ 〈x6,x3〉
240   | xC ⇒ 〈x6,xC〉   | xD ⇒ 〈x7,x5〉   | xE ⇒ 〈x7,xE〉   | xF ⇒ 〈x8,x7〉 ]
241  | xA ⇒ match e2 with
242   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xA〉   | x2 ⇒ 〈x1,x4〉   | x3 ⇒ 〈x1,xE〉
243   | x4 ⇒ 〈x2,x8〉   | x5 ⇒ 〈x3,x2〉   | x6 ⇒ 〈x3,xC〉   | x7 ⇒ 〈x4,x6〉
244   | x8 ⇒ 〈x5,x0〉   | x9 ⇒ 〈x5,xA〉   | xA ⇒ 〈x6,x4〉   | xB ⇒ 〈x6,xE〉
245   | xC ⇒ 〈x7,x8〉   | xD ⇒ 〈x8,x2〉   | xE ⇒ 〈x8,xC〉   | xF ⇒ 〈x9,x6〉 ]
246  | xB ⇒ match e2 with
247   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xB〉   | x2 ⇒ 〈x1,x6〉   | x3 ⇒ 〈x2,x1〉
248   | x4 ⇒ 〈x2,xC〉   | x5 ⇒ 〈x3,x7〉   | x6 ⇒ 〈x4,x2〉   | x7 ⇒ 〈x4,xD〉
249   | x8 ⇒ 〈x5,x8〉   | x9 ⇒ 〈x6,x3〉   | xA ⇒ 〈x6,xE〉   | xB ⇒ 〈x7,x9〉
250   | xC ⇒ 〈x8,x4〉   | xD ⇒ 〈x8,xF〉   | xE ⇒ 〈x9,xA〉   | xF ⇒ 〈xA,x5〉 ]
251  | xC ⇒ match e2 with
252   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xC〉   | x2 ⇒ 〈x1,x8〉   | x3 ⇒ 〈x2,x4〉
253   | x4 ⇒ 〈x3,x0〉   | x5 ⇒ 〈x3,xC〉   | x6 ⇒ 〈x4,x8〉   | x7 ⇒ 〈x5,x4〉
254   | x8 ⇒ 〈x6,x0〉   | x9 ⇒ 〈x6,xC〉   | xA ⇒ 〈x7,x8〉   | xB ⇒ 〈x8,x4〉
255   | xC ⇒ 〈x9,x0〉   | xD ⇒ 〈x9,xC〉   | xE ⇒ 〈xA,x8〉   | xF ⇒ 〈xB,x4〉 ]
256  | xD ⇒ match e2 with
257   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xD〉   | x2 ⇒ 〈x1,xA〉   | x3 ⇒ 〈x2,x7〉
258   | x4 ⇒ 〈x3,x4〉   | x5 ⇒ 〈x4,x1〉   | x6 ⇒ 〈x4,xE〉   | x7 ⇒ 〈x5,xB〉
259   | x8 ⇒ 〈x6,x8〉   | x9 ⇒ 〈x7,x5〉   | xA ⇒ 〈x8,x2〉   | xB ⇒ 〈x8,xF〉
260   | xC ⇒ 〈x9,xC〉   | xD ⇒ 〈xA,x9〉   | xE ⇒ 〈xB,x6〉   | xF ⇒ 〈xC,x3〉 ]
261  | xE ⇒ match e2 with
262   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xE〉   | x2 ⇒ 〈x1,xC〉   | x3 ⇒ 〈x2,xA〉
263   | x4 ⇒ 〈x3,x8〉   | x5 ⇒ 〈x4,x6〉   | x6 ⇒ 〈x5,x4〉   | x7 ⇒ 〈x6,x2〉
264   | x8 ⇒ 〈x7,x0〉   | x9 ⇒ 〈x7,xE〉   | xA ⇒ 〈x8,xC〉   | xB ⇒ 〈x9,xA〉
265   | xC ⇒ 〈xA,x8〉   | xD ⇒ 〈xB,x6〉   | xE ⇒ 〈xC,x4〉   | xF ⇒ 〈xD,x2〉 ]
266  | xF ⇒ match e2 with
267   [ x0 ⇒ 〈x0,x0〉   | x1 ⇒ 〈x0,xF〉   | x2 ⇒ 〈x1,xE〉   | x3 ⇒ 〈x2,xD〉
268   | x4 ⇒ 〈x3,xC〉   | x5 ⇒ 〈x4,xB〉   | x6 ⇒ 〈x5,xA〉   | x7 ⇒ 〈x6,x9〉
269   | x8 ⇒ 〈x7,x8〉   | x9 ⇒ 〈x8,x7〉   | xA ⇒ 〈x9,x6〉   | xB ⇒ 〈xA,x5〉
270   | xC ⇒ 〈xB,x4〉   | xD ⇒ 〈xC,x3〉   | xE ⇒ 〈xD,x2〉   | xF ⇒ 〈xE,x1〉 ]
271  ].
272
273 (* correzione per somma su BCD *)
274 (* input: halfcarry,carry,X(BCD+BCD) *)
275 (* output: X',carry' *)
276 ndefinition daa_b8 ≝
277 λh,c:bool.λX:byte8.
278  match lt_b8 X 〈x9,xA〉 with
279   (* [X:0x00-0x99] *)
280   (* c' = c *)
281   (* X' = [(b16l X):0x0-0x9] X + [h=1 ? 0x06 : 0x00] + [c=1 ? 0x60 : 0x00]
282           [(b16l X):0xA-0xF] X + 0x06 + [c=1 ? 0x60 : 0x00] *)
283   [ true ⇒
284    let X' ≝ match (lt_ex (b8l X) xA) ⊗ (⊖h) with
285     [ true ⇒ X
286     | false ⇒ plus_b8_d_d X 〈x0,x6〉 ] in
287    let X'' ≝ match c with
288     [ true ⇒ plus_b8_d_d X' 〈x6,x0〉
289     | false ⇒ X' ] in
290    pair ?? X'' c
291   (* [X:0x9A-0xFF] *)
292   (* c' = 1 *)
293   (* X' = [X:0x9A-0xFF]
294           [(b16l X):0x0-0x9] X + [h=1 ? 0x06 : 0x00] + 0x60
295           [(b16l X):0xA-0xF] X + 0x6 + 0x60 *) 
296   | false ⇒
297    let X' ≝ match (lt_ex (b8l X) xA) ⊗ (⊖h) with
298     [ true ⇒ X
299     | false ⇒ plus_b8_d_d X 〈x0,x6〉 ] in
300    let X'' ≝ plus_b8_d_d X' 〈x6,x0〉 in
301    pair ?? X'' true
302   ].
303
304 (* iteratore sui byte *)
305 ndefinition forall_byte8 ≝
306  λP.
307   forall_exadecim (λbh.
308   forall_exadecim (λbl.
309    P (mk_byte8 bh bl))).