0
2.7kviews
Design PDA to accept language L={a"b"n-1}.
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, XXR)}$
$δ (q_0, b, X) = {(q_1, €)}$
$δ (q_1, b, X) = {(q_1, €)}$
$δ (q_1, €, R) = {(q_f, R)}$
Example:
$(q_0, aaabbb, R)$
$| - (q_0, aabbb, XR)$
$| - (q_0, abbb, XXR)$
$| - (q_0, bbb, XXXR)$
$| - (q_0, bb, XXR)$
$| - (q_0, b, XR)$
$| - (q_1, €, R)$
$| - (q_f, €, R)$
(Accept)