| 1 |
\DOC use_wordn |
| 2 |
|
| 3 |
\TYPE {use_wordn : int -> (thm)list} |
| 4 |
|
| 5 |
\LIBRARY wordn |
| 6 |
|
| 7 |
\SYNOPSIS |
| 8 |
Defines the type of n-bit words and proves some basic theorems. |
| 9 |
|
| 10 |
\DESCRIBE |
| 11 |
The function {use_wordn} is one of the top level user functions of the |
| 12 |
wordn library. It provides a facility to define the type of n-bit |
| 13 |
words and to prove some basic theorems on this type. When the user |
| 14 |
needs to use n-bit words in an application, he/she can simply make |
| 15 |
a call to {use_wordn} with a single argument {n}. This will define the |
| 16 |
type {:wordn}, and a list of basic theorems about the type are returned. |
| 17 |
{use_wordn} combines the function {define_wordn_type} and the following |
| 18 |
functions for proving theorems about the type of n-bit words: |
| 19 |
{prove_function_defn_thm},\ {prove_wordn_induction_thm},\ |
| 20 |
{prove_wordn_cases_thm},\ {prove_BITS_one_one},\ |
| 21 |
{prove_BITS_onto},\ {prove_WORD_one_one},\newline |
| 22 |
{prove_WORD_onto},\ {prove_LENGTH_BITS_thm}. |
| 23 |
|
| 24 |
\FAILURE |
| 25 |
Failure occurs if any of the functions invoked fails. |
| 26 |
|
| 27 |
|
| 28 |
\EXAMPLE |
| 29 |
The HOL session below illustrates the use of the function {use_wordn}: |
| 30 |
{ |
| 31 |
# let [word3; word3_BITS_11; word3_BITS_onto; |
| 32 |
# word3_WORD_11; word3_WORD_onto; word3_LENGTH_BITS; |
| 33 |
# word3_FNDEF; word3_INDUCT; word3_CASES] = |
| 34 |
# use_wordn 3;; |
| 35 |
word3 = |
| 36 |
|- (!w. WORD3(BITS3 w) = w) /\ |
| 37 |
(!l. (LENGTH l = 3) = (BITS3(WORD3 l) = l)) |
| 38 |
word3_BITS_11 = |- !w' w. (BITS3 w = BITS3 w') ==> (w = w') |
| 39 |
word3_BITS_onto = |- !l. (LENGTH l = 3) ==> (?w. BITS3 w = l) |
| 40 |
word3_WORD_11 = |
| 41 |
|- !l l'. |
| 42 |
(LENGTH l = 3) /\ (LENGTH l' = 3) ==> |
| 43 |
(WORD3 l = WORD3 l') ==> |
| 44 |
(l = l') |
| 45 |
word3_WORD_onto = |- !w. ?l. (LENGTH l = 3) /\ (WORD3 l = w) |
| 46 |
word3_LENGTH_BITS = |- !w. LENGTH(BITS3 w) = 3 |
| 47 |
word3_FNDEF = |- !f. ?! fn. !b0 b1 b2. fn(WORD3[b0;b1;b2]) = f b0 b1 b2 |
| 48 |
word3_INDUCT = |- !P. (!b0 b1 b2. P(WORD3[b0;b1;b2])) ==> (!w. P w) |
| 49 |
word3_CASES = |- !w. ?b0 b1 b2. w = WORD3[b0;b1;b2] |
| 50 |
} |
| 51 |
|
| 52 |
\SEEALSO |
| 53 |
{define_wordn_type}, {prove_function_defn_thm}, {prove_wordn_induction_thm}, |
| 54 |
{prove_wordn_cases_thm}, {prove_BITS_one_one}, |
| 55 |
{prove_BITS_onto}, {prove_WORD_one_one}, |
| 56 |
{prove_WORD_onto}, {prove_LENGTH_BITS_thm}. |
| 57 |
|
| 58 |
|
| 59 |
\ENDDOC |