Main derivation
S01 · implies
Before
Q=\{q,p,f\},\quad\Sigma=\{a,b\},\quad\Gamma=\{Z,A\}After
\begin{array}{c|c|c|c|c}q&a&Z&q&[Z,A]\\q&a&A&q&[A,A]\\q&b&A&p&[]\\p&b&A&p&[]\\p&\text{null}&Z&f&[Z]\\q&\text{null}&Z&f&[Z]\end{array}Conditions: none
Rule: calc · Uses: G1
Leaf basis: calc
All six relation entries are valid; bottom Z is replaced only by bottom-preserving [Z,A] or [Z], preventing underflow.
S02 · implies
Before
w=aabb,\quad |w|=4
After
[q,0,[Z]]
Conditions: none
Rule: calc · Uses: G1, S01
Leaf basis: calc
Initialize at position zero with stack consisting only of bottom Z.
S03 · implies
Before
[q,0,[Z]]
After
[q,1,[Z,A]]
Conditions: none
Rule: calc · Uses: G1, S01, S02
Leaf basis: calc
Read the first a using [q,a,Z,q,[Z,A]], retaining the bottom and pushing A.
S04 · implies
Before
[q,1,[Z,A]]
After
[q,2,[Z,A,A]]
Conditions: none
Rule: calc · Uses: G1, S01, S03
Leaf basis: calc
Read the second a, replacing the top A by [A,A] while retaining Z below.
S05 · implies
Before
[q,2,[Z,A,A]]
After
[p,3,[Z,A]]
Conditions: none
Rule: calc · Uses: G1, S01, S04
Leaf basis: calc
Read the first b using [q,b,A,p,[]], popping the rightmost A and entering p.
S06 · implies
Before
[p,3,[Z,A]]
After
[p,4,[Z]]
Conditions: none
Rule: calc · Uses: G1, S01, S05
Leaf basis: calc
Read the last b using [p,b,A,p,[]], removing the final A and reaching position 4.
S07 · implies
Before
[p,4,[Z]]
After
[f,4,[Z]]
Conditions: none
Rule: calc · Uses: G1, S01, S06
Leaf basis: calc
Use [p,null,Z,f,[Z]] as an epsilon move, keeping position 4 and preserving bottom.
S08 · implies
Before
[f,4,[Z]],\quad f\in F,\quad4=|w|
After
aabb\text{ accepted by this finite run}Conditions: none
Rule: mko_definition · Uses: G1, S02, S03, S04, S05, S06, S07
Leaf basis: mko_definition
All input is consumed and the endpoint is final, meeting the stated convention despite a nonempty stack.