Formula generating grammar.