The solution is simple. In this case the PDA must accept an even number of 0s including a zero number of 0s.
In order to achieve that a simple implementation would be to pop from the stack the symbol I
each time an even number of appearance of 0 is met, so the δ
function would be:
___________________________________________________________________
| X | I | -| |
---+------------------------+--------------------------+-------------|
S | read("0")=> push(I) | read("0")=> pop | |
| keep=> move(T) | | |
---+------------------------+--------------------------+-------------|
T | | | success |
---------------------------------------------------------------------+
Let's try the 2 examples:
->for string 00:
MOVE STACK INPUT STATE DESCRIPTION_OF_MOVE
1 X '0'0 S read(0)=> push(I)
2 XI '0' S read(0)=> pop
3 X ε S ε-transition
4 X ε T success
->for string 000:
MOVE STACK INPUT STATE DESCRIPTION_OF_MOVE
1 X '0'00 S read(0)=> push(I)
2 XI '0'0 S read(0)=> pop
3 X '0' S read(0)=> push(I)
4 XI ε S eoi=> failure