context-free grammars
A context-free grammar (CFG) is a formal system used to define the structure of languages, particularly in computer science and linguistics. It consists of a set of rules or productions that describe how symbols can be combined to form valid strings. Each rule specifies how a single non-terminal symbol can be replaced with a combination of terminal and non-terminal symbols.
In a CFG, the rules are applied without considering the surrounding context of the symbols, which is why it is called "context-free." This property makes CFGs useful for parsing programming languages and natural languages, as they can generate complex structures while maintaining simplicity in their rules.