Undecidable problems for Recursively enumerable languages continued Fall
Undecidable problems for Recursively enumerable languages continued… Fall 2004 COMP 335 1
Take a recursively enumerable language Decision problems: • is empty? • is finite? • contains two different strings of the same length? All these problems are undecidable Fall 2004 COMP 335 2
Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the halting problem to this problem Fall 2004 COMP 335 3
Let be the TM with Suppose we have a decider for the finite language problem: finite language problem decider Fall 2004 YES finite NO not finite COMP 335 4
We will build a decider for the halting problem: Halting problem decider Fall 2004 YES halts on NO doesn’t halt on COMP 335 5
We want to reduce the halting problem to the finite language problem Halting problem decider YES NO finite language problem YES NO decider Fall 2004 COMP 335 6
We need to convert one problem instance to the other problem instance Halting problem decider convert input ? Fall 2004 YES NO finite language problem YES NO decider COMP 335 7
Construct machine : On arbitrary input string Initially, simulates on input If enters a halt state, accept ( inifinite language) Otherwise, reject Fall 2004 COMP 335 ( finite language) 8
halts on if and only if is infinite Fall 2004 COMP 335 9
halting problem decider YES construct Fall 2004 NO finite language problem YES decider NO COMP 335 10
Take a recursively enumerable language Decision problems: • is empty? • is finite? • contains two different strings of the same length? All these problems are undecidable Fall 2004 COMP 335 11
Theorem: For a recursively enumerable language it is undecidable to determine whether contains two different strings of same length Proof: We will reduce the halting problem to this problem Fall 2004 COMP 335 12
Let be the TM with Suppose we have the decider for the two-strings problem: Two-strings problem decider YES contains NO Doesn’t contain two equal length strings Fall 2004 COMP 335 13
We will build a decider for the halting problem: Halting problem decider Fall 2004 YES halts on NO doesn’t halt on COMP 335 14
We want to reduce the halting problem to the empty language problem Halting problem decider Two-strings problem decider Fall 2004 COMP 335 YES NO NO 15
We need to convert one problem instance to the other problem instance Halting problem decider convert inputs ? Fall 2004 Two-strings problem decider COMP 335 YES NO NO 16
Construct machine : On arbitrary input string Initially, simulate on input When enters a halt state, accept if or (two equal length strings Otherwise, reject Fall 2004 ) ( COMP 335 ) 17
halts on if and only if accepts two equal length strings accepts Fall 2004 COMP 335 and 18
Halting problem decider construct Fall 2004 Two-strings problem decider COMP 335 YES NO NO 19
Rice’s Theorem Fall 2004 COMP 335 20
Definition: Non-trivial properties of recursively enumerable languages: any property possessed by some (not all) recursively enumerable languages Fall 2004 COMP 335 21
Some non-trivial properties of recursively enumerable languages: Fall 2004 • is empty • is finite • contains two different strings of the same length COMP 335 22
Rice’s Theorem: Any non-trivial property of a recursively enumerable language is undecidable Fall 2004 COMP 335 23
The Post Correspondence Problem Fall 2004 COMP 335 24
Some undecidable problems for context-free languages: • Is ? are context-free grammars • Is context-free grammar Fall 2004 COMP 335 ambiguous? 25
We need a tool to prove that the previous problems for context-free languages are undecidable: The Post Correspondence Problem Fall 2004 COMP 335 26
The Post Correspondence Problem Input: Fall 2004 Two sequences of COMP 335 strings 27
There is a Post Correspondence Solution if there is a sequence such that: PC-solution: Indices may be repeated or omitted Fall 2004 COMP 335 28
Example: PC-solution: Fall 2004 COMP 335 29
Example: There is no solution Because total length of strings from is smaller than total length of strings from Fall 2004 COMP 335 30
We will show: 1. The MPC problem is undecidable (by reducing the membership to MPC) 2. The PC problem is undecidable (by reducing MPC to PC) Fall 2004 COMP 335 31
Theorem: The PC problem is undecidable Proof: We will reduce the MPC problem to the PC problem Fall 2004 COMP 335 32
Some undecidable problems for context-free languages: • Is ? are context-free grammars • Is context-free grammar ambiguous? We reduce the PC problem to these problems Fall 2004 COMP 335 33
be context-free Theorem: Let grammars. It is undecidable to determine if Proof: Rdeduce the PC problem to this problem Fall 2004 COMP 335 34
Suppose we have a decider for the empty-intersection problem Context-free grammars Fall 2004 Emptyinterection problem decider COMP 335 YES NO 35
Theorem: For a context-free grammar , it is undecidable to determine if G is ambiguous Proof: Fall 2004 Reduce the PC problem to this problem COMP 335 36
- Slides: 36