









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 406 of 420
Go Back
Full Screen
Close
The Post correspondence problem (due to Emil Post) is another undecid- able problem that turns out to be a very helpful tool for proving problems in logic or in formal language theory to be undecidable.
Let Σ be an alphabet with at least two letters. An instance of the Post Correspondence problem (for short, PCP) is given by two sequences U = (u 1 ,... , um) and V = (v 1 ,... , vm), of strings ui, vi ∈ Σ∗. The problem is to find whether there is a (finite) sequence (i 1 ,... , ip), with ij ∈ { 1 ,... , m} for j = 1,... , p, so that
ui 1 ui 2 · · · uip = vi 1 vi 2 · · · vip.
Equivalently, an instance of the PCP is a sequence of pairs ( u 1 v 1
um vm
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 407 of 420
Go Back
Full Screen
Close
For example, consider the following problem: ( abab ababaaa
aaabbb bb
aab baab
ba baa
ab ba
aa a
There is a solution for the string 1234556:
abab aaabbb aab ba ab ab aa = ababaaa bb baab baa ba ba a.
We are beginning to suspect that this is a hard problem. Indeed, it is undecidable!
Theorem 6.8.1 (Emil Post, 1946) The Post correspondence problem is undecidable, provided that the alphabet Σ has at least two symbols.
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 409 of 420
Go Back
Full Screen
Close
As an application, we prove the following result:
Theorem 6.8.2 It is undecidable whether a context-free grammar is am- biguous.
Proof. We reduce the PCP to the ambiguity problem for CFG’s. Given any instance U = (u 1 ,... , um) and V = (v 1 ,... , vm) of the PCP, let c 1 ,... , cm be m new symbols, and consider the following languages:
LU = {ui 1 · · · uip cip · · · ci 1 | 1 ≤ ij ≤ m, 1 ≤ j ≤ p, p ≥ 1 },
LV = {vi 1 · · · vip cip · · · ci 1 | 1 ≤ ij ≤ m, 1 ≤ j ≤ p, p ≥ 1 },
and LU,V = LU ∪ LV.
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 410 of 420
Go Back
Full Screen
Close
We can easily construct a CFG, GU,V , generating LU,V. The productions are:
S −→ SU S −→ SV SU −→ uiSU ci SU −→ uici SV −→ viSV ci SV −→ vici.
It is easily seen that the PCP for (U, V ) has a solution iff LU ∩ LV 6 = ∅ iff G is ambiguous.
Remark: As a corollary, we also obtain the following result: It is unde- cidable for arbitrary context-free grammars G 1 and G 2 whether L(G 1 ) ∩ L(G 2 ) = ∅ (see also Theorem 6.9.2).
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 412 of 420
Go Back
Full Screen
Close
The language LM turns out to be the intersection of two context-free lan- guages L^0 M and L^1 M defined as follows:
(1) The strings in L^0 M are of the form
w 0 #wR 1 #w 2 #wR 3 # · · · #w 2 k#wR 2 k+
or w 0 #wR 1 #w 2 #w 3 R # · · · #w 2 k− 2 #wR 2 k− 1 #w 2 k, where w 2 i ` w 2 i+1 for all i ≥ 0, and w 2 k is a proper halting ID in the second case.
(2) The strings in L^1 M are of the form
w 0 #wR 1 #w 2 #wR 3 # · · · #w 2 k#wR 2 k+
or w 0 #wR 1 #w 2 #w 3 R # · · · #w 2 k− 2 #wR 2 k− 1 #w 2 k, where w 2 i+1 ` w 2 i+2 for all i ≥ 0, w 0 is a starting ID, and w 2 k+1 is a proper halting ID in the first case.
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 413 of 420
Go Back
Full Screen
Close
Theorem 6.9.1 Given any Turing machine M , the languages L^0 M and L^1 M are context-free, and LM = L^0 M ∩ L^1 M.
Proof. We can construct PDA’s accepting L^0 M and L^1 M. It is easily checked that LM = L^0 M ∩ L^1 M.
As a corollary, we obtain the following undecidability result:
Theorem 6.9.2 It is undecidable for arbitrary context-free grammars G 1 and G 2 whether L(G 1 ) ∩ L(G 2 ) = ∅.
Proof. We can reduce the problem of deciding whether a partial recursive function is undefined everywhere to the above problem. By Rice’s theorem, the first problem is undecidable.
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 415 of 420
Go Back
Full Screen
Close
As a corollary, we obtain:
Theorem 6.9.4 Given any context-free grammar, G = (V, Σ, P, S), it is undecidable whether L(G) = Σ∗.
Proof. We can reduce the problem of deciding whether a Turing machine never halts in a proper ID to the above problem.
Indeed, given M , by Theorem 6.9.3, the language ∆∗^ − LM is context-free. Thus, there is a CFG, G, so that L(G) = ∆∗^ − LM. However, M never halts in a proper ID iff LM = ∅ iff L(G) = ∆∗.
As a consequence, we also obtain the following:
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 416 of 420
Go Back
Full Screen
Close
Theorem 6.9.5 Given any two context-free grammar, G 1 and G 2 , and any regular language, R, the following facts hold:
(1) L(G 1 ) = L(G 2 ) is undecidable.
(2) L(G 1 ) ⊆ L(G 2 ) is undecidable.
(3) L(G 1 ) = R is undecidable.
(4) R ⊆ L(G 2 ) is undecidable.
In contrast to (4), the property L(G 1 ) ⊆ R is decidable!
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 418 of 420
Go Back
Full Screen
Close
Given any language, L ⊆ Σ∗, and any string, w ∈ Σ∗, we define L/w by
L/w = {u ∈ Σ∗^ | uw ∈ L}.
Theorem 6.9.6 (Greibach) Let L be a countable family of languages that is effectively closed under union and concatenation with the regular lan- guages, and assume that the problem L = Σ∗^ is undecidable for L ∈ L and any given sufficiently large alphabet Σ. Let P be any nontrivial property of languages that is true for the regular languages and so that if P (L) holds then P (L/a) also holds for any letter a. Then, P is undecidable for L.
Proof. Since P is nontrivial for L, there is some L 0 ∈ L so that P (L 0 ) is false.
Let Σ be large enough, so that L 0 ⊆ Σ∗, and the problem L = Σ∗^ is undecidable for L ∈ L.
The Post... Undecidable...
Home Page
Title Page
JJ II
J I
Page 419 of 420
Go Back
Full Screen
Close
We show that given any L ∈ L, with L ⊆ Σ∗, we can construct a language L 1 ∈ L, so that L = Σ∗^ iff P (L 1 ) holds. Thus, the problem L = Σ∗^ for L ∈ L reduces to property P for L, and since for Σ big enough, the first problem is undecidable, so is the second.
For any L ∈ L, with L ⊆ Σ∗, let
L 1 = L 0 #Σ∗^ ∪ Σ∗#L.
Since L is effectively closed under union and concatenation with the regular languages, we have L 1 ∈ L.
If L = Σ∗, then L 1 = Σ∗#Σ∗, a regular language, and thus, P (L 1 ) holds, since P holds for the regular languages.