0
2.4kviews
Construct PDA accepting the language. L = {anbn|n>0}.
1 Answer
written 8.5 years ago by |
PDA is used for recognizing CFL which is generated by CFG.
Logic:
For each ‘a’ push 1X
For each ‘b’ pop 1X
Implementation:
$M = (Q, Σ, Ґ, δ, q_0, z_(0 ), F )$
$Q = {q_0, q_1, q_f}$
$Σ= {a, b}$
$Ґ = {X, R}$
$q_0 = q_0$
$z_0 = R$
$F = {q_f}$
δ:
$δ (q_0, a, R) = {(q_0, XR)}$
$δ (q_0, a, X) = {(q_0, XR)}$
$δ (q_0, b, X) = {(q_1, €)}$
$δ (q_1, b, X) = {(q_1, €)}$
$δ (q_1, €, R) = {(q_f, R)}$
Example:
$(q_0, aabb, R)$
$| - (q_0, abb, XR)$
$| - (q_0, bb, XXR)$
$| - (q_1, b, XR)$
$| - (q_1, €, R)$
$| - (q_f, €, R)$
(Accept)