Post Correspondence Problem - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Post Correspondence Problem

Description:

Each domino has two strings from the same alphabet ... there are only four dominoes, you have as many copies of each domino as you need. ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 7
Provided by: MOL52
Category:

less

Transcript and Presenter's Notes

Title: Post Correspondence Problem


1
Post Correspondence Problem
Although Rices theorem is a nice way to get new
undecidable problems, there is one very useful
result that it cant give us the undecidability
of PCP Given an alphabet ? and a set of ordered
pairs ui, vi for i 1, 2, ..., n, with each ui
and vi a nonempty string over ?, is it possible
to pick values i1, i2, ..., ik so that ui1ui2
... uik vi1vi2 ... vik ? So the question is
whether there is an algorithm to decide, given
any instance of PCP, whether such a sequence i1,
i2, ..., ik exists. To show PCP undecidable, we
can reduce the Halting Problem to PCP but this
is a particularly messy business, so we wont
give the details. Just accept that the Post
Correspondence Problem is undecidable. Why should
we care? Because PCP is extremely useful when we
look at decision problems involving context-free
grammars, in other words when we look at decision
problems involving programming languages and
compilers.
2
Understanding PCP
Imagine a set of dominos. Each domino has two
strings from the same alphabet ?. An instance of
the Post correspondence problem is a set of
dominoes, e.g.
a
c
ba
acb
ac
ba
a
b
Although there are only four dominoes, you have
as many copies of each domino as you need. A
solution to this instance of PCP is a sequence of
dominoes such that the string along the top is
the same as the string along the bottom.
a
c
ba
acb
a
ac
ba
a
b
ac
So the undecidability of PCP means there is no
algorithm to decide, for any given set of
dominoes, whether there is a sequence of dominoes
spelling out the same string above and below the
line.
3
Exercises on PCP
  • Is there a solution to the instance of PCP with
    ? 0,1 and the dominoes below?

011
111
10111
11
  • What if we have ? 0,1 and dominoes

?
01
110
010
010
00
101
4
PCP and CFGs
What if the top halves of the dominoes were
strings generated by one grammar, and the bottom
halves were strings generated by another? A
solution of that instance of PCP would answer at
least one important question about the two
grammars, namely Are the grammars/languages
disjoint? Given an instance of PCP such
as ?, u1,v1, u2,v2, ..., un,vn we can
build two CFGs from the ordered pairs Gu has ?u
??1,2,...,n and rules Pu S ? uiSi, S
? uii i 1,2,...,n Gv has ?v
??1,2,...,n and rules Pv S? ? viS?i,
S? ? vii i 1,2,...,n Solving the instance of
PCP is the same as trying to get Gu to produce
the same string as Gv. Why do we have the
suffixes i in the rules? Theorem There is no
algorithm to decide, given CFGs G and G?, whether
their languages are disjoint.

5
Grammars from PCP instances
Consider the instance of PCP with ? 0,1 and
the dominoes below
011
111
10111
11
We build the grammars Gu and Gv as
follows. Gu Su ? 011Su1 Gv Sv ? 10111Sv1
? 0111 ? 101111 ? 111Su2 ? 11Sv2
? 1112 ? 112 Derivations that solve the PCP
instance Su ? 111Su2 Sv ? 11Sv2 ? 111011S
u12 ? 1110111Sv12 ? 111011111212 ? 11101111
1212 The domino version

111
011
111
11
10111
11
6
Ambiguous grammars
Theorem There is no algorithm to decide, given a
context-free grammar G, whether G is
ambiguous. Proof (By reduction of PCP) Suppose
there were such an algorithm. Take any instance
of PCP. Construct the grammars Gu with start
symbol Su and Gv with start symbol Sv as
before. Combine the grammars by adding, to the
union of their sets of rules, Snew ? Su Sv
(which gives the grammar of the union of the two
languages). This combined grammar is ambiguous
iff there is some string that can be produced
both by Gu and by Gv, which in turn is the case
iff there is a solution to the given instance of
PCP. So an algorithm to decide ambiguity could be
used to decide PCP. But PCP is undecidable.
Write a Comment
User Comments (0)
About PowerShow.com