Automata Theory and Logic