implement NFA to DFA and minimize DFA