Added code that generates automaton but there's a semantic error
somewhere in our generate functions.