PDA to CFG Conversion
Algorithm to find CFG corresponding to a given PDA
Input β A CFG, G = (V, T, P, S)
Output β Equivalent PDA, P = (Q, β, S, Ξ΄, q0, I, F) such that the non- terminals of the grammar G will be {Xwx | w,x β Q} and the start state will be Aq0,F.
Step 1 β For every w, x, y, z β Q, m β S and a, b β β, if Ξ΄ (w, a, Ξ΅) contains (y, m) and (z, b, m) contains (x, Ξ΅), add the production rule Xwx β a Xyzb in grammar G.
Step 2 β For every w, x, y, z β Q, add the production rule Xwx β XwyXyx in grammar G.
Step 3 β For w β Q, add the production rule Xww β Ξ΅ in grammar G
Discussion & Queries (<$I18NNumComments$>):
<$CommentPager$>
- <$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>
<$CommentPager$>
<$BlogCommentBody$>
<$BlogCommentDeleteIcon$>