Port: Util.Automaton in progress