计算理论笔记(四)Undecidability Enumerator

本文探讨了递归语言 HaltingProblem 的性质,证明了其非递归性和R.E.但非recursive。通过H、H'、Hd的构造,展示了 Rice 定理的应用,揭示了R.E.语言的不封闭性。涉及了Turing枚举、决定性、完备性等概念,并列举了一系列不可判定问题,如TM是否停机、语言属性判断等。
Halting Problem
  • H={H=\{H={MMM”“www”: MMM is a TM that halts on w}w\}w}
  • HHH is R.E.
  • If HHH is recursive, then all R.E. languages are recursive
  • HHH is not recursive
Lemma: HHH is recursively enumerable
  • Universal TM: U=U=U= on input “MMM”“www
    1. run MMM on “www
    2. if MMM halts on “www”, halts on “MMM”“www
  • UUU halts on “MMM”“www  ⟺  \iff MMM halts on w  ⟺  w \iffwMMM”“www∈H\in HH
  • UUU semidecides HHH
Lemma: If HHH is recursive, so are all R.E. languages
  • Also: HHH is complete for the class of R.E. languages
  • Let AAA be a R.E. language and MMM be a TM that semidecides AAA
  • Is w∈Aw\in AwA?   ⟺  \iff Does MMM halt on www?   ⟺  \iffMMM”“www∈H\in HH
  • If HHH is recursive, there exists a TM MHM_HMH that decides HHH
  • MA=M_\mathrm{A}=MA= on input www
    1. run MHM_\mathrm{H}MH on “MMM”“www
    2. if MHM_\mathrm{H}MH accepts “MMM”“www”, accept www
    3. else reject
