Information Processing Letters: Vesa Halava, Tero Harju, Mika Hirvensalo, Juhani Karhumäki
Information Processing Letters: Vesa Halava, Tero Harju, Mika Hirvensalo, Juhani Karhumäki
such that
p
1
h(w)s
1
= p
2
g(w)s
2
.
In an instance I as in the above, the words p
1
and p
2
are
called the beginning words and the words s
1
and s
2
are
called the end words.
Since each instance (h, g) of the (nongeneralized) PCP
can be viewed as the instance ((, ), h, g, (, )) of the
generalized PCP, where denotes the empty word, it fol-
lows that the generalized PCP is also undecidable.
For an instance (h, g) of the PCP, its size is the cardinal-
ity of the domain alphabet A. The boundary line between
decidability and undecidability can be investigated by re-
stricting the morphisms. For example, it is known that the
PCP is decidable for instances of size at most 2, see [1],
or [3] for a shorter proof. On the other hand, the PCP is
undecidable for the instances with size at least 7, see [8].
The same bounds hold for the generalized PCP, see [1] (or
[3]) for the binary case, and [5] for the undecidability of
the generalized PCP for size 7. For the PCP and generalized
PCP, the decidability status remains as an open question
for the sizes between these two bounds.
For an instance, I = (h, g), where h, g : A
of the
PCP, let max{|h(a)|, |g(a)| | a A} be the image length of I .
0020-0190/$ see front matter 2008 Elsevier B.V. All rights reserved.
doi:10.1016/j.ipl.2008.04.013
116 V. Halava et al. / Information Processing Letters 108 (2008) 115118
In this paper we shall study these problems with re-
spect to the image lengths of the morphisms of the in-
stances. We note rst that if the image length of the in-
stance is one, then the generalized PCP (and hence PCP)
is trivially decidable. We shall prove that the PCP is un-
decidable for the instances with image length at most 2.
We prove this rst for the generalized PCP, and then trans-
form the proof for the PCP. This problem is stated as an
exercise in Hopcroft and Ullman [6] (but not in the lat-
est editions of the book). To our knowledge no proof of
this result has ever been published. We assume that an
undecidability proof using the halting problem for Turing
machines is presumed in Hopcrofts and Ullmans solution.
Such a solution would be quite complicated, because in the
standard proofs (related to undecidability of the PCP) one
uses the modied PCP, which always doubles the lengths of
the images. In the present paper, we shall give a nice and
rather short proof of the result by using undecidability of
the word problem of the Tzeitin semigroup S
7
[10].
2. Tzeitin semigroup
Consider the following semigroup S
7
that has a presen-
tation with ve generators = {a, b, c, d, e} and seven re-
lations: S
7
= a, b, c, d, e | R, where the relations are given
by
ac = ca, ad =da, bc = cb, bd =db,
eca = ce, edb =de, cca = ccae.
In the word problem of S
7
we are given two words
u, v
, and it is asked whether u = v holds in S
7
, that
is, whether there exists a nite sequence u
1
, u
2
, . . . , u
n
of
words such that u
0
= u, u
n
= v and for i = 0, 1, . . . , n 1,
u
i
= x
i
i
y
i
and u
i+1
= x
i
i
y
i
, where (
i
=
i
) or (
i
=
i
)
is in R for each i. This will be denoted by u = v S
7
.
The semigroup S
7
has a small presentation. Neverthe-
less, Tzeitin [10] proved in 1958 the following remarkable
theorem.
Theorem 1. The word problem is undecidable for S
7
.
It was later proved by Matiyasevich [7] that the rule
cca = ccae in R can be replaced by a bit shorter rule cca =
cce, and we shall use this shorter rule in R.
Next we shall dene a new semigroup S
7
, which is
used in the proof of our main result. We let xy be a new
letter for each x, y . Now the generator set of S
7
is
cc, ed, ec
=
ac = ca, ad =da, bc = cb,
bd =db, eca = ce, edb =de,
cca = cce, cc = cc,
ed = ed, ec = ec
.
The following theorem is obvious by the denition of
S
7
and Theorem 1.
Table 1
Denitions of the morphisms g and h
x
[s =t] A
g x t
h x s
Theorem 2. The word problem is undecidable for S
7
. Indeed, it
is undecidable, for words u, v
over the generator set of S
7
,
whether or not u = v S
7
.
Notice that the words in the relations u = v in R
are
all of length 2.
3. Generalized PCP
In this section we shall prove our main result, that is,
Theorem 3. The generalized PCP is undecidable for instances
with image length at most 2 and size at most 30.
We dene the domain alphabet A of 30 letters as fol-
lows:
A =
{}
[s =t], [t = s] | (s =t) R
.
Note that the relations in R
.
For example, both [ac = ca] and [ca = ac] are in A. The
morphisms g and h, with h, g : A
(
)
, are dened
in Table 1. For each pair u, v
, we dene an instance
of the generalized PCP to be
I
u,v
=
(u, ), g, h, (, v)
.
Lemma 4. Let u, v
, and let I
u,v
be an instance of the gen-
eralized PCP as in the above. Then u = v S
7
if and only if I
u,v
has a solution.
Proof. Suppose that u = v S
7
. Therefore there exists a
sequence u = u
1
, u
2
, . . . , u
k
= v of words, for some k 1,
such that u
i
= u
i
u
i
and u
i+1
= u
i
u
i
for some words
i
and
i
with
i
=
i
R
, for i = 1, 2, . . . , k 1. We con-
struct a solution to I
u,v
by induction on the length k.
If k = 1, then u and v are the same word in
+
. In this
case, u is a solution to I
u,v
.
Assume now that k 2. Let
I
u,u
k1
=
(u, ), g, h, (, u
k1
)
7
. By the induction hypothesis, the instance
I
u,u
k1
has a solution. Let x
u,u
k1
. Let r = [
k1
=
k1
]. Then the word x =
x
k1
ru
k1
is a solution of I
u,v
, since ug(x
) =
h(x
)u
k1
, and so
ug(x) = ug(x
)v
= h(x)v = h(x
)u
k1
v.
Suppose then that I
u,v
has a solution, and let x
be a such a solution of minimum length. Now, x =
x
1
x
2
. . . x
k1
x
k
for some x
i
(A \ )
. Since g() =
V. Halava et al. / Information Processing Letters 108 (2008) 115118 117
= h(), we have g(x) = g(x
1
). . . g(x
k1
)g(x
k
)
and h(x) = h(x
1
). . . h(x
k1
)h(x
k
), and then h(x
1
) = u
and g(x
m
) = v. It follows that the word h(x)v =
ug(x) must be of the form
u
1
u
2
. . . u
k1
u
k
,
where u
i
(
)
, u
1
= u and u
k
= v. We show that u
i
=
u
i+1
S
7
for every 1 i k 1, from which u = v S
7
follows.
Because u = h(x
1
), there are two possibilities: either
x
1
= u or x
1
= w
1
r
i
1
w
2
r
i
2
. . . r
i
1
w
, with w
i
(
)
and
r
i
= [s
i
= t
i
]. The rst case yields that also h(x
1
) = u and
necessarily u = v, since x is a minimal solution. There-
fore we may assume that x
1
= w
1
r
i
1
w
2
r
i
2
. . . r
i
1
w
. Then
u =h(x
1
) = w
1
s
i
1
w
2
s
i
2
. . . s
i
1
w
, and
u
2
= g(x
1
) = g(w
1
r
i
1
w
2
r
i
2
. . . r
i
1
w
)
= w
1
t
i
1
w
2
t
i
2
. . . t
i
1
w
.
Hence u
1
= u
2
S
7
, because u
1
(= u) and u
2
only differ
by u
2
having t
i
where u
1
has s
i
.
Continuing this reasoning, we can show that for every
two words u
i
, u
i+1
occurring in
h(x)v = u
1
u
2
. . . u
k1
u
k
= ug(x),
we have u
i
= u
i+1
S
7
. Hence u = v S
7
, since h(x) starts
with u
1
= u and g(x) ends with u
k
= v. 2
Note also that | A| = 30. Together with Tzeitins result,
Lemma 4 implies Theorem 3.
4. PCP of image length two
Next we shall transform the construction of the previ-
ous section for the generalized PCP to the PCP. This will
give a proof for the undecidability of the PCP for instances
of image length at most 2. Note that in the standard unde-
cidability proof of the PCP, the halting problem is reduced
to the modied PCP, and only then to the PCP. This cannot
be done directly when proving the undecidability of the
PCP for instances of image length at most 2, since in the
reduction of the modied PCP to the PCP the lengths of
the images are doubled.
In the following, we need to take copies of the letters
to exclude the trivial solution.
First of all, let
be a disjoint copy of the alphabet
,
where the letters are underlined. Let then
A
=
{F , E, , } U
u,v
r
1
, r
2
, . . . , r
10
, r
1
, r
2
, . . . , r
10
,
where r
1
, . . . , r
10
are letters corresponding to the relations
in R
and r
1
, . . . , r
10
are copies of these letters, and U
u,v
is an alphabet dened below for the given words u and
v. Note that we do not have symbols for the reverse rela-
tions of R
F E x x
g Fa
1
E x x
h F b
E x x
[s =t] [s =t]
g t s
h s t
end so that h writes v at the end. The images of a
i
s are
of length 2 for g and of length 1 for h and the images of
b
i
s are of length 1 for g and of length 2 for h. They are
dened so that the following equalities hold:
g(Fa
1
. . . a
k
) = Fa
1
a
2
. . . a
k
u,
h(Fa
1
. . . a
k
) = Fa
1
. . . a
k
,
h(b
1
. . . b
E) = vb
1
b
2
. . . b
E,
g(b
1
. . . b
E) = b
1
b
2
. . . b
E.
Here h(a
i
) = a
i
for all i = 1, 2, . . . , k, and g(b
i
) = b
i
for
all i = 1, 2, . . . , . Also, |g(Fa
1
. . . a
k
)| = 2 |Fa
1
. . . a
k
| and
|h(b
1
. . . b
E)| = 2 |b
1
. . . b
7
if and only if there ex-
ists a word x = Fa
1
. . . a
k
wb
1
. . . b
E = g(x) and
u
1
= u, u
k
= v and u
i
= u
i+1
S
7
for all 1 i k 1.
Note that every other word u
i
is underlined, but if the un-
derlining is ignored, the proof of Theorem 3 applies also
to this case. (Note also that we do not have rewriting rules
for reverses of R
.) 2
Note that using similar ideas one can prove Theorems 3
and 5 by using the undecidability of the halting problem
for the Turing machines. But the splitting of the rules of
Turing machines into rules using only two symbols is more
dicult than splitting the rewriting rules of Tzeitin semi-
group.
5. Bound for the beginning words
In Theorem 3 we were able to bound the number of let-
ters in the alphabet for the generalized PCP in the case of
118 V. Halava et al. / Information Processing Letters 108 (2008) 115118
images of length two. There the lengths of the beginning
words (p
1
, p
2
) and the lengths of the end words (s
1
, s
2
)
can be of arbitrary size. It is obvious, that if the size of the
domain alphabet is bounded, then we cannot bound the
length of both the beginning and the end words. On the
other hand, it is possible to bound the length of the begin-
ning or the end words. Indeed, it is possible to compute
the bound for the length of u in the instance I
u,v
from
Tzeitins construction for S
7
in [10], which gives a bound
for the length of the beginning words p
1
and p
2
, but this
bound is at least hundreds of letters. The bound becomes
large, because in the undecidability proof, the coding of
rules of a special semigroup from where the undecidability
of the word problem is reduced to S
7
, appear as a prex
of both u and v.
On the other hand, using a different semigroup we get
nice bounds for both the beginning words and the size of
the domain alphabet. Indeed, Tzeitin proved in [10] that
another, restricted form of the word problem is undecid-
able.
Tzeitin constructed semigroups
S
i, j
9
= a, b, c, d, e | R,
where the relations are given by
ac = ca, ad =da, bc = cb, bd =db,
eca = ce, edb =de, cd
i
ca = cd
i
cae,
cab
j
ab
j
a =ab
j
ab
j
a, dab
j
ab
j
a =ab
j
ab
j
a,
and i and j are any non-negative integers such that i = j.
Tzeitin proved, that it is undecidable whether or not, for
a given v, v = ab
j
ab
j
a in S
i, j
9
. Indeed, the difference com-
pared to S
7
is that the coding of the rules of the special
semigroup, which is in {c, d}
, where R
is given by
ac = ca, ad =da, bc = cb, bd =db,
eca = ce, edb =de, cca = cce,
c = , d = .
Note that i is set to 0, and again using Matiyasevichs
construction, the rule cca = ccae is replaced by the rule
cca = cce. It can be proved, using the ideas of construc-
tions of Tzeitin, that w = in V if and only if S(w) =
Sa = a in S
9
. Therefore, we have
Theorem 6. For a given word v, it is undecidable whether or
not a = v in S
9
.
Now, we do a similar construction as in Section 3 by
splitting the rules of S
9
. We get the set of rules
R
=
ac = ca, ad =da, bc = cb,
bd =db, eca = ce, edb =de,
cca = cce, cc = cc,
ed = ed, ec = ec,
c = , d =
.
Moreover, in the reduction to the word problem in V , the
rules c = and d = are used only on one (reversal)
direction. Now, the instance I
u,v
of the generalized PCP is
dened as in Section 3, except that is used as a sepa-
rator in the instances of the generalized PCP as well as a
special letter in S
9
. The domain alphabet is
A =
cc, ed, ec,
[s =t], [t = s] | (s =t) R
\
[d = ], [c = ]
.
Indeed, | A| = 31, and according to Theorem 6 we may set
u = a. Now the following theorem can be proved as Theo-
rem 3. Note carefully, that the word u and the morphisms
are xed, only the word v here is not xed.
Theorem 7. The generalized PCP is undecidable for instances
with image length at most 2 and size at most 31, having xed
beginning words of lengths 3 and 1.
Acknowledgement
The authors are grateful to Prof. Yuri Matiyasevich for
his valuable comments, which helped to strengthen the re-
sults of this article. In particular, the results of Section 5
are based on his non-trivial ideas.
References
[1] A. Ehrenfeucht, J. Karhumki, G. Rozenberg, The (generalized) Post
Correspondence Problem with lists consisting of two words is decid-
able, Theoret. Comput. Sci. 21 (1982) 119144.
[2] V. Halava, Decidable and undecidable problems in matrix theory,
Masters thesis, University of Turku. TUCS Tech. Report 127, 1997.
[3] V. Halava, T. Harju, M. Hirvensalo, Binary (generalized) Post Corre-
spondence Problem, Theoret. Comput. Sci. 276 (2002) 183204.
[4] T. Harju, J. Karhumki, Morphisms, in: G. Rozenberg, A. Salomaa
(Eds.), Handbook of Formal Languages, vol. 1, Springer-Verlag, 1997,
pp. 439510.
[5] T. Harju, J. Karhumki, D. Krob, Remarks on generalized Post Cor-
respondence Problem, in: Lecture Notes in Comput. Sci., vol. 1046,
Springer-Verlag, 1996, pp. 3948.
[6] J.E. Hopcroft, J.D. Ullman, Introduction to Automata Theory, Lan-
guages and Computation, Addison-Wesley, 1979.
[7] Yu. Matiyasevich, Simple examples of unsolvable canonical calculi,
Proc. Steklov Inst. Math. 93 (1967) 61110.
[8] Yu. Matiyasevich, G. Snizergues, Decision problems for semi-Thue
systems with a few rules, in: Proceedings, 11th Annual IEEE Sym-
posium on Logic in Computer Science, New Brunswick, New Jersey,
2730 July 1996, IEEE Computer Society Press, 1996, pp. 523531.
[9] E. Post, A variant of a recursively unsolvable problem, Bull. Amer.
Math. Soc. 52 (1946) 264268.
[10] G.C. Tzeitin, Associative calculus with an unsolvable equivalence
problem, Tr. Mat. Inst. Akad. Nauk (52) (1958) 172189 (in Rus-
sian).