5.Equivalence of NPDA and CFG§
Now we want to show that NPDA’s and CFG both represent CFL’s.
We will show that we can take any CFG and construct a NPDA, and
vice versa.
Theorem: For any CFG L not containing λ, ∃ a NPDA M such that L=L(M).
S→aSbb∣a
Let G′=(V,T,S,P),P= | S→aSA | aAA | b | A→bBBB | B→b
QUESTION: Is this grammar in GNF?
Trace abbbbb in grammar and pda.
Theorem: Given a NPDA M, ∃ a NPDA M′ such that all transitions have the form δ(qi,a,A)={c1,c2,…cn} whereci=(qj,λ) orci=(qj,BC)Each move either increases or decreases stack contents by a single symbol.
Theorem: If L=L(M) for some NPDA M, then L is a CFG.