Sequential learning of automata from input-output behaviour