Debian Codegraph @

contrib/wordn/help/ENTRIES/define_wordn_bit_ops.doc

raw
1 \DOC define_wordn_bit_ops
2
3 \TYPE {define_wordn_bit_ops : thm -> int -> (thm) list}
4
5 \LIBRARY wordn
6
7 \SYNOPSIS
8 Defines a set of bitwise logical operators for the given word length.
9
10 \DESCRIBE
11 {define_wordn_bit_ops wordn_FNDEF n}, where {wordn_FNDEF} is the theorem
12 returned by calling the function {prove_function_defn_thm} and {n} is the
13 word length, defines four
14 commonly used bitwise logical operators: {NOTn}, {ANDn}, {ORn}, and
15 {XORn}. The definitions are stored in the current theory under the
16 names: {NOTn_DEF}, {ANDn_DEF}, {ORn_DEF} and {XORn_DEF} and are
17 returned in a list as the value of this function.
18
19 \FAILURE
20 Fails if either it is not in draft mode, or the input theorem is not
21 in the expected form or the type {:wordn} has not been defined.
22
23 \EXAMPLE
24 {define_wordn_bit_ops word3_FNDEF 3} returns the following list of
25 definitons:
26 {
27 [ |- !b0 b1 b2. NOT3(WORD3[b0;b1;b2]) = WORD3(B_NOT[b0;b1;b2]);
28 |- !b0 b1 b2 w.
29 (WORD3[b0;b1;b2]) AND3 w = WORD3(B_AND[b0;b1;b2](BITS3 w));
30 |- !b0 b1 b2 w.
31 (WORD3[b0;b1;b2]) OR3 w = WORD3(B_OR[b0;b1;b2](BITS3 w));
32 |- !b0 b1 b2 w.
33 (WORD3[b0;b1;b2]) XOR3 w = WORD3(B_XOR[b0;b1;b2](BITS3 w)) ]
34 }
35 \noindent and they are stored in the current theory under the names
36 {NOT3_DEF}, {AND3_DEF}, {OR3_DEF} and {XOR3_DEF}, repectively.
37
38 \SEEALSO
39 {prove_bit_opthms}, {wordn_bit_ops}.
40
41 \ENDDOC