Library

2DFA · Regular

Two passes, one head

Checks even a's on the way out and odd b's on the way back — the head bounces off the end marker and re-reads the input. Multiple passes replace memory.

a_evena_oddb_evenb_oddacc⊢, ba⊣ababab⊢
The machine as drawn — 5 states, 11 transitions.

The author’s examples, run

aab → acceptb → acceptbabab → acceptab → rejectaabb → reject