Learning regular sets from queries and counterexamples