Top Banner
MTH401A Theory of Computation Lecture 19
54

Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

May 05, 2018

Download

Documents

tranque
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

MTH401ATheory of Computation

Lecture 19

Page 2: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG and PDM

Akash Anand

Equivalence of Context Free Languages and Pushdown

Machines

Conversion of CFG to PDMConversion of PDM to CFG

Page 3: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø Let L = L(G)Ø Construct PDM P such that N(P) = L

Page 4: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø Let L = L(G)Ø Construct PDM P such that N(P) = L

Ø P has :q One state qq Input symbols = terminals of Gq Stack symbols = all symbols of Gq Start symbol = start symbol of Gq Transitions ??

Page 5: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø P has :q Transitions :

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then

δ(q, ε, A) contains (q, α).

Page 6: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : Grammar, G : S → 0S0 | 1S1 | ε.

Pushdown Machine, P :States, Q = {q}Input Symbols, Σ= {0, 1}Stack Symbols, Γ= {0,1, S}Start State, q0 = qFinal State, F = {q}

Page 7: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : Grammar, G : S → 0S0 | 1S1 | ε.

Pushdown Machine, P :Start Symbol, Z0 = S

Page 8: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : Grammar, G : S → 0S0 | 1S1 | ε.

Pushdown Machine, P :Start Symbol, Z0 = STransition Function, δ :

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 9: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : Grammar, G : S → 0S0 | 1S1 | ε.

Pushdown Machine, P :Start Symbol, Z0 = STransition Function, δ :δ(q, 0, 0) = {(q, ε)}δ(q, 1, 1) = {(q, ε)}δ(q, ε, S) = {(q, 0S0), (q, 1S1), (q, ε)}

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 10: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1 1 0 1

q

Page 11: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1 1 0 1

q

δ(q, ε, S) = {(q,0S0), (q,1S1), (q, ε)}

Page 12: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

S

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1 1 0 1

q

Page 13: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

S

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1 1 0 1

q

δ(q, 1, 1) = {(q, ε)}

Page 14: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1 1 0 1

q

Page 15: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1 1 0 1

q

δ(q, ε, S) = {(q,0S0), (q,1S1), (q, ε)}

Page 16: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

S

0

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1 1 0 1

q

Page 17: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

S

0

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1 1 0 1

q

δ(q, 0, 0) = {(q, ε)}

Page 18: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 1 0 1

q

Page 19: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 1 0 1

q

δ(q, ε, S) = {(q,0S0), (q,1S1), (q, ε)}

Page 20: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

S

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 1 0 1

q

Page 21: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

S

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 1 0 1

q

δ(q, 1, 1) = {(q, ε)}

Page 22: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1

q

Page 23: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

S

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1

q

δ(q, ε, S) = {(q,0S0), (q,1S1), (q, ε)}

Page 24: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1

q

Page 25: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1 0 1

q

δ(q, 1, 1) = {(q, ε)}

Page 26: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1

q

Page 27: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

0

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

0 1

q

δ(q, 0, 0) = {(q, ε)}

Page 28: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1

q

Page 29: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

1

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

1

q

δ(q, 1, 1) = {(q, ε)}

Page 30: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

q

Page 31: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

q

Accept !

Page 32: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Example (continued) : 101101 : S⇒1S1⇒10S01⇒101S101⇒101101

(q, 101101, S) ⊦ (q, 101101, 1S1) ⊦(q, 01101, S1) ⊦ (q, 01101, 0S01) ⊦(q, 1101, S01) ⊦ (q, 1101, 1S101) ⊦(q, 101, S101) ⊦ (q, 101, 101) ⊦(q, 01, 01) ⊦ (q, 1, 1) ⊦ (q, ε, ε).

Page 33: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø Formally :

(q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

Page 34: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø Formally :

(q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

( ⇒ ) is an induction on the number of steps made by P.

Page 35: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø Formally :

(q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

( ⇒ ) is an induction on the number of steps made by P.

Basis : (0 steps)Then, (q,wx,S) ⊦* (q,x,α) andS ⇒* wα are true with α=S, w=ε.

Page 36: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

Induction : Consider n moves of P (q,wx,S) ⊦* (q,x,α) and assume the IH for n-1 moves.

Page 37: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

Induction : Consider n moves of P (q,wx,S) ⊦* (q,x,α) and assume the IH for n-1 moves.

There are two cases, depending on whether the last move uses a type 1 or type 2 rule.

Page 38: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

Induction : Consider n moves of P (q,wx,S) ⊦* (q,x,α) and assume the IH for n-1 moves.

There are two cases, depending on whether the last move uses a type 1 or type 2 rule.

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 39: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

1. The move sequence must be of the form (q,yax,S) ⊦* (q,ax,aα) ⊦(q,x,α), where w = ya.

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 40: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

1. The move sequence must be of the form (q,yax,S) ⊦* (q,ax,aα) ⊦(q,x,α), where w = ya.By IH (applied to first n-1 steps), S ⇒* yaα but w = ya so S ⇒* wα.

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 41: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

2. The move sequence must be of the form (q,wx,S) ⊦* (q,x,Aβ) ⊦(q,x,γβ), where A → γ is a production and α = γβ.

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 42: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

( ⇒ ) continued …

2. The move sequence must be of the form (q,wx,S) ⊦* (q,x,Aβ) ⊦(q,x,γβ), where A → γ is a production and α = γβ.By IH (applied to first n-1 steps), S ⇒* wAβ. Thus S ⇒* wγβ = wα.

1. δ(q, a, a) = {(q, ε)}.2. If A → α is a production of G then δ(q, ε, A) contains (q, α).

Page 43: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø (q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

(⇐) is an induction on the number of steps in the leftmost derivation.

Page 44: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø (q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

(⇐) is an induction on the number of steps in the leftmost derivation.

Similar idea! Complete the proof.

Page 45: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

CFG ➜ PDM

Akash Anand

Ø (q,wx,S) ⊦* (q,x,α) ⇔ S ⇒* wα

(⇐) is an induction on the number of steps in the leftmost derivation.

Similar idea! Complete the proof.ü If it helps, you can assume that

the grammar is in Chomsky Normal form.

Page 46: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Page 47: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Ø Let L = N(P)Ø Construct CFG G such that L(G) = L

Page 48: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Ø Let L = N(P)Ø Construct CFG G such that L(G) = L

Ø If P accepts w by (p,w,X) ⊦* (q,ε,ε) then we need to have a variable that generates w and its productions :q Let’s call this variable [pXq]q [pXq] generates all and only those

strings w such that (p,w,X) ⊦* (q,ε,ε)

Page 49: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

X

Simplest Case :

p

δ(p, a, X) = {…, (q, ε), …}

a

Page 50: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Simplest Case :

q

Page 51: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Simplest Case :

Then the production is : [pXq] → a

q

Page 52: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

Next Simplest Case :

δ(p, a, X) = {…, (r, Y), …}

αn

:

α2

α1

X

p

a w1 w2… wn

Page 53: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

αn

:

α2

α1

Y

Next Simplest Case :

r

w1 w2 … wn

Page 54: Lecture 19 - IITKhome.iitk.ac.in/~akasha/mth401/lectures/Lecture19.pdfCFG PDM Akash Anand Ø Let L = L(G) Ø Construct PDM P such that N(P) = L Ø P has : q One state q q Input symbols

PDM ➜ GFG

Akash Anand

αn

:

α2

α1

Y

Next Simplest Case :

Then the production is : [pXq] → a [rYq]

r

w1 w2 … wn