Operations on finite automata