1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Sviluppo: 2008-2010 *)
21 (* ********************************************************************** *)
23 include "num/bool_lemmas.ma".
24 include "emulator/opcodes/RS08_instr_mode.ma".
25 include "num/oct_lemmas.ma".
26 include "num/exadecim_lemmas.ma".
27 include "num/bitrigesim_lemmas.ma".
29 nlemma eq_to_eqRS08im : ∀n1,n2.n1 = n2 → eq_RS08_im n1 n2 = true.
33 ##[ ##11,12: #o; nrewrite > (eq_to_eqoct … (refl_eq …))
34 ##| ##13: #e; nrewrite > (eq_to_eqex … (refl_eq …))
35 ##| ##14: #t; nrewrite > (eq_to_eqbit … (refl_eq …)) ##]
40 nlemma neqRS08im_to_neq : ∀n1,n2.eq_RS08_im n1 n2 = false → n1 ≠ n2.
42 napply (not_to_not (n1 = n2) (eq_RS08_im n1 n2 = true) …);
43 ##[ ##1: napply (eq_to_eqRS08im n1 n2)
44 ##| ##2: napply (eqfalse_to_neqtrue … H)
48 (* !!! per brevita... *)
49 naxiom eqRS08im_to_eq : ∀c1,c2.eq_RS08_im c1 c2 = true → c1 = c2.
51 nlemma neq_to_neqRS08im : ∀n1,n2.n1 ≠ n2 → eq_RS08_im n1 n2 = false.
53 napply (neqtrue_to_eqfalse (eq_RS08_im n1 n2));
54 napply (not_to_not (eq_RS08_im n1 n2 = true) (n1 = n2) ? H);
55 napply (eqRS08im_to_eq n1 n2).
58 nlemma decidable_RS08im : ∀x,y:RS08_instr_mode.decidable (x = y).
60 napply (or2_elim (eq_RS08_im x y = true) (eq_RS08_im x y = false) ? (decidable_bexpr ?));
61 ##[ ##1: #H; napply (or2_intro1 (x = y) (x ≠ y) (eqRS08im_to_eq … H))
62 ##| ##2: #H; napply (or2_intro2 (x = y) (x ≠ y) (neqRS08im_to_neq … H))
66 nlemma symmetric_eqRS08im : symmetricT RS08_instr_mode bool eq_RS08_im.
68 napply (or2_elim (n1 = n2) (n1 ≠ n2) ? (decidable_RS08im n1 n2));
69 ##[ ##1: #H; nrewrite > H; napply refl_eq
70 ##| ##2: #H; nrewrite > (neq_to_neqRS08im n1 n2 H);
71 napply (symmetric_eq ? (eq_RS08_im n2 n1) false);
72 napply (neq_to_neqRS08im n2 n1 (symmetric_neq ? n1 n2 H))