Structural equivalence of automata