• No results found

CS310 : Automata Theory 2019

N/A
N/A
Protected

Academic year: 2022

Share "CS310 : Automata Theory 2019"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 1

CS310 : Automata Theory 2019

Lecture 30: Rice theorem

Instructor: S. Akshay

IITB, India

19-03-2019

(2)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2

Recap

Turing machines and computability

1. Definition of Turing machines: high level and low-level descriptions 2. Variants of Turing machines

3. Decidable and Turing recognizable languages 4. Church-Turing Hypothesis

Regular (Decidable (Recursively Enumerable( All languages DFA/NFA <Algorithms/Halting TM<Semi-algorithms/TM

(3)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2

Recap

Turing machines and computability

1. Definition of Turing machines: high level and low-level descriptions 2. Variants of Turing machines

3. Decidable and Turing recognizable languages 4. Church-Turing Hypothesis

5. Undecidability and a proof technique by diagonalization

I A universal TM langLATM ={hM,wi |M is a TM andM acceptsw} 6. Reductions: a powerful way to show undecidability.

Regular (Decidable (Recursively Enumerable( All languages DFA/NFA <Algorithms/Halting TM<Semi-algorithms/TM

(4)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2

Recap

Turing machines and computability

1. Definition of Turing machines: high level and low-level descriptions 2. Variants of Turing machines

3. Decidable and Turing recognizable languages 4. Church-Turing Hypothesis

5. Undecidability and a proof technique by diagonalization

I A universal TM langLATM ={hM,wi |M is a TM andM acceptsw} 6. Reductions: a powerful way to show undecidability.

Regular (Decidable (Recursively Enumerable( All languages DFA/NFA <Algorithms/Halting TM<Semi-algorithms/TM

(5)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 2

Recap

Turing machines and computability

1. Definition of Turing machines: high level and low-level descriptions 2. Variants of Turing machines

3. Decidable and Turing recognizable languages 4. Church-Turing Hypothesis

5. Undecidability and a proof technique by diagonalization

I A universal TM langLATM ={hM,wi |M is a TM andM acceptsw} 6. Reductions: a powerful way to show undecidability.

7. Today: Rice’s theorem

Regular (Decidable (Recursively Enumerable( All languages DFA/NFA <Algorithms/Halting TM<Semi-algorithms/TM

(6)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3

Rice’s theorem

Rice’s theorem (1953)

Any non-trivial property of R.E languages is undecidable!

I Property P ≡set of languages satisfyingP

I Property of r.e languages: membership of M in P depends only on the language of M. If L(M) =L(M0), then hMi ∈P iff hM0i ∈P.

I Non-trivial: It holds for some but not all TMs.

(7)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3

Rice’s theorem

Rice’s theorem (1953)

Any non-trivial property of R.E languages is undecidable!

I Property P ≡set of languages satisfyingP

I Property of r.e languages: membership of M in P depends only on the language of M. If L(M) =L(M0), then hMi ∈P iff hM0i ∈P.

I Non-trivial: It holds for some but not all TMs.

(8)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3

Rice’s theorem

Rice’s theorem (1953)

Any non-trivial property of R.E languages is undecidable!

I Property P ≡set of languages satisfyingP

I Property of r.e languages: membership of M in P depends only on the language ofM. If L(M) =L(M0), then hMi ∈P iff hM0i ∈P.

I Non-trivial: It holds for some but not all TMs.

(9)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 3

Rice’s theorem

Rice’s theorem (1953)

Any non-trivial property of R.E languages is undecidable!

I Property P ≡set of languages satisfyingP

I Property of r.e languages: membership of M in P depends only on the language ofM. If L(M) =L(M0), then hMi ∈P iff hM0i ∈P.

I Non-trivial: It holds for some but not all TMs.

(10)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4

Property: set of languages

Property of r.e. languages

Just a subset of r.e. languages. Thus, Lsatisfies a property P iff L∈P.

Examples:

I Set of regular languages I Set of context-free languages I Set of all languages

I {∅} I ∅

Given a property P, denote LP ={hMi |L(M)∈P} So decidability of propertyP is decidability of language LP.

(11)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4

Property: set of languages

Property of r.e. languages

Just a subset of r.e. languages. Thus, Lsatisfies a property P iff L∈P. Examples:

I Set of regular languages I Set of context-free languages

I Set of all languages I {∅}

I ∅

Given a property P, denote LP ={hMi |L(M)∈P} So decidability of propertyP is decidability of language LP.

(12)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4

Property: set of languages

Property of r.e. languages

Just a subset of r.e. languages. Thus, Lsatisfies a property P iff L∈P. Examples:

I Set of regular languages I Set of context-free languages I Set of all languages

I {∅} I ∅

Given a property P, denote LP ={hMi |L(M)∈P} So decidability of propertyP is decidability of language LP.

(13)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4

Property: set of languages

Property of r.e. languages

Just a subset of r.e. languages. Thus, Lsatisfies a property P iff L∈P. Examples:

I Set of regular languages I Set of context-free languages I Set of all languages

I {∅}

I ∅

Given a property P, denote LP ={hMi |L(M)∈P} So decidability of propertyP is decidability of language LP.

(14)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 4

Property: set of languages

Property of r.e. languages

Just a subset of r.e. languages. Thus, Lsatisfies a property P iff L∈P. Examples:

I Set of regular languages I Set of context-free languages I Set of all languages

I {∅}

I ∅

Given a property P, denote LP ={hMi |L(M)∈P}

So decidability of property P is decidability of language LP.

(15)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 5

Non-trivial property

For a property P,LP ={hMi |L(M)∈P}.

A property P of r.e. languages is called non-trivialif I LP 6=∅, i.e., there exists TM M,L(M)∈P.

I LP 6= all r.e. languages, i.e., there exists TM M,L(M)6∈P.

Examples

I {hMi |L(M) is regular } I LP ={hMi |L(M) =∅}

I Lp={hMi |M is a TM s.t. L(M) is accepted by a TM with even number of states }.

(16)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 5

Non-trivial property

For a property P,LP ={hMi |L(M)∈P}.

A property P of r.e. languages is called non-trivialif I LP 6=∅, i.e., there exists TM M,L(M)∈P.

I LP 6= all r.e. languages, i.e., there exists TM M,L(M)6∈P.

Examples

I {hMi |L(M) is regular } I LP ={hMi |L(M) =∅}

I Lp ={hMi |M is a TM s.t. L(M) is accepted by a TM with even number of states }.

(17)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6

Rice’s Theorem

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

Remark: (when not to apply Rice’s theorem)

1. Property is is about TMs and not their languages: e.g., TM has at least 10 states.

2. Cannot show non- Turing recognizability, only undecidability.

(18)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6

Rice’s Theorem

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

Remark: (when not to apply Rice’s theorem)

1. Property is is about TMs and not their languages: e.g., TM has at least 10 states.

2. Cannot show non- Turing recognizability, only undecidability.

(19)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 6

Rice’s Theorem

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

Remark: (when not to apply Rice’s theorem)

1. Property is is about TMs and not their languages: e.g., TM has at least 10 states.

2. Cannot show non- Turing recognizability, only undecidability.

(20)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 7

Can you apply Rice’s theorem?

For the following, answer if Rice’s theorem is applicable 1. {hMi |M runs for 5 steps on word 010}.

2. {hMi |L(M) is recognized by a TM with at least 25 states.}.

3. {hMi |L(M) is recognized by a TM with at most 25 states.}.

4. {hMi |M has at most 25 states.}.

5. {hMi |L(M) is finite.}.

6. {hMi |M with alphabet{0,1,t}ever prints three consecutive 10s on the tape}.

I For each of No answers above, is the language decidable?

I What do you do when Rice’s theorem does not apply? Fall back on reductions!

(21)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 7

Can you apply Rice’s theorem?

For the following, answer if Rice’s theorem is applicable

1. {hMi |M runs for 5 steps on word 010}. No. Property of TMs.

2. {hMi |L(M) is recognized by a TM with at least 25 states.}. No. Trivial property.

3. {hMi |L(M) is recognized by a TM with at most 25 states.}. Yes, if tape alphabet is fixed, else no!

4. {hMi |M has at most 25 states.}. No. Property of TMs.

5. {hMi |L(M) is finite.}. Yes.

6. {hMi |M with alphabet {0,1,t} ever prints three consecutive 10s on the tape}. No. Property of TMs.

I For each of No answers above, is the language decidable?

I What do you do when Rice’s theorem does not apply? Fall back on reductions!

(22)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P.

I Assume LP is decidable, we will show thatATM is decidable. I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algoMP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w. I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(23)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algoMP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w. I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(24)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algoMP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w. I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(25)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP

I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w. I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(26)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w. I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(27)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w.

I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx. 2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(28)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w.

I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx.

2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(29)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w.

I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx.

2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw.

I This gives an algo forATM so completes the proof.

(30)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 8

Proof idea

Rice’s Theorem

Let P be a non-trivial property of r.e. languages. Then LP ={hMi |L(M)∈P}is undecidable.

I Let P be a non-trivial property of r.e, such that∅ 6∈P. I Assume LP is decidable, we will show thatATM is decidable.

I Since P is non-trivial, ∃L,ML with property P.

I IfP is decidable, there exists an algo MP for decidingP I We combine ML and MP to get algo for ATM.

I TakehM,wias i/p, and o/phM0i, s.tL(M0)P iffM acc w.

I M0 is the foll:

1. ignore i/px , simulateM onw. if reject, then rejectsx.

2. if acc, then simulateMLonx, acc iffMLaccx.

I ThusM0 either acc orLdepending on ifM accw. I This gives an algo forATM so completes the proof.

(31)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 9

Proof idea

I But what ifP has∅ in it!?

I Take P. I Now ∅ 6∈P.

I Apply proof to get undecidability of LP. I Conclude undecidability of LP.

(32)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 9

Proof idea

I But what ifP has∅ in it!?

I Take P. I Now ∅ 6∈P.

I Apply proof to get undecidability of LP. I Conclude undecidability of LP.

(33)

cbna CS310 : Automata Theory 2019 Instructor: S. Akshay IITB, India 9

Proof idea

I But what ifP has∅ in it!?

I Take P. I Now ∅ 6∈P.

I Apply proof to get undecidability of LP. I Conclude undecidability of LP.

References

Related documents

I Weekly problem solving session: 1 hour per week (To be fixed by TAs). I Office hours: by email appointment/weekly

If L is the language accepted of P by empty stack , there exists PDA P 0 such that its language accepted by final state is L..

I Text processing: Given input as English alphabet, output can be capitalized words. I Translation: Given input in English, output can be

cbna CS310 : Automata Theory 2019 Instructor: Ashutosh Gupta IITB, India 10.. CFGs

cbna CS310 : Automata Theory 2019 Instructor: Ashutosh Gupta IITB, India 2.. Topic 8.1

cbna CS310 : Automata Theory 2019 Instructor: Ashutosh Gupta IITB, India 2..

cbna CS310 : Automata Theory 2019 Instructor: Ashutosh Gupta IITB, India 2.. Topic 13.1

We can club the rules for a nonterminal together and separate right hand sides using “|”. Example 21.1