跳到正文

闲话

0

asmend约 4 分钟
原文
文章信息与版本

文章信息

发布
2025年3月29日
收录
2025年12月12日
更新
2026年11月15日
篇幅
约 4 分钟

版本

  1. v1当前

For every such a Turing machine M=(Q,Σ,Γ=Σ∪{⊥},δ,qstart,qaccept,qreject)M=(Q,\Sigma,\Gamma=\Sigma\cup\{\bot\},\delta,q_{start},q_{accept},q_{reject}), we construct a NFA NN to recognize L(M)L(M).

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

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

d(p0,q0)={0∀0≤t≤T,(p0,q0)≠(p(t),q(t))1(p0,q0)=(p(0),q(0))2(p0,q0)=(p(T),q(T))3(p0,q0)=∃0<t<T,(p(t),q(t)),p(t−1)=p(t)−1,p(t+1)=p(t)−14(p0,q0)=∃0<t<T,(p(t),q(t)),p(t−1)=p(t)+1,p(t+1)=p(t)−15(p0,q0)=∃0<t<T,(p(t),q(t)),p(t−1)=p(t)−1,p(t+1)=p(t)+16(p0,q0)=∃0<t<T,(p(t),q(t)),p(t−1)=p(t)+1,p(t+1)=p(t)+1.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)=0p(0)=0, q(0)=qstartq(0)=q_{start}, q(T)=qacceptq(T)=q_{accept} and q(t)≠qrejectq(t)\neq q_{reject} for every tt.

The construction of NN:

  • The state set Q′=([0,6]Q×Σ×{0,1})∪q′Q'=([0,6]^Q\times \Sigma\times \{0,1\})\cup q', where q′q' is the starting state. For other states, we use a function f:Q→[0,6]f:Q\to[0,6] , a character cc, and a bit bb to describe it. Where f(⋅)f(\cdot) represents current d(p,⋅)d(p,\cdot), c=xpc=x_p, and bb represents whether we go through a state where f(q)=2f(q)=2 for some qq.
  • The alphabet Σ′=Σ\Sigma'=\Sigma.
  • For the transition function δ\delta,
    • (f(⋅),c,b)∈δ(q′,c)(f(\cdot),c,b)\in \delta(q',c) if and only if f(0)=0f(0)=0, f(q)∉{3,4,5}f(q)\not\in\{3,4,5\} for every qq, and bb is consistent with f(⋅)f(\cdot).
    • (g(⋅),c′,b′)∈δ((f(⋅),c,b),c′)(g(\cdot),c',b')\in \delta((f(\cdot),c,b),c') if and only if they are consistent when (f(⋅),c,b)(f(\cdot),c,b) describes the state of pp and (g(⋅),c′,b′)(g(\cdot),c',b') describes the state of p+1p+1.
  • For the accepting states FF, a state (f(⋅),c,b)∈F′(f(\cdot),c,b)\in F' if and only if b=1b=1 and there exists some configurations for p>∣x∣p>|x| and it consistent with (f(⋅),c,b)(f(\cdot),c,b) when (f(⋅),c,b)(f(\cdot),c,b) describes the state of p=∣x∣p=|x|.

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

原文
存档评论1 条抓取于