The Post Correspondence Problem; Applications to Undecidability Results

Similar documents
6.8 The Post Correspondence Problem

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Undecidable Problems and Reducibility

Section 14.1 Computability then else

where A, B, C N, a Σ, S ϵ is in P iff ϵ L(G), and S does not occur on the right-hand side of any production. 3.6 The Greibach Normal Form

CS481F01 Solutions 8

MA/CSSE 474 Theory of Computation

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

DM17. Beregnelighed. Jacob Aae Mikkelsen

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

Reducability. Sipser, pages

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

Theory of Computation

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Functions on languages:

V Honors Theory of Computation

Theory of Computation

Theory of Computation Turing Machine and Pushdown Automata

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

A Universal Turing Machine

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory

Theory of Computation

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

ECS 120 Lesson 20 The Post Correspondence Problem

CSE 105 THEORY OF COMPUTATION

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Theory of Computation

Foundations of Informatics: a Bridging Course

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Theory of Computation - Module 4

CS20a: Turing Machines (Oct 29, 2002)

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CPSC 421: Tutorial #1

Limits of Computability

Section 1 (closed-book) Total points 30

16.1 Countability. CS125 Lecture 16 Fall 2014

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

CSCE 551: Chin-Tser Huang. University of South Carolina

Computability and Complexity

Theory of Computation (Classroom Practice Booklet Solutions)

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

INSTITUTE OF AERONAUTICAL ENGINEERING

Non-emptiness Testing for TMs

Theory of Computation

Lecture 12: Mapping Reductions

NPDA, CFG equivalence

Decidability (What, stuff is unsolvable?)

Advanced Undecidability Proofs

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

CS154 Final Examination

Lecture Notes: The Halting Problem; Reductions

ACS2: Decidability Decidability

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

CSE 105 THEORY OF COMPUTATION

Primitive recursive functions: decidability problems

CSCE 551: Chin-Tser Huang. University of South Carolina

Final exam study sheet for CS3719 Turing machines and decidability.

1 Showing Recognizability

Theory of Computer Science

Notes for Comp 497 (Comp 454) Week 10 4/5/05

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

The Post Correspondence Problem

Introduction to Turing Machines. Reading: Chapters 8 & 9

CS20a: Turing Machines (Oct 29, 2002)

DD2371 Automata Theory

Pushdown Automata. Reading: Chapter 6

Properties of Context-Free Languages

Theory of Computer Science. Theory of Computer Science. D8.1 Other Halting Problem Variants. D8.2 Rice s Theorem

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Fall, 2017 CIS 262. Automata, Computability and Complexity Jean Gallier Solutions of the Practice Final Exam

4.2 The Halting Problem

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

Properties of Context-Free Languages. Closure Properties Decision Properties

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Theory of Computer Science

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

Decidability: Church-Turing Thesis

Properties of context-free Languages

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

Theory of Computation (IX) Yijia Chen Fudan University

Pushdown Automata. Chapter 12

Question Bank UNIT I

Computational Models Lecture 8 1

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 10 : Context-Free Grammars

Ogden s Lemma for CFLs

HW 3 Solutions. Tommy November 27, 2012

CS 7220 Computational Complexity and Algorithm Analysis

Theory Bridge Exam Example Questions

The Unsolvability of the Halting Problem. Chapter 19

Chap. 7 Properties of Context-free Languages

Transcription:

Chapter 8 The Post Correspondence Problem; Applications to Undecidability Results 8.1 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable 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,...,u m )and V =(v 1,...,v m ), of strings u i,v i Σ. 551

552 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS The problem is to find whether there is a (finite) sequence (i 1,...,i p ), with i j {1,...,m} for j =1,...,p,sothat u i1 u i2 u ip = v i1 v i2 v ip. Equivalently, an instance of the PCP is a sequence of pairs ( ) ( ) u1 um,...,. v 1 v m

