Automata--theoretic techniques for modal logic of programs