For every such a Turing machine M=(Q,Σ,Γ=Σ∪{⊥},δ,qstart,qaccept,qreject), we construct a NFA N to recognize L(M).
For x∈L(M), suppose L(x) halts in T steps. Since M halts, the list of configurations [(p(t),q(t))]0≤t≤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)∈Q,p(t)∈[0,∣x∣+∣Q∣].
Note that p(0)=0, q(0)=qstart, q(T)=qaccept and q(t)=qreject for every t.
The construction of N:
The state set Q′=([0,6]Q×Σ×{0,1})∪q′, where q′ is the starting state. For other states, we use a function f:Q→[0,6] , a character c, and a bit b to describe it. Where f(⋅) represents current d(p,⋅), c=xp, and b represents whether we go through a state where f(q)=2 for some q.
The alphabet Σ′=Σ.
For the transition function δ,
(f(⋅),c,b)∈δ(q′,c) if and only if f(0)=0, f(q)∈{3,4,5} for every q, and b is consistent with f(⋅).
(g(⋅),c′,b′)∈δ((f(⋅),c,b),c′) if and only if they are consistent when (f(⋅),c,b) describes the state of p and (g(⋅),c′,b′) describes the state of p+1.
For the accepting states F, a state (f(⋅),c,b)∈F′ if and only if b=1 and there exists some configurations for p>∣x∣ and it consistent with (f(⋅),c,b) when (f(⋅),c,b) describes the state of p=∣x∣.
There exists an accepting path of N if and only if M accepts. So N can recognize L(M).