Figure 2: Design of the Grammatical Herding algorithm.