Introduction to Automata Theory Languages and Computation. J. E. Hopcroft and J. D. Ullman.Introduction to Automata Theory, Languages, and Computation.