Theorem: HHH is not recursive
  • H={H=\{H={MMM”“www”: MMM is a TM that halts on w}w\}w}
  • H′={H'=\{H={MMM”: MMM is a TM that halts on “MMM}\}}
  • Hd={H_d=\{Hd={MMM”: MMM is a TM that does not halt on “MMM}\}}
  • Claim: If HHH is recursive, then HdH_dHd is also recursive
    • If HHH is recursive, there exists a TM MHM_HMH that decides HHH
    • Md=M_\mathrm{d}=Md= on input “MMM
      1. run MHM_\mathrm{H}MH on “MMM”““MMM””
      2. if MHM_\mathrm{H}MH accepts “MMM”““MMM””, reject “MMM
      3. else accept
  • Claim: HdH_dHd is not R.E.
    • Suppose HdH_dHd is R.E., there exists a TM DDD semidecides HdH_dHd
    • DDD on input “MMM
      • halts if “MMM∈Hd\in H_dHd, therefore MMM does not halt on “MMM
      • does not halt if “MMM∉Hd\notin H_d/Hd, therefore MMM halts on “MMM
    • Barber Dilemma: DDD on input “DDD
      • halts if DDD does not halt on “DDD
      • does not halt if DDD halts on “DDD
Lemma: LLL is recursive iff LLL and L‾\overline{L}L is both R.E.
  • sufficiency: recursive under complement
    • LLL and L‾\overline{L}L are both recursive, therefore also R.E.
  • necessity: MLM_LML and ML‾M_{\overline{L}}ML semidecides LLL and L‾\overline{L}L, respectively
    • M∗=M^*=M= on input www
      1. run MLM_\mathrm{L}ML and ML‾M_\mathrm{\overline{L}}ML on www in parallel
      2. if MLM_\mathrm{L}ML halts, accept www
      3. else if ML‾M_\mathrm{\overline{L}}ML halts, reject www
Theorem: The class of R.E. languages is not closed under complement
  • HHH and H‾\overline{H}H are both R.E., then HHH is recursive
Definition
  • Let AAA and BBB be two languages over ΣA\Sigma_AΣA and ΣB\Sigma_BΣB, respectively
  • AAA reduction from AAA to BBB is a computable function f:ΣA∗→ΣB∗f:\Sigma_A^*\to\Sigma_B^*f:ΣAΣB
Theorem
  • Suppose that there is a reduction fff from AAA to BBB, if BBB is recursive, so is AAA
  • MA=M_\mathrm{A}=MA= on input www
    1. compute f(w)f(w)f(w)
    2. run MBM_\mathrm{B}MB on f(w)f(w)f(w)
    3. if MBM_\mathrm{B}MB accepts f(w)f(w)f(w), accept www
    4. else reject
  • A⪯BA\preceq BAB
Theorem: The following problems are undecidable
  • A={A=\{A={MMM”: MMM is a TM that halts on e}e\}e}
    • Given a TM MMM and a string www
    • Mw=M_w=Mw= on input www
      1. run MMM on uuu
      2. if MMM halts on uuu, halts
    • MwM_wMw halts on eee (“MwM_wMw∈A\in AA)   ⟺  \iff MwM_wMw halts on every input   ⟺  Mw\iff M_wMw halts on www (“MMM”“www∈H\in HH)
    • Notice: “MwM_wMw” is used as input of AAA
    • H⪯AH\preceq AHA
  • B={B=\{B={MMM”: MMM is a TM that halts on some strings}\}}
    • f(f(f(MMM”“www)=)=)=MwM_wMw
    • H⪯BH\preceq BHB
  • C={C=\{C={MMM”: MMM is a TM that halts on every string}\}}
    • f(f(f(MMM”“www)=)=)=MwM_wMw
    • H⪯CH\preceq CHC
  • D={D=\{D={"M1M_1M1"“M2M_2M2”: M1M_1M1 and M2M_2M2 are two TMs that halts on the same string}\}}
    • Let M∗M^*M be a TM with S∈H  ⟺  M∗S\in H\iff M^*SHM halts on every input
    • f(f(f(MMM)=)=)=MMM”“M∗M^*M
    • C⪯DC\preceq DCD
  • E1={E_1=\{E1={MMM”: MMM is a TM that L(M)L(M)L(M) is regular}\}}
  • E2={E_2=\{E2={MMM”: MMM is a TM that L(M)L(M)L(M) is context-free}\}}
  • E3={E_3=\{E3={MMM”: MMM is a TM that L(M)L(M)L(M) is recursive}\}}
    • Given a TM MMM and a string www
    • f(f(f(MMM”“www)=)=)=MwM_wMw
    • Mw=M_w=Mw= on input vvv
      1. run MMM on www
      2. run UUU on “MMM”“vvv
    • if “MMM”“www∉H\notin H/H, does not halt in step 1, L(Mw)=∅L(M_w)=\varnothingL(Mw)=
    • if “MMM”“www∈H\in HH, L(Mw)=L(U)=HL(M_w)=L(U)=HL(Mw)=L(U)=H
    • L(Mw)L(M_w)L(Mw) is regular/context-free/recursive iff “MMM”“www∉H\notin H/H
    • H⪯E1‾,E2‾,E3‾H\preceq \overline{E_1},\overline{E_2},\overline{E_3}HE1,E2,E3
  • There is a certain fixed TM MMM, for which the following problem is undecidable:
    • Given a string www, does MMM halt on www?
    • Language: L(M)L(M)L(M)
    • Run UUU on “MMM”“www
Rice’s Theorem
  • Suppose L\mathcal{L}L is a proper, non-empty subset of all R.E. languages, the following is undecidable: given a TM MMM, is L(M)∈LL(M)\in\mathcal{L}L(M)L?
  • S={S=\{S={MMM”: MMM is a TM that L(M)∈L}L(M)\in\mathcal{L}\}L(M)L}
  • Proof:
    • Assume ∅∉L\varnothing\notin\mathcal{L}/L, otherwise let L\mathcal{L}L be its complement
    • Let a language A∈LA\in\mathcal{L}AL and a TM MAM_\mathrm{A}MA that semidecides AAA
    • f(f(f(MMM”“www)=)=)= on input uuu
      1. run MMM on www
      2. run MAM_\mathrm{A}MA on uuu
    • if “MMM”“www∉H\notin H/H, L(f(L(f(L(f(MMM”“www))=∅))=\varnothing))=
    • if “MMM”“www∈H\in HH, L(f(L(f(L(f(MMM”“www))=L(MA)=A∈L))=L(M_A)=A\in\mathcal{L}))=L(MA)=AL
    • H⪯SH\preceq SHS
  • Given a TM MMM, does MMM halt on eee?
    • L={L\mathcal{L}=\{LL={L: LLL is R.E. and e∈L}e\in L\}eL}
  • Given a TM MMM, does MMM halt on some input?
    • L={L\mathcal{L}=\{LL={L: LLL is R.E. and L≠∅}L\ne\varnothing\}L=}
  • Given a TM MMM, does MMM halt on every input?
    • L={Σ∗}\mathcal{L}=\{\Sigma^*\}L={Σ}
  • Given a TM MMM, is L(M)L(M)L(M) regular/context-free/recursive?
    • L={L\mathcal{L}=\{LL={L: LLL is regular/context-free/recursive}\}}
Theorem: A language LLL is R.E. iff it is Turing enumerable
  • Assume LLL is infinite
  • sufficiency:
    • Let MMM be a TM that enumerates LLL
    • Construct a TM M′M'M to semidecide LLL
    • M′=M'=M= on input www
      1. run MMM to enumerate LLL
      2. every time MMM outputs a string, compare it with www, and halt if they match
  • necessity:
    • Let MMM be a TM that semidecides LLL
    • Construct a TM M′M'M to enumerate LLL
    • Name all strings over Σ\SigmaΣ as s1,s2,…s_1,s_2,\dotss1,s2, in lexicographical order
    • M′=M'=M= on input www
      1. for i=1,2,…i=1,2,\dotsi=1,2,
      • run MMM on s1,s2,…,sis_1,s_2,\dots,s_is1,s2,,si at most iii steps
      1. if MMM hatls on sjs_jsj in iii steps, output sjs_jsj
Definition
  • Let MMM be a TM enumerates LLL, we say MMM lexicographically enumerate LLL if whenever (q,⊳⊔‾w)⊢M+(q,⊳⊔‾w′)(q,\rhd\underline{\sqcup}w)\vdash^+_M(q,\rhd\underline{\sqcup}w')(q,w)M+(q,w)
    • w′w'w is after www in lexico order
Theorem: A language is recursive iff it is lexico Turing enumerable
  • sufficiency:
    • Let MMM be a TM that decides LLL
    • Construct a TM M′M'M to lexico enumerate LLL
    • M′=M'=M= on input www
      1. generate all strings voer Σ\SigmaΣ in lexico order
      2. run MMM on each string www to see if w∈Lw\in LwL
      3. if MMM accepts www, accept
      4. else reject
  • necessity:
    • Let MMM be a TM that lexico enumerates LLL
    • Construct a TM M′M'M to decide LLL
    • M′=M'=M= on input www
      1. run MMM to enumerate LLL until MMM outputs a string is after www in lexico order
      2. if www is among strings that output, accept www
      3. else reject
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值