In addition, grammars permit great flexibility to define the search space. Instead of “ad-hoc” mechanisms, grammars can be used to guarantee that individuals comply with the language restrictions. However, sometimes GP is used to evolve structures that must respect some constraints. In standard GP there are no constraints on the structure to evolve: any combination of functions and terminals is valid.