Undecidable problems for Recursively enumerable languages continued 1
Undecidable problems for Recursively enumerable languages continued… 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 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 3
Let be the TM with Suppose we have a decider for the finite language problem: finite language problem decider YES finite NO not finite 4
We will build a decider for the halting problem: Halting problem decider YES halts on NO doesn’t halt on 5
We want to reduce the halting problem to the finite language problem Halting problem decider YES NO finite language problem YES NO decider 6
We need to convert one problem instance to the other problem instance Halting problem decider convert input ? YES NO finite language problem YES NO decider 7
Construct machine : On arbitrary input string Initially, simulates on input If enters a halt state, accept ( inifinite language) Otherwise, reject ( finite language) 8
halts on if and only if is infinite 9
halting problem decider YES construct NO finite language problem YES decider NO 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 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 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 13
We will build a decider for the halting problem: Halting problem decider YES halts on NO doesn’t halt on 14
We want to reduce the halting problem to the empty language problem Halting problem decider Two-strings problem decider YES NO NO 15
We need to convert one problem instance to the other problem instance Halting problem decider convert inputs ? Two-strings problem decider 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 ) ( ) 17
halts on if and only if accepts two equal length strings accepts and 18
Halting problem decider construct Two-strings problem decider YES NO NO 19
Rice’s Theorem 20
Definition: Non-trivial properties of recursively enumerable languages: any property possessed by some (not all) recursively enumerable languages 21
Some non-trivial properties of recursively enumerable languages: • is empty • is finite • contains two different strings of the same length 22
Rice’s Theorem: Any non-trivial property of a recursively enumerable language is undecidable 23
The Post Correspondence Problem 24
Some undecidable problems for context-free languages: • Is ? are context-free grammars • Is context-free grammar ambiguous? 25
We need a tool to prove that the previous problems for context-free languages are undecidable: The Post Correspondence Problem 26
The Post Correspondence Problem Input: Two sequences of strings 27
There is a Post Correspondence Solution if there is a sequence such that: PC-solution: Indeces may be repeated or ommited 28
Example: PC-solution: 29
Example: There is no solution Because total length of strings from is smaller than total length of strings from 30
The Modified Post Correspondence Problem Inputs: MPC-solution: 31
Example: MPC-solution: 32
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) 33
Theorem: The MPC problem is undecidable Proof: We will reduce the membership problem to the MPC problem 34
Membership problem Input: recursive language string Question: Undecidable 35
Membership problem Input: unrestricted grammar string Question: Undecidable 36
Suppose we have a decider for the MPC problem String Sequences MPC problem decider MPC solution? YES NO 37
We will build a decider for the membership problem Membership problem decider YES NO 38
The reduction of the membership problem to the MPC problem: Membership problem decider yes MPC problem decider no no 39
We need to convert the input instance of one problem to the other Membership problem decider convert inputs ? yes MPC problem decider no no 40
Grammar : start variable : special symbol For every variable 41
Grammar string : special symbol For every production 42
Example: Grammar : String 43
44
45
Grammar : 46
47
48
49
has an MPC-solution if and only if 50
Membership problem decider Construct yes MPC problem decider no no 51
Since the membership problem is undecidable, The MPC problem is uncedecidable END OF PROOF 52
Theorem: The PC problem is undecidable Proof: We will reduce the MPC problem to the PC problem 53
Suppose we have a decider for the PC problem String Sequences PC problem decider PC solution? YES NO 54
We will build a decider for the MPC problem String Sequences MPC problem decider MPC solution? YES NO 55
The reduction of the MPC problem to the PC problem: MPC problem decider yes no no 56
We need to convert the input instance of one problem to the other MPC problem decider convert inputs ? PC problem decider yes no no 57
: input to the MPC problem 58
We construct new sequences 59
We insert a special symbol between any two symbols 60
61
Special Cases 62
has a PC solution if and only if has an MPC solution 63
PC-solution MPC-solution 64
MPC problem decider Construct PC problem decider yes no no 65
Since the MPC problem is undecidable, The PC problem is undecidable END OF PROOF 66
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 67
be context-free Theorem: Let grammars. It is undecidable to determine if Proof: Rdeduce the PC problem to this problem 68
Suppose we have a decider for the empty-intersection problem Context-free grammars Emptyinterection problem decider YES NO 69
We will build a decider for the PC problem String Sequences PC problem decider PC solution? YES NO 70
The reduction of the PC problem to the empty-intersection problem: PC problem decider Emptyinterection problem decider yes no no 71
We need to convert the input instance of one problem to the other PC problem decider convert inputs ? Emptyinterection problem decider no yes no 72
: input to the PC problem 73
Introduce new unique symbols: 74
Context-free grammar : 75
Context-free grammar : 76
has a PC solution if and only if 77
Because are unique There is a PC solution: 78
PC problem decider Construct Context-Free Grammars Emptyinterection problem decider no yes no 79
Since PC is undecidable, the empty-intersection problem is undecidable END OF PROOF 80
Theorem: For a context-free grammar , it is undecidable to determine if G is ambiguous Proof: Reduce the PC problem to this problem 81
PC problem decider Construct Context-Free Grammar Ambiguousgrammar problem decider no yes no 82
start variable of 83
has a PC solution if and only if is ambiguous 84
- Slides: 84