| 1 |
\DOC wordn_bit_ops |
| 2 |
|
| 3 |
\TYPE {wordn_bit_ops : thm -> int -> (thm)list} |
| 4 |
|
| 5 |
\LIBRARY wordn |
| 6 |
|
| 7 |
\SYNOPSIS |
| 8 |
Defines bitwise operators and proves some basic theorems about them. |
| 9 |
|
| 10 |
\DESCRIBE |
| 11 |
{wordn_bit_ops fndef n}, where {fndef} is the theorem returned by |
| 12 |
{prove_function_defn_thm} and {n} is the word length, defines a set of |
| 13 |
commonly used bitwise logical operators and proves some basic theorems |
| 14 |
about these operators. It combines the functions of |
| 15 |
{define_wordn_bit_ops}, and {prove_bit_op_thms}. |
| 16 |
|
| 17 |
\FAILURE |
| 18 |
Fails if either it is not in draft mode, or the input theorem is not |
| 19 |
in the expected form or the type {:wordn} has not been defined. |
| 20 |
|
| 21 |
\EXAMPLE |
| 22 |
{wordn_bit_ops word3_FNDEF 3} returns the following list of definitions and |
| 23 |
theorems: |
| 24 |
{ |
| 25 |
[ |- !b0 b1 b2. NOT3(WORD3[b0;b1;b2]) = WORD3(B_NOT[b0;b1;b2]); |
| 26 |
|- !b0 b1 b2 w. |
| 27 |
(WORD3[b0;b1;b2]) AND3 w = WORD3(B_AND[b0;b1;b2](BITS3 w)); |
| 28 |
|- !b0 b1 b2 w. |
| 29 |
(WORD3[b0;b1;b2]) OR3 w = WORD3(B_OR[b0;b1;b2](BITS3 w)); |
| 30 |
|- !b0 b1 b2 w. |
| 31 |
(WORD3[b0;b1;b2]) XOR3 w = WORD3(B_XOR[b0;b1;b2](BITS3 w)); |
| 32 |
|- !w. NOT3(NOT3 w) = w; |
| 33 |
|- !w1 w2. w1 AND3 w2 = w2 AND3 w1; |
| 34 |
|- !w1 w2. w1 OR3 w2 = w2 OR3 w1; |
| 35 |
|- !w1 w2. w1 XOR3 w2 = w2 XOR3 w1; |
| 36 |
|- !w1 w2 w3. w1 AND3 (w2 AND3 w3) = (w1 AND3 w2) AND3 w3; |
| 37 |
|- !w1 w2 w3. w1 OR3 (w2 OR3 w3) = (w1 OR3 w2) OR3 w3; |
| 38 |
|- !w1 w2 w3. w1 XOR3 (w2 XOR3 w3) = (w1 XOR3 w2) XOR3 w3 ] |
| 39 |
} |
| 40 |
|
| 41 |
\SEEALSO |
| 42 |
{define_wordn_bit_ops}, {prove_bit_op_thms}. |
| 43 |
|
| 44 |
\ENDDOC |