NPDA transitions to different states by taking same input and popping same top element of a stack

Suppose i have some NPDA and there is some transition functions defined as:

$\delta(q_{1},a,A) = (q_{2}, A)$

$\delta(q_{1},a,A) = (q_{3}, Z)$

Is it allowed?
I understand, that since the NPDA is nondetermenistic, it’s possible to have transitions to different states with the same input character, but what about same element at the top of stack?


This is very well possible, the automaton nondeterministically chooses which transition is taken. So it may choose between $\lambda$-transitions and transitions reading input, all with the same symbol on top of the stack.

Sometimes this is written as
$\delta(q_1,a,A)=\{ (q_2,A), (q_3,Z)\}$,
where $\delta$ is considered as a function from $Q\times(\Sigma\cup\{\lambda\})\times\Gamma$ into finite subsets of $Q\times\Gamma^*$.

Alternatively $\delta$ can be seen as a finite relation in $Q\times(\Sigma\cup\{\lambda\})\times\Gamma\times Q\times\Gamma^*$, and we write $(q_1,a,A,q_2,A), (q_1,a,A,q_3,Z)\in\delta$.

Source : Link , Question Author : LumaEmu , Answer Author : Hendrik Jan

Leave a Comment