8.1. THE POST CORRESPONDENCE PROBLEM 553 For example, consider the following problem: ( ) abab, ababaaa ( aaabbb bb ), ( ) aab, baab ( ba baa ), There is a solution for the string 1234556: ( ) ab, ba ( aa a ). 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 8.1. (Emil Post, 1946) The Post correspondence problem is undecidable, provided that the alphabet Σ has at least two symbols.

554 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS There are several ways of proving Theorem 8.1, but the strategy is more or less the same: Reduce the halting problem to the PCP, by encoding sequences of ID s as partial solutions of the PCP. For instance, this can be done for RAM programs. The first step is to show that every RAM program can be simulated by a single register RAM program. Then, the halting problem for RAM programs with one register is reduced to the PCP (using the fact that only four kinds of instructions are needed). A proof along these lines was given by Dana Scott.

8.2. SOME UNDECIDABILITY RESULTS FOR CFG S 555 8.2 Some Undecidability Results for CFG s Theorem 8.2. It is undecidable whether a contextfree grammar is ambiguous. Proof. We reduce the PCP to the ambiguity problem for CFG s. Given any instance U =(u 1,...,u m )andv = (v 1,...,v m )ofthepcp,letc 1,...,c m be m new symbols, and consider the following languages: L U = {u i1 u ip c ip c i1 1 i j m, 1 j p, p 1}, L V = {v i1 v ip c ip c i1 1 i j m, 1 j p, p 1}, and L U,V = L U L V.

556 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS We can easily construct a CFG, G U,V,generatingL U,V. The productions are: S S U S S V S U S U u i S U c i u i c i S V v i S V c i S V v i c i. It is easily seen that the PCP for (U, V )hasasolutioniff L U L V iff G is ambiguous. Remark: As a corollary, we also obtain the following result: It is undecidable for arbitrary context-free grammars G 1 and G 2 whether L(G 1 ) L(G 2 )= (see also Theorem 8.4).

8.2. SOME UNDECIDABILITY RESULTS FOR CFG S 557 Recall that the computations of a Turing Machine, M, can be described in terms of instantaneous descriptions, upav. We can encode computations ID 0 ID 1 ID n halting in a proper ID, as the language, L M,consisting all of strings or w 0 #w R 1 #w 2 #w R 3 # #w 2k #w R 2k+1, w 0 #w R 1 #w 2 #w R 3 # #w 2k 2 #w R 2k 1#w 2k, where k 0, w 0 is a starting ID, w i w i+1 for all i with 0 i<2k +1andw 2k+1 is proper halting ID in the first case, 0 i<2k and w 2k is proper halting ID in the second case.

558 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS The language L M turns out to be the intersection of two context-free languages L 0 M and L1 M defined as follows: (1) The strings in L 0 M are of the form w 0 #w R 1 #w 2 #w R 3 # #w 2k #w R 2k+1 or w 0 #w R 1 #w 2 #w R 3 # #w 2k 2 #w R 2k 1#w 2k, where w 2i w 2i+1 for all i 0, and w 2k is a proper halting ID in the second case. (2) The strings in L 1 M are of the form w 0 #w R 1 #w 2 #w R 3 # #w 2k #w R 2k+1 or w 0 #w R 1 #w 2 #w R 3 # #w 2k 2 #w R 2k 1#w 2k, where w 2i+1 w 2i+2 for all i 0, w 0 is a starting ID, and w 2k+1 is a proper halting ID in the first case.

8.2. SOME UNDECIDABILITY RESULTS FOR CFG S 559 Theorem 8.3. Given any Turing machine M, the languages L 0 M and L1 M are context-free, and L M = L 0 M L1 M. Proof. We can construct PDA s accepting L 0 M and L1 M. It is easily checked that L M = L 0 M L1 M. As a corollary, we obtain the following undecidability result: Theorem 8.4. It is undecidable for arbitrary contextfree 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.

560 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS However, this problem is equivalent to deciding whether a Turing machine never halts in a proper ID. By Theorem 8.3, the languages L 0 M and L1 M are context-free. Thus, we can construct context-free grammars G 1 and G 2 so that L 0 M = L(G 1)andL 1 M = L(G 2). Then, M never halts in a proper ID iff L M = iff (by Theorem 8.3), L M = L(G 1 ) L(G 2 )=. Given a Turing machine M, thelanguagel M is defined over the alphabet = Γ Q {#}. Thefollowingfact is also useful to prove undecidability: Theorem 8.5. Given any Turing machine M, the language L M is context-free. Proof. One can easily check that the conditions for not belonging to L M can be checked by a PDA.

8.2. SOME UNDECIDABILITY RESULTS FOR CFG S 561 As a corollary, we obtain: Theorem 8.6. Given any context-free grammar, G =(V,Σ,P,S), itisundecidablewhetherl(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, bytheorem8.5,thelanguage L M is context-free. Thus, there is a CFG, G, so that L(G) = L M. However, M never halts in a proper ID iff L M = iff L(G) =. As a consequence, we also obtain the following:

562 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS Theorem 8.7. Given any two context-free grammar, G 1 and G 2,andanyregularlanguage,R, thefollowing 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!

8.3. MORE UNDECIDABLE PROPERTIES OF LANGUAGES 563 8.3 More Undecidable Properties of Languages; Greibach s Theorem We conclude with a nice theorem of S. Greibach, which is a sort of version of Rice s theorem for families of languages. Let L be a countable family of languages. We assume that there is a coding function c: L N and that this function can be extended to code the regular languages (all alphabets are subsets of some given countably infinite set). We also assume that L is effectively closed under union, and concatenation with the regular languages. This means that given any two languages L 1 and L 2 in L, wehavel 1 L 2 L,andc(L 1 L 2 )isgivenbya recursive function of c(l 1 )andc(l 2 ), and that for every regular language R, wehavel 1 R L, RL 1 L,and c(rl 1 )andc(l 1 R)arerecursivefunctionsofc(R) and c(l 1 ).

564 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS Given any language, L Σ,andanystring,w Σ,we define L/w by L/w = {u Σ uw L}. Theorem 8.8. (Greibach) Let L be a countable family of languages that is effectively closed under union, and concatenation with the regular languages, and assume that the problem L =Σ is undecidable for L Land 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 for any L L,thenP (L/a) also holds for any letter a. Then, P is undecidable for L. Proof. Since P is nontrivial for L, thereissomel 0 L so that P (L 0 )isfalse. Let Σ be large enough, so that L 0 Σ,andtheproblem L =Σ is undecidable for L L.

8.3. MORE UNDECIDABLE PROPERTIES OF LANGUAGES 565 We show that given any L L,withL Σ,wecan construct a language L 1 L,sothatL =Σ iff P (L 1 ) holds. Thus, the problem L =Σ for L Lreduces to property P for L, andsinceforσbigenough,thefirst problem is undecidable, so is the second. For any L L,withL Σ,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 =Σ,thenL 1 =Σ #Σ,aregularlanguage,and thus, P (L 1 )holds,sincep holds for the regular languages.

566 CHAPTER 8. THE POST CORRESPONDENCE PROBLEM; APPLICATIONS Conversely, we would like to prove that if L Σ,then P (L 1 )isfalse. Since L Σ,thereissomew/ L. Butthen, L 1 /#w = L 0. Since P is preserved under quotient by a single letter, by atrivialinduction,ifp (L 1 )holds,thenp (L 0 )alsoholds. However, P (L 0 )isfalse,sop (L 1 )mustbefalse. Thus, we proved that L =Σ iff P (L 1 )holds,asclaimed. Greibach s theorem can be used to show that it is undecidable whether a context-free grammar generates a regular language. It can also be used to show that it is undecidable whether acontext-freelanguageisinherentlyambiguous.