Shift rule: Difference between revisions
(Add Shift Rules) |
No edit summary |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
A '''shift rule''' (also called a '''chain rule''') is a finite sequence of transitions which may be repeated an arbitrary number of times to "jump" over an entire repeated block of symbols on a compressed tape. | A '''shift rule''' (also called a '''chain rule''') is a finite sequence of transitions which may be repeated an arbitrary number of times to "jump" over an entire repeated block of symbols on a compressed tape. | ||
A simple canonical example is that if we have a | A simple canonical example is that if we have a [[Turing machine]] with the transition <math>(\textrm{S}, 1) \to (0, R, \textrm{S})</math> then using [[directed head notation]]: | ||
\\ | <math display="block"> | ||
\vphantom{\int}\textrm{S>} \; 1^n \xrightarrow{n} 0^n \; \textrm{S>} | |||
</math> | |||
In other words, if the machine is in state <math>\textrm{S}</math> and the head is reading the leftmost of a sequence of <math>n</math> ones, then <math>n</math> steps later it will have moved to the right of this entire sequence of ones, converting them all to zeros. | |||
To give a precise definition, suppose that there are words <math>t</math>, <math>r</math> and <math>r'</math> in the alphabet of the Turing machine in question, | |||
and assume that for some state <math>\textrm{S}</math> the machine transitions from <math>t \; \textrm{S>} \; r</math> to <math>r' t \; \textrm{S>}</math>. Then we have a ''right'' shift rule | |||
<math display="block"> | |||
\displaystyle\vphantom{\int} t \; \textrm{S>} \; r \to r'\;t\;\textrm{S>}. | |||
</math> | |||
Similarly, if the machine transitions from <math> r \; \textrm{<S} \; t</math> to <math>\textrm{<S} \; t r'</math>, then we have a ''left'' shift rule | |||
<math display="block"> | |||
\vphantom{\int} r \; \textrm{<S} \; t \to \textrm{<S} \; t\;r'. | |||
</math> | |||
== General Shift Rules == | == General Shift Rules == | ||
Shift rules can | Shift rules can jump over larger blocks. For example [[Skelet 1|Skelet #1]] ({{TM|1RB1RD_1LC0RC_1RA1LD_0RE0LB_---1RC}}) exhibits the following transitions: | ||
\\ | <math display="block"> | ||
\begin{array}{rcl} | |||
\textrm{A>} \; 110 110 & \xrightarrow{10} & 011 011 \; A> | \displaystyle\vphantom{\int} 011 \; \textrm{<C} & \xrightarrow{3} & \textrm{<C} \; 101 \\ | ||
\end{array}</math> | \textrm{A>} \; 110 110 & \xrightarrow{10} & 011 011 \;\textrm{A>} | ||
\\ | \end{array} | ||
</math> | |||
\textrm{A>} \; {110 110}^n & \xrightarrow{10n} & {011 011}^n \; A> \\ | Each of these can be repeated an arbitrary number of times, producing the general shift rules: | ||
\end{array}</math>Shift rules can also depend upon additional "local context". For example Skelet #1 also exhibits transition:<math display="block"> | <math display="block"> | ||
\\ | \begin{array}{rcl} | ||
\displaystyle\vphantom{\int}011^n \; \textrm{<C} & \xrightarrow{3n} & \textrm{<C} \; 101^n \\ | |||
\textrm{A>} \; {110 110}^n & \xrightarrow{10n} & {011 011}^n \;\textrm{A>} \\ | |||
\\ | \end{array} | ||
</math> | |||
Shift rules can also depend upon additional "local context". For example, Skelet #1 also exhibits this transition: | |||
<math display="block"> | |||
\vphantom{\int} 01 \; \textrm{<C} \; 1 \xrightarrow{6} \textrm{<C} \; 1 \; 01 | |||
</math> | |||
and since the resulting config has the same "context" (a 1 to the right of the head), this can be repeated as well to produce the shift rule: | |||
<math display="block"> | |||
\vphantom{\int} 01^n \; \textrm{<C} \; 1 \xrightarrow{6n} \textrm{<C} \; 1 \; 01^n. | |||
</math> | |||
== Inductive Rules == | |||
Shift rules can be seen as the simplest example of [[Inductive Proof System|inductive rules]]. Specifically, they are Level 0 Inductive rules which only use the inductive hypothesis once: Tape rewrite rules that can be proven using induction, where each step in the proof is either a basic Turing machine transition or an inductive application of the rule being proven that does not use any other previously proven rules). | |||
== Simulation Acceleration == | |||
One of the main uses of shift rules is to [[Accelerated Simulator|accelerate the simulation]] of Turing machines. For example, consider the simple [[bouncer]] {{TM|1RB1LA_1LA1RB}} using the shift rules: | |||
<math display="block">\begin{array}{rcl} | |||
\displaystyle\vphantom{\int}1^n \; \textrm{<A} & \xrightarrow{n} & \textrm{<A} \; 1^n \\ | |||
\textrm{B>} \; 1^n & \xrightarrow{n} & 1^n \; \textrm{B>} \\ | |||
\end{array}</math> | |||
We can accelerate the simulation like this: | |||
<math display="block">\begin{array}{ll} | |||
\text{Start}{:}&0^\infty \; \textrm{<A} \; 0^\infty \\ | |||
\text{Step 1}{:}&0^\infty \; 1 \; \textrm{B>} \; 0^\infty \\ | |||
\text{Step 2}{:}&0^\infty \; 1 \; \textrm{<A} \; 1 \; 0^\infty \\ | |||
\text{Step 3}{:}&0^\infty \; \textrm{<A} \; 1^2 \; 0^\infty \\ | |||
\qquad\qquad\qquad\vdots \\ | |||
\text{Step }2n^2+n{:}&0^\infty \; \textrm{<A} \; 1^{2n} \; 0^\infty \\ | |||
\text{Step }2n^2+n+1{:}&0^\infty \; 1 \; \textrm{B>} \; 1^{2n} \; 0^\infty \\ | |||
\text{Step }2n^2+3n+1{:}&0^\infty \; 1^{2n+1} \; \textrm{B>} \; 0^\infty \\ | |||
\text{Step }2n^2+3n+2{:}&0^\infty \; 1^{2n+1} \; \textrm{<A} \; 1 \; 0^\infty \\ | |||
\text{Step }2n^2+5n+3{:}&0^\infty \; \textrm{<A} \; 1^{2n+2} \; 0^\infty \\ | |||
\qquad\qquad\qquad\vdots \\ | |||
\end{array}</math> | \end{array}</math> | ||
In this case, they allow one to use <math>n</math> simulator steps to simulate <math>O(n^2)</math> base steps, which is the best-case speedup using only shift rules. More general [[Inductive Proof System|inductive rules]] that can further accelerate a Turing machine's simulation may build on top of shift rules. | |||
== | == Moving across an infinite line of 0s == | ||
Any Turing machine that has at least one of the two following types of shift rules: | |||
<math display="block"> | |||
\displaystyle\vphantom{\int}t\;\textrm{S>} \; 0^n \to r'\;t\;\textrm{S>}\qquad\text{or}\qquad \displaystyle\vphantom{\int}0^n\;\textrm{<S}\;t\to \textrm{<S}\;t\;r', | |||
</math> | |||
and which eventually reaches the configuration <math>t\;\textrm{S>}\;0^\infty</math> (for the first rule) or <math>0^\infty\;\textrm{<S}\;t</math> (for the second rule) is non-halting, becoming a [[translated cycler]]. |
Latest revision as of 23:54, 12 April 2025
A shift rule (also called a chain rule) is a finite sequence of transitions which may be repeated an arbitrary number of times to "jump" over an entire repeated block of symbols on a compressed tape.
A simple canonical example is that if we have a Turing machine with the transition then using directed head notation:
To give a precise definition, suppose that there are words , and in the alphabet of the Turing machine in question, and assume that for some state the machine transitions from to . Then we have a right shift rule
General Shift Rules
Shift rules can jump over larger blocks. For example Skelet #1 (1RB1RD_1LC0RC_1RA1LD_0RE0LB_---1RC
(bbch)) exhibits the following transitions:
Inductive Rules
Shift rules can be seen as the simplest example of inductive rules. Specifically, they are Level 0 Inductive rules which only use the inductive hypothesis once: Tape rewrite rules that can be proven using induction, where each step in the proof is either a basic Turing machine transition or an inductive application of the rule being proven that does not use any other previously proven rules).
Simulation Acceleration
One of the main uses of shift rules is to accelerate the simulation of Turing machines. For example, consider the simple bouncer 1RB1LA_1LA1RB
(bbch) using the shift rules:
We can accelerate the simulation like this:
Moving across an infinite line of 0s
Any Turing machine that has at least one of the two following types of shift rules: