360 likes | 477 Views
Undecidable problems for Recursively enumerable languages. continued…. Take a recursively enumerable language. Decision problems:. is empty?. is finite?. contains two different strings of the same length?. All these problems are undecidable. Theorem:.
E N D
Undecidable problemsfor Recursively enumerable languages continued… COMP 335
Take a recursively enumerable language Decision problems: • is empty? • is finite? • contains two different strings • of the same length? All these problems are undecidable COMP 335
Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the halting problem to this problem COMP 335
Let be the TM with Suppose we have a decider for the finite language problem: YES finite finite language problem decider NO not finite COMP 335
We will build a decider for the halting problem: YES halts on Halting problem decider doesn’t halt on NO COMP 335
We want to reduce the halting problem to the finite language problem Halting problem decider NO YES finite language problem decider YES NO COMP 335
We need to convert one problem instance to the other problem instance Halting problem decider NO YES convert input ? finite language problem decider YES NO COMP 335
Construct machine : On arbitrary input string Initially, simulates on input If enters a halt state, accept ( inifinite language) Otherwise, reject ( finite language) COMP 335
halts on if and only if is infinite COMP 335
halting problemdecider NO YES finite language problem decider construct YES NO COMP 335
Take a recursively enumerable language Decision problems: • is empty? • is finite? • contains two different strings • of the same length? All these problems are undecidable COMP 335
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 COMP 335
Let be the TM with Suppose we have the decider for the two-strings problem: YES contains Two-strings problem decider Doesn’t contain NO two equal length strings COMP 335
We will build a decider for the halting problem: YES halts on Halting problem decider doesn’t halt on NO COMP 335
We want to reduce the halting problem to the empty language problem Halting problem decider YES YES Two-strings problem decider NO NO COMP 335
We need to convert one problem instance to the other problem instance Halting problem decider YES YES Two-strings problem decider convert inputs ? NO NO COMP 335
Construct machine : On arbitrary input string Initially, simulate on input When enters a halt state, accept if or (two equal length strings ) Otherwise, reject ( ) COMP 335
halts on if and only if accepts two equal length strings accepts and COMP 335
Halting problem decider YES YES Two-strings problem decider construct NO NO COMP 335
Rice’s Theorem COMP 335
Definition: Non-trivial properties of recursively enumerable languages: any property possessed by some (not all) recursively enumerable languages COMP 335
Some non-trivial properties of recursively enumerable languages: • is empty • is finite • contains two different strings • of the same length COMP 335
Rice’s Theorem: Any non-trivial property of a recursively enumerable language is undecidable COMP 335
The Post Correspondence Problem COMP 335
Some undecidable problems for context-free languages: • Is ? are context-free grammars • Is context-free grammar ambiguous? COMP 335
We need a tool to prove that the previous problems for context-free languages are undecidable: The Post Correspondence Problem COMP 335
The Post Correspondence Problem Input: Two sequences of strings COMP 335
There is a Post Correspondence Solution if there is a sequence such that: PC-solution: Indices may be repeated or omitted COMP 335
Example: PC-solution: COMP 335
Example: There is no solution Because total length of strings from is smaller than total length of strings from COMP 335
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) COMP 335
Theorem: The PC problem is undecidable Proof: We will reduce the MPC problem to the PC problem COMP 335
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 COMP 335
Theorem: Let be context-free grammars. It is undecidable to determine if Rdeduce the PC problem to this problem Proof: COMP 335
Suppose we have a decider for the empty-intersection problem Context-free grammars Empty- interection problem decider YES NO COMP 335
For a context-free grammar , Theorem: it is undecidable to determine if G is ambiguous Reduce the PC problem to this problem Proof: COMP 335