how can I draw the pushdown automaton for a language

808 Views Asked by At

How can I draw the pushdown automaton for the language $\{w \in \{a,b,c\}^{*}:w \text{ is of the form } y c y^{R}, y \in \{a,b\}^{*}\}$?

2

There are 2 best solutions below

1
On BEST ANSWER
  • let's call the starting state COPY
  • on input character $a$ or $b$, PUSH this into the stack and stay on state COPY
  • if character $c$ is the input, move to state CHECK
  • from state CHECK, input $c$ leads to state ERROR
  • similarly, both cases (tape: $a$, POP: $b$), $\ $(tape: $b$, POP $a$) lead to state ERROR
  • the other two inputs (tape: $a$, POP: $a$), $\ $(tape: $b$, POP $b$) stay on state CHECK
  • finally (tape: EOT, POP: empty) goes to state ACCEPT
3
On

That's what I have tried.Do you mean that I should do something like that?

enter image description here