| 1 |
\chapter{Pre-proved Theorems} |
| 2 |
\input{theorems-intro} |
| 3 |
\section{The theory {\tt wordn\_base}} |
| 4 |
\THEOREM EXISTS\_wordn\_REP wordn\_base |
| 5 |
|- !n. ?l. (\l. LENGTH l = n)l |
| 6 |
\ENDTHEOREM |
| 7 |
\THEOREM wordn\_ABS\_REP wordn\_base |
| 8 |
|- !n. |
| 9 |
(?rep. TYPE_DEFINITION(\l'. LENGTH l' = n)rep) ==> |
| 10 |
(?REP ABS. |
| 11 |
(!w. ABS(REP w) = w) /\ (!l. (LENGTH l = n) = (REP(ABS l) = l))) |
| 12 |
\ENDTHEOREM |
| 13 |
\THEOREM wordn\_FN\_DEF\_THM wordn\_base |
| 14 |
|- !n ABS REP. |
| 15 |
(!a. ABS(REP a) = a) /\ (!r. (LENGTH r = n) = (REP(ABS r) = r)) ==> |
| 16 |
(!f. ?! fn. !r. (LENGTH r = n) ==> (fn(ABS r) = f r)) |
| 17 |
\ENDTHEOREM |
| 18 |
\section{The theory {\tt wordn\_bitops}} |
| 19 |
\THEOREM B\_AND\_ASSOC wordn\_bitops |
| 20 |
|- !l1 l2 l3. |
| 21 |
(LENGTH l1 = LENGTH l2) /\ (LENGTH l2 = LENGTH l3) ==> |
| 22 |
(B_AND l1(B_AND l2 l3) = B_AND(B_AND l1 l2)l3) |
| 23 |
\ENDTHEOREM |
| 24 |
\THEOREM B\_AND\_DEF wordn\_bitops |
| 25 |
|- (!l. B_AND[]l = []) /\ |
| 26 |
(!x1 l1 l2. B_AND(CONS x1 l1)l2 = CONS(x1 /\ HD l2)(B_AND l1(TL l2))) |
| 27 |
\ENDTHEOREM |
| 28 |
\THEOREM B\_AND\_SYM wordn\_bitops |
| 29 |
|- !l1 l2. (LENGTH l1 = LENGTH l2) ==> (B_AND l1 l2 = B_AND l2 l1) |
| 30 |
\ENDTHEOREM |
| 31 |
\THEOREM B\_NOT wordn\_bitops |
| 32 |
|- !l. B_NOT(B_NOT l) = l |
| 33 |
\ENDTHEOREM |
| 34 |
\THEOREM B\_NOT\_DEF wordn\_bitops |
| 35 |
|- (B_NOT[] = []) /\ (!x l. B_NOT(CONS x l) = CONS~x(B_NOT l)) |
| 36 |
\ENDTHEOREM |
| 37 |
\THEOREM B\_OR\_ASSOC wordn\_bitops |
| 38 |
|- !l1 l2 l3. |
| 39 |
(LENGTH l1 = LENGTH l2) /\ (LENGTH l2 = LENGTH l3) ==> |
| 40 |
(B_OR l1(B_OR l2 l3) = B_OR(B_OR l1 l2)l3) |
| 41 |
\ENDTHEOREM |
| 42 |
\THEOREM B\_OR\_DEF wordn\_bitops |
| 43 |
|- (!l. B_OR[]l = []) /\ |
| 44 |
(!x1 l1 l2. B_OR(CONS x1 l1)l2 = CONS(x1 \/ HD l2)(B_OR l1(TL l2))) |
| 45 |
\ENDTHEOREM |
| 46 |
\THEOREM B\_OR\_SYM wordn\_bitops |
| 47 |
|- !l1 l2. (LENGTH l1 = LENGTH l2) ==> (B_OR l1 l2 = B_OR l2 l1) |
| 48 |
\ENDTHEOREM |
| 49 |
\THEOREM B\_XOR\_ASSOC wordn\_bitops |
| 50 |
|- !l1 l2 l3. |
| 51 |
(LENGTH l1 = LENGTH l2) /\ (LENGTH l2 = LENGTH l3) ==> |
| 52 |
(B_XOR l1(B_XOR l2 l3) = B_XOR(B_XOR l1 l2)l3) |
| 53 |
\ENDTHEOREM |
| 54 |
\THEOREM B\_XOR\_DEF wordn\_bitops |
| 55 |
|- (!l. B_XOR[]l = []) /\ |
| 56 |
(!x1 l1 l2. B_XOR(CONS x1 l1)l2 = CONS~(x1 = HD l2)(B_XOR l1(TL l2))) |
| 57 |
\ENDTHEOREM |
| 58 |
\THEOREM B\_XOR\_SYM wordn\_bitops |
| 59 |
|- !l1 l2. (LENGTH l1 = LENGTH l2) ==> (B_XOR l1 l2 = B_XOR l2 l1) |
| 60 |
\ENDTHEOREM |
| 61 |
\THEOREM XOR\_ASSOC wordn\_bitops |
| 62 |
|- !x y z. ~(x = ~(y = z)) = ~(~(x = y) = z) |
| 63 |
\ENDTHEOREM |
| 64 |
\section{The theory {\tt wordn\_num}} |
| 65 |
\THEOREM BV wordn\_num |
| 66 |
|- !b. BV b = (b => SUC 0 | 0) |
| 67 |
\ENDTHEOREM |
| 68 |
\THEOREM VAL wordn\_num |
| 69 |
|- (VAL[] = 0) /\ |
| 70 |
(!b bs. VAL(CONS b bs) = ((BV b) * (2 EXP (LENGTH bs))) + (VAL bs)) |
| 71 |
\ENDTHEOREM |
| 72 |
\THEOREM VAL\_LESS wordn\_num |
| 73 |
|- !l. (VAL l) < (2 EXP (LENGTH l)) |
| 74 |
\ENDTHEOREM |
| 75 |
\THEOREM VAL\_LESS\_EQ wordn\_num |
| 76 |
|- !l. (VAL l) <= ((2 EXP (LENGTH l)) - 1) |
| 77 |
\ENDTHEOREM |
| 78 |
\THEOREM VAL\_ONE\_ONE wordn\_num |
| 79 |
|- !l1 l2. (LENGTH l1 = LENGTH l2) ==> (VAL l1 = VAL l2) ==> (l1 = l2) |
| 80 |
\ENDTHEOREM |
| 81 |
\THEOREM VAL\_ONTO wordn\_num |
| 82 |
|- !l. ?n. VAL l = n |
| 83 |
\ENDTHEOREM |
| 84 |
\THEOREM VAL\_ONTO\_LEMMA wordn\_num |
| 85 |
|- !m n. n < (2 EXP m) ==> (?l. (LENGTH l = m) /\ (n = VAL l)) |
| 86 |
\ENDTHEOREM |
| 87 |
\THEOREM WORDN wordn\_num |
| 88 |
|- !n m. (LENGTH(WORDN n m) = n) /\ (VAL(WORDN n m) = m MOD (2 EXP n)) |
| 89 |
\ENDTHEOREM |
| 90 |
\THEOREM WORDN\_0 wordn\_num |
| 91 |
|- (!m. WORDN 0 m = []) /\ (!n. WORDN(SUC n)0 = CONS F(WORDN n 0)) |
| 92 |
\ENDTHEOREM |
| 93 |
\THEOREM WORDN\_MOD wordn\_num |
| 94 |
|- !m n. WORDN n m = WORDN n(m MOD (2 EXP n)) |
| 95 |
\ENDTHEOREM |
| 96 |
\THEOREM WORDN\_VAL wordn\_num |
| 97 |
|- !l. WORDN(LENGTH l)(VAL l) = l |
| 98 |
\ENDTHEOREM |