Proof (computability of shortlex ordering)
"What is the relationship of the lengths of content in registers $i$ and $j$?"
-
Copy the contents of registers $i,j$ to unused registers $i', j'$.
-
If both registers $i'$ and $j'$ are non-empty:
-
Remove the final letters from both registers.
-
Go to 2.
-
-
If both registers $i'$ and $j'$ are empty,
-
answer "they are of equal length".
-
-
If register $i'$ is empty but register $j'$ is not,
-
answer "the content of register $i$ is shorter than the content of register $j$".
-
-
If register $j'$ is empty but register $i'$ is not,
-
answer "the content of register $j$ is shorter than the content of register $i$".
-
Characterstic function of $\sb{(v,w)}{v<w}$
-
Compare the lengths of $v$ and $w$.
-
If $|v|<|w|$,
-
empty register 0, add $a$ to it, and halt.
-
-
If $|w|<|v|$,
-
empty register 0 and halt.
-
-
If $|w|=|v|$:
-
Copy $v,w$ into unused registers in reverse order.
-
If both registers are non-empty:
-
Remove final letters $v(i), w(i)$ from both registers.
-
If $v(i) < w(i)$,
-
empty register 0, add $a$ to it, and halt.
-
-
If $w(i) < v(i)$,
-
empty register 0 and halt.
-
-
Go to 4.2.
-
-
Otherwise empty register 0 and halt.
-
Finding immediate successor of a word $w$
Suppose we have an ordering $a_0 < a_1 < \ldots < a_n$ on $Σ$.
-
Empty an unused register $j$.
-
If a final letter (say $a_l$) can be moved from $w$ to register $j$:
-
If $a_l=a_n$:
-
Go to 2.
-
-
Otherwise:
-
Add $a_{l+1}$ to $w$.
-
Add as many letters $a_0$ to $w$ as there are letters in register $j$.
-
Halt.
-
-
-
Otherwise:
-
Add as many letters $a_0$ to $w$ as there are letters in register $j$.
-
Add one more $a_0$.
-