Formal Grammar
Version 1.0.0 · Updated 2026-07-28
CORE DEFINITION
In formal language theory, a formal grammar is a set of production rules for strings in a formal language. These rules describe how to generate valid strings that conform to the syntax of the language using its alphabet. A grammar does not describe the meaning of strings or what can be done with them in any context—only their form. Formal language theory is a branch of applied mathematics that studies formal grammars and languages. It has wide applications in theoretical computer science, theoretical linguistics, formal semantics, and mathematical logic. A formal grammar is a set of rules for rewriting strings, starting from a 'start symbol'. Therefore, a grammar is usually considered a language generator. However, it can also sometimes serve as the basis for a 'recognizer' (a function in computer science that determines whether a given string belongs to the language or is syntactically incorrect). Formal language theory uses another theory to describe recognizers, namely automata theory. An interesting result in automata theory is that for certain formal languages, no recognizer can be designed.
SCAFFOLDING EFFECT
Reduce cognitive load
In formal language theory, a formal grammar is a set of production rules for strings in a formal language. These rules describe how to generate valid strings that conform to the syntax of the language using its alphabet. A grammar does not describe the meaning of strings or what can be done with them in any context—only their form. Formal language theory is a branch of applied mathematics that studies formal grammars and languages.
Anchor fast decisions
A formal grammar describes the generative structure of a language using a set of production rules, consisting of terminal symbols, nonterminal symbols, a start symbol, and rules. The Chomsky hierarchy classifies grammars into types 0-3 based on the degree of restriction on rules, corresponding to different language families and automata, providing precise and unambiguous structural definitions for programming languages and natural languages.
MINIMUM ACTION
In progress 0/4Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%BD%A2%E5%BC%8F%E6%96%87%E6%B3%95verified
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS