Library

PDT · Pushdown transduction

Classic: aⁿbⁿ ↦ bⁿaⁿ

Accepts aⁿbⁿ with the stack while printing b for every a and a for every b — so the output is bⁿaⁿ. Recognition and transduction in one machine.

reading areading bbalanced
The machine as drawn — 3 states, 4 transitions.

The author’s examples, run

ab → accept · baaabb → accept · bbaaaaabbb → accept · bbbaaaaab → rejectabb → reject