From PDA to CFG (General Case)
Learn about the general case of conversion of a PDA to a CFG.
We'll cover the following...
Converting an arbitrary PDA to CFG
To convert an arbitrary PDA to a CFG, we somehow need to relate the states and transitions of the PDA, including stack operations, to variables and rules in a CFG. This is a tall order but a doable one. To understand the algorithm, we need to take a deeper look at stack behavior in PDAs. We start with the simple, one-state PDA for found in the figure below.
Press + to interact
While referring to this figure, let’s study the following trace of .
Step | Input | Stack |
---|---|---|
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 |
Access this course and 1400+ top-rated courses and projects.