implemented Automaton.reverse() method