Automata theory and formal languages