Introduction to Automaton Theory