| 1 |
\DOC define_word_partition |
| 2 |
|
| 3 |
\TYPE {define_word_partition : int -> int -> thm} |
| 4 |
|
| 5 |
\LIBRARY wordn |
| 6 |
|
| 7 |
\SYNOPSIS |
| 8 |
Defines operators for splitting and joining words. |
| 9 |
|
| 10 |
\DESCRIBE |
| 11 |
{define_word_partition m n} defines the following two constants: |
| 12 |
{JOIN_m_n} which has type {:(wordm # wordn) -> wordl} and |
| 13 |
{SPLIT_m_n} which has type {:wordl -> (wordm # wordn)} where {l = m + n}. |
| 14 |
They are specified by the following theorem: |
| 15 |
{ |
| 16 |
|- (!wm wn. SPLIT_m_n(JOIN_m_n(wm,wn)) = wm,wn) /\ |
| 17 |
(!w. JOIN_m_n(SPLIT_m_n w) = w) |
| 18 |
} |
| 19 |
\noindent which is stored in the current theory as a definition under the name |
| 20 |
{PARTITION_m_n} and is returned as the value of this function. |
| 21 |
|
| 22 |
\FAILURE |
| 23 |
Fails if either it is not in draft mode or any of the word types |
| 24 |
involved has not been defined. |
| 25 |
|
| 26 |
\EXAMPLE |
| 27 |
{define_word_partition 3 5} returns the following definition: |
| 28 |
{ |
| 29 |
|- (!wm wn. SPLIT_3_5(JOIN_3_5 (wm,wn)) = wm,wn) /\ |
| 30 |
(!w. JOIN_3_5(SPLIT_3_5 w) = w) |
| 31 |
} |
| 32 |
where {wm} is of type {:word3}, {wn} is of type {:word5} and {w} is |
| 33 |
{:word8}. |
| 34 |
|
| 35 |
\ENDDOC |