added Automaton.toCFG() method