Example of a simple formal grammar (left) with parsed sentence "the dog ate the bone" (right). Formal grammars consist of a set of non-terminal symbols, terminal symbols, production rules, and a designated start symbol.
A formal grammar is a set of symbols and the production rules for rewriting some of them into every possible string of a formal language over an alphabet. A grammar does not describe the meaning of the strings—only their form.
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).