An Introduction to Formal Languages and Automata