Add dfa equivalence checking function and renamed ast_to_dfa