DFA simulation