Grammatical Inference: Learning Automata and Grammars