The aim of grammatical inference is defined from a new point of view. The maximal valid grammar method is proposed to infer context free grammars from structural positive samples using negative samples. A polynomial algorithm is given. The MVG method is applied on the class of regular grammars.
展开▼