I am studying pushdown automata for a course and I've reached a conceptual plothole.
Does the stack basically have infinite memory or only space for a single symbol?
If I have the following string:
abba And the following rules with q6 as my acceptance state:
(q0,a,Z)=(q1,a)
(q1,b,a)=(q2,b)
(q2,b,b) = (q3,b)
(q3,a,b) = (q4,a)
(q4,lambda,a)=(q5,lambda)
(q5,lambda,a)=(q5,lambda)
(q5,lambda,b)=(q5,lambda)
(q5,lambda,Z)=(q6,lambda)
In the states my stack looks like this:
q0: Z
q1: aZ
q2: baZ
q3: bbaZ
q4: abbaZ
q5: Z because eventually everything is popped
q6: Z
Is this the proper transformation of the stack? Basically every push it grows indefinitely? Or should every push swap with the current top?
For example the states would like:
q0: Z
q1: aZ
q2: bZ
q3: bZ
q4: aZ
q5: Z
q6: Z