Download presentation
Presentation is loading. Please wait.
1
Decidability continued…
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 machine that accepts
Assume we have the finite language algorithm: YES finite Algorithm for finite language problem NO not finite
4
We will design the halting problem algorithm:
YES halts on Algorithm for Halting problem doesn’t halt on NO
5
First construct machine :
Initially, simulates on input When enters a halt state, accept any input (inifinite language) Otherwise accept nothing (finite language)
6
halts on if and only if is not finite
7
Algorithm for halting problem:
Inputs: machine and string 1. Construct 2. Determine if is finite YES: then doesn’t halt on NO: then halts on
8
Machine for halting problem
NO YES Check if construct YES is finite NO
9
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
10
Let be the machine that accepts
Assume we have the two-strings algorithm: YES contains Algorithm for two-strings problem Doesn’t contain NO two equal length strings
11
We will design the halting problem algorithm:
YES halts on Algorithm for Halting problem doesn’t halt on NO
12
First construct machine :
Initially, simulates on input When enters a halt state, accept symbols or (two equal length strings)
13
halts on if and only if accepts and (two equal length strings)
14
Algorithm for halting problem:
Inputs: machine and string 1. Construct 2. Determine if accepts two strings of equal length YES: then halts on NO: then doesn’t halt on
15
Machine for halting problem
YES YES Check if construct NO NO has two equal length strings
16
The Post Correspondence Problem
17
Some undecidable problems for
context-free languages: Is context-free grammar ambiguous? Is ?
18
We need a tool to prove that the previous
problems for context-free languages are undecidable: The Post Correspondence Problem
19
The Post Correspondence Problem
Input: Two sequences of strings
20
There is a Post Correspondence Solution
if there is a sequence such that: PC-solution
21
Example: PC-solution:
22
Example: There is no solution Because total length of strings from is smaller than total length of strings from
23
The Modified Post Correspondence Problem
Inputs: MPC-solution:
24
Example: MPC-solution:
25
1. We will prove that the MPC problem is undecidable 2. We will prove that the PC problem is undecidable
26
1. We will prove that the MPC problem is undecidable We will reduce the membership problem to the MPC problem
27
Membership problem Input: recursive language string Question: Undecidable
28
Membership problem Input: unrestricted grammar string Question: Undecidable
29
The reduction of the membership problem
to the MPC problem: For unrestricted grammar and string we construct a pair such that has an MPC-solution if and only if
30
Grammar : start variable : special symbol For every symbol For every variable
31
Grammar string : special symbol For every production
32
Example: Grammar : String
35
Grammar :
39
Theorem: has an MPC-solution if and only if
40
Algorithm for membership problem:
Input: unrestricted grammar string Construct the pair If has an MPC-solution then else
41
Membership machine solution construct MPC algorithm No-solution
42
2. We will prove that the PC problem is undecidable We will reduce the MPC problem to the PC problem
43
: input to the MPC problem
44
We construct new sequences
45
We insert a special symbol between
any two symbols
47
Special Cases
48
Observation: There is a PC-solution for if and only if there is a MPC-solution for
49
PC-solution MPC-solution
50
MPC-algorithm Input: sequences Construct sequences Solve the PC problem for
51
MPC algorithm solution construct PC algorithm No-solution
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.