cs310 : automata theory 2019 lecture 34: linear bounded ...akshayss/courses/cs310... · cs310 :...
TRANSCRIPT
![Page 1: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/1.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 1
CS310 : Automata Theory 2019
Lecture 34: Linear Bounded Automata
Instructor: S. Akshay
IITB, India
01-04-2019
![Page 2: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/2.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2
Recap
Turing machines and computability
1. Turing machines
(i) Definition(ii) Variants(iii) Decidable and Turing recognizable languages(iv) Church-Turing Hypothesis
2. Undecidability
(i) A proof technique by diagonalization(ii) Via reductions(iii) Rice’s theorem
3. Applications: showing (un)decidability of other problems
(i) A string matching problem: Post’s Correspondance Problem(ii) A problem for compilers: Unambiguity of Context-free languages
![Page 3: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/3.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2
Recap
Turing machines and computability
1. Turing machines
(i) Definition(ii) Variants(iii) Decidable and Turing recognizable languages(iv) Church-Turing Hypothesis
2. Undecidability
(i) A proof technique by diagonalization(ii) Via reductions(iii) Rice’s theorem
3. Applications: showing (un)decidability of other problems
(i) A string matching problem: Post’s Correspondance Problem(ii) A problem for compilers: Unambiguity of Context-free languages
![Page 4: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/4.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2
Recap
Turing machines and computability
1. Turing machines
(i) Definition(ii) Variants(iii) Decidable and Turing recognizable languages(iv) Church-Turing Hypothesis
2. Undecidability
(i) A proof technique by diagonalization(ii) Via reductions(iii) Rice’s theorem
3. Applications: showing (un)decidability of other problems
(i) A string matching problem: Post’s Correspondance Problem(ii) A problem for compilers: Unambiguity of Context-free languages
![Page 5: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/5.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3
Another restriction of Turing machines
DefinitionA linear bounded automaton (LBA) is a TM where the tape head cannotmove off the portion of the tape containing the input.
![Page 6: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/6.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3
Another restriction of Turing machines
DefinitionA linear bounded automaton (LBA) is a TM where the tape head cannotmove off the portion of the tape containing the input.
I Thus, a limited amount of memory.
I But we can use larger tape alphabet!
![Page 7: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/7.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3
Another restriction of Turing machines
DefinitionA linear bounded automaton (LBA) is a TM where the tape head cannotmove off the portion of the tape containing the input.
I Thus, a limited amount of memory.
I But we can use larger tape alphabet! Does this help?
![Page 8: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/8.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3
Another restriction of Turing machines
DefinitionA linear bounded automaton (LBA) is a TM where the tape head cannotmove off the portion of the tape containing the input.
I Thus, a limited amount of memory.
I But we can use larger tape alphabet! increases memory only by aconstant factor.
![Page 9: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/9.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3
Another restriction of Turing machines
DefinitionA linear bounded automaton (LBA) is a TM where the tape head cannotmove off the portion of the tape containing the input.
I Thus, a limited amount of memory.
I But we can use larger tape alphabet! increases memory only by aconstant factor.
I given input of length n, memory available is a linear fn of n
![Page 10: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/10.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4
Linear bounded automata (LBA)
How powerful are LBA? What do they capture?
I regular languages?
I context free languages?
I decidable languages?
I All languages?
Chocolate problem: Give an example of a language which is decidable, butnot accepted by any LBA.
What about the acceptance and emptiness problems?
I ALBA = {〈M,w〉 | M is an LBA that accepts string w}.
I ELBA = {〈M〉 | M is an LBA with L(M) = ∅}.
Are they decidable?
![Page 11: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/11.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4
Linear bounded automata (LBA)
How powerful are LBA? What do they capture?
I regular languages?
I context free languages?
I decidable languages?
I All languages?
Chocolate problem: Give an example of a language which is decidable, butnot accepted by any LBA.
What about the acceptance and emptiness problems?
I ALBA = {〈M,w〉 | M is an LBA that accepts string w}.
I ELBA = {〈M〉 | M is an LBA with L(M) = ∅}.
Are they decidable?
![Page 12: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/12.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4
Linear bounded automata (LBA)
How powerful are LBA? What do they capture?
I regular languages?
I context free languages?
I decidable languages?
I All languages?
Chocolate problem: Give an example of a language which is decidable, butnot accepted by any LBA.
What about the acceptance and emptiness problems?
I ALBA = {〈M,w〉 | M is an LBA that accepts string w}.
I ELBA = {〈M〉 | M is an LBA with L(M) = ∅}.
Are they decidable?
![Page 13: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/13.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 5
How powerful are LBA?
I ALBA = {〈M,w〉 | M is an LBA that accepts string w}.
I ELBA = {〈M〉 | M is an LBA with L(M) = ∅}.
Pop Quiz
1. Let M be an LBA with |Q| = m, |Γ| = r , with input length n. Howmany distinct configurations D of M are possible?
2. Can you simulate an LBA with a halting TM, i.e., is ALBA decidable?
3. Can you describe a reduction from ATM to ELBA, i.e., is ELBA
undecidable?
![Page 14: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/14.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 5
How powerful are LBA?
I ALBA = {〈M,w〉 | M is an LBA that accepts string w}.
I ELBA = {〈M〉 | M is an LBA with L(M) = ∅}.
Pop Quiz
1. Let M be an LBA with |Q| = m, |Γ| = r , with input length n. Howmany distinct configurations D of M are possible?
2. Can you simulate an LBA with a halting TM, i.e., is ALBA decidable?
3. Can you describe a reduction from ATM to ELBA, i.e., is ELBA
undecidable?
![Page 15: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/15.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
![Page 16: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/16.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
I Simulate LBA M on w for D steps (unless it halts earlier).
I If it accepts or rejects, do the same.
I If run does not stop in D steps, declare reject (loop detected)!
![Page 17: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/17.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
I Simulate LBA M on w for D steps (unless it halts earlier).
I If it accepts or rejects, do the same.
I If run does not stop in D steps, declare reject (loop detected)!
Claim: ALBA accepts w iff it accepts w in at most D steps.
I One direction trivial.
![Page 18: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/18.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
I Simulate LBA M on w for D steps (unless it halts earlier).
I If it accepts or rejects, do the same.
I If run does not stop in D steps, declare reject (loop detected)!
Claim: ALBA accepts w iff it accepts w in at most D steps.
I One direction trivial.
I For the other, if M on w didn’t stop in D steps, by PHP there must bea config visited twice, i.e., a loop. hence M cannot accept w .
![Page 19: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/19.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
I Simulate LBA M on w for D steps (unless it halts earlier).
I If it accepts or rejects, do the same.
I If run does not stop in D steps, declare reject (loop detected)!
Claim: ALBA accepts w iff it accepts w in at most D steps.
I One direction trivial.
I For the other, if M on w didn’t stop in D steps, by PHP there must bea config visited twice, i.e., a loop. hence M cannot accept w .
Undecidability of ELBA
![Page 20: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/20.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
![Page 21: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/21.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
I Idea: B accepts ip x iff x is a string describing sequence of acceptingcomputations of M on w .
![Page 22: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/22.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
I Idea: B accepts ip x iff x is a string describing sequence of acceptingcomputations of M on w .
I Break x into #C1#C2 . . .#Cn#, and check if C1 is start, Cn is acc andeach transition is valid (how?).
![Page 23: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/23.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
I Idea: B accepts ip x iff x is a string describing sequence of acceptingcomputations of M on w .
I Break x into #C1#C2 . . .#Cn#, and check if C1 is start, Cn is acc andeach transition is valid (how?).
I i.e., Ci and Ci+1 are same on all except positions near the head. Andthey are correctly updated acc transition of M. Use markers to keeptrack of positions.
![Page 24: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/24.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
I Idea: B accepts ip x iff x is a string describing sequence of acceptingcomputations of M on w .
I Break x into #C1#C2 . . .#Cn#, and check if C1 is start, Cn is acc andeach transition is valid (how?).
I Now, show that w ∈ L(M) iff L(B) 6= ∅
![Page 25: CS310 : Automata Theory 2019 Lecture 34: Linear Bounded ...akshayss/courses/cs310... · CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3 Another restriction of Turing](https://reader034.vdocuments.site/reader034/viewer/2022042917/5f5ab59c5b09ad1f24213f6b/html5/thumbnails/25.jpg)
cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6
Two more proofs
Decidability of ALBA
Undecidability of ELBA
I Reduction from ATM : define map from TM (M,w) to LBA B, s.t.,w ∈ L(M) iff L(B) 6= ∅
I Idea: B accepts ip x iff x is a string describing sequence of acceptingcomputations of M on w .
I Break x into #C1#C2 . . .#Cn#, and check if C1 is start, Cn is acc andeach transition is valid (how?).
I Now, show that w ∈ L(M) iff L(B) 6= ∅I Thus, non-emptiness is undecidable. What about emptiness?