simulate and test DFA, NFA, PDA, TM