Jump to content

Stack automata

- - - - -

  • Please log in to reply
No replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
For language: a^nb^ma^{n+m}

q0 => (a,E,X) to q0
q0 => (E,E,E) to q1
q1 => (b,E,X) to q1
q1 => (E,E,E) to q2
q2 => (a,X,E) to q2
q2 => (?,?,E) to q3
q3 is end state

E is empty move
? is empty stack

Works for the language => aabbaaaa

But not work if go this route => aabaaa or abbbaaaa

My question is if the automaton is correct




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users