implement minimal DFA