Peterson with automaton