Automata Learning: An Algebraic Approach