<<

Decision Problems with TM’s

Lecture 32: • Last time showed all below undecidable:

• ATM = {⟨M,w⟩ | M is a TM and w ∈ L(M)} CSCI 81 Spring, 2012 • HTM = {⟨M,w⟩ | M is a TM which halts on input w}

• TOTALTM = {M | M halts on all inputs} Kim Bruce • ETM ={M | M is a TM and L(M)=∅}

Semi-decidable Another Example

• ATM and HTM both semi-decidable using UTM. • Lε0 = { | M on ε eventually writes a 0} Given M, rewrite to replace any occurrences of 0 in Show HTM not decidable. • • transitions by new character φ. • Let E be candidate TM to decide HTM. Show can’t be right. • If 0 in input alphabet replace all occurrences of 0 on input by φ. • From E, create TM D s.t. if input w, create and simulate • Modify again so that if it ever goes into a halt state then E on it (i.e, it treats input as if of form ) writes 0 on tape. Call this machine M’ • If E rejects then make D accept and if E accepts, D loops forever • One last modification: Erase input, write w, then run M’ • Now run D on Diagonal on w. Call new machine M’w.

• If ∈ HTM then D halts on D, so E rejected & ∉ L(E) • Claim ∈ Lε0 iff ∈ HTM. • If ∉ HTM then D not halt on D, so E accepted, ∈ L(E) • Therefore can use Lε0 to solve , so not • Either way, L(E) ≠ HTM with in one but not other. decidable. Entscheidungsproblem Entscheidungsproblem • Turing’s solution: • More detail on Turing’s solution last step: • First showed universal TM • Given TM M, M and its computation can be described • Essentially showed undecidability of halting problem in predicate . • Actually “circle-free” TM’s (related to hmwk 3cd) • Primitives: c is code of a configuration, square of tape • Showed undecidability of determining if ever write 0 on • One config follows from another via transition in M empty input • In c, TM is scanning square s, and s contains y • Can encode TM as a number (we did as string). • Write about execution (depending on M): • Showed given TM M, can write a logical formula ψ of • if M contains transition (p,a,q,b,→) then : predicate logic such that ψ is true iff M writes 0 on ε if M in config c w/state p, scanning square s containing a, then next config contains state q, s contains b, and M is scanning cell s+1. • Contradiction! Therefore not decidable

Entscheidungsproblem Decidable & Semidecidable

• More on Turing’s solution last step: SD

• Given TM M, can write a logical formula ψ of predicate D logic such that ψ is true iff M writes 0 on ε input. Context-Free • Let ψ be statement: In some configuration of M starting with ε, Languages some square s contains the symbol o Regular Languages • Let φ1,...,φn be axioms for M.

• Then formula is φ1∧... ∧φn→ ψ

• Thus M writes 0 on input ε iff φ1∧... ∧φn→ ψ is provable in predicate calculus. • Therefore provability undecidable! The Hierarchy Distinguishing D and SD

• Most obvious languages in SD also in D • : The of context-free languages is a • AnBnCn = {anbncn | n ≥ 0} proper of D. • {wcw | w ∈ {a, b}*} Proof: Every context-free language is decidable, so the • {ww | w ∈ {a, b}*} context-free languages are a subset of D. • {w of form x∗y=z: x,y,z ∈ {0, 1}* and, when x, y, and z are There is at least one language, AnBnCn, that is decidable • • viewed as binary numbers, xy = z} but not context-free.

• But already found some in gap, e.g. HTM

Outside of SD Closure Properties

• Theorem: D is closed under complement • Proof: Let L ε D. Build TM deciding L • Uncountably many languages outside of SD • ... • Proof depends on TM deterministic and always halts. • Complement of HTM • What about SD?

• Not true for HTM Equivalences to SD SD & Turing Enumerable

• A TM M enumerates the language L iff, for some • Theorem: A language is SD iff it is Turing fixed state p of M, enumerable. L = {w : (s, ε) |- * (p, w)}. M • Proof: Spose L is Turing enumerable. Show L is SD. • Potentia"y infinite computation. • Let w be input. Start enumerating L. Every time enter state p, check to see if contents of tape is w. If yes then halt and stop. • A language is Turing-enumerable iff there is a Otherwise keep going. that enumerates it. • “Obvious” proof in other direction not work!