0

· · 闲话

For every such a Turing machine M=(Q,\Sigma,\Gamma=\Sigma\cup\{\bot\},\delta,q_{start},q_{accept},q_{reject}), we construct a NFA N to recognize L(M).

For x\in L(M), suppose L(x) halts in T steps. Since M halts, the list of configurations [(p(t),q(t))]_{0\leq t\leq T} during the execution will not have repeating elements. Note that the head p will never larger than |x|+|Q|, otherwise M(x) will loop. So here q(t)\in Q,p(t)\in[0,|x|+|Q|].

Define a function d:[0,|x|+|Q|]\times Q\to[0,6] as

d(p_0,q_0)=\begin{cases} 0&\forall 0\leq t\leq T,(p_0,q_0)\neq(p(t),q(t))\\ 1&(p_0,q_0)=(p(0),q(0))\\ 2&(p_0,q_0)=(p(T),q(T))\\ 3&(p_0,q_0)=\exists 0<t<T,(p(t),q(t)),p(t-1)=p(t)-1,p(t+1)=p(t)-1\\ 4&(p_0,q_0)=\exists 0<t<T,(p(t),q(t)),p(t-1)=p(t)+1,p(t+1)=p(t)-1\\ 5&(p_0,q_0)=\exists 0<t<T,(p(t),q(t)),p(t-1)=p(t)-1,p(t+1)=p(t)+1\\ 6&(p_0,q_0)=\exists 0<t<T,(p(t),q(t)),p(t-1)=p(t)+1,p(t+1)=p(t)+1. \end{cases}

Note that p(0)=0, q(0)=q_{start}, q(T)=q_{accept} and q(t)\neq q_{reject} for every t.

The construction of N:

There exists an accepting path of N if and only if M accepts. So N can recognize L(M).