Context-free grammar
formal grammar whose production rules can be applied to a nonterminal symbol regardless of its context

In formal language theory, a context-free grammar (CFG) is a formal grammar whose production rules
can be applied to a nonterminal symbol regardless of its context.
In particular, in a context-free grammar, each production rule is of the form
A
→
α
{\displaystyle A\ \to \ \alpha }
with
A
{\displaystyle A}
a single nonterminal symbol, and
α
{\displaystyle \alpha }
a string of terminals and/or nonterminals (
α
{\displaystyle \alpha }
can be empty). Regardless of which symbols surround it, the single nonterminal
A
{\displaystyle A}
on the left hand side can always be replaced by
α
{\displaystyle \alpha }
on the right hand side. This distinguishes it from a context-sensitive grammar, which can have production rules in the form
α
A
β
→
α
γ
β
{\displaystyle \alpha A\beta \rightarrow \alpha \gamma \beta }
with
A
{\displaystyle A}
a nonterminal symbol and
α
{\displaystyle \alpha }
,
β
{\displaystyle \beta }
, and
γ
{\displaystyle \gamma }
strings of terminal and/or nonterminal symbols.
A formal grammar is essentially a set of production rules that describe all possible strings in a given formal language. Production rules are simple replacements. For example, the first rule in the picture,
⟨
Stmt
⟩
→
⟨
Id
⟩
=
⟨
Expr
⟩
;
{\displaystyle \langle {\text{Stmt}}\rangle \to \langle {\text{Id}}\rangle =\langle {\text{Expr}}\rangle ;}
replaces
⟨
Stmt
⟩
{\displaystyle \langle {\text{Stmt}}\rangle }
with
⟨
Id
⟩
=
⟨
Expr
⟩
;
{\displaystyle \langle {\text{Id}}\rangle =\langle {\text{Expr}}\rangle ;}
. There can be multiple replacement rules for a given nonterminal symbol. The language generated by a grammar is the set of all strings of terminal symbols that can be derived, by repeated rule applications, from some particular nonterminal symbol ("start symbol").
Nonterminal symbols are used during the derivation process, but do not appear in its final result string.
“Context-free grammar” enters the record as formal grammar whose production rules can be applied to a nonterminal symbol regardless of its context. Crown Archives preserves that source wording while asking what Context-free, grammar and formal can confirm, complicate or overturn.
Why this record matters
“Context-free grammar” is worth following because a concise public description often conceals a longer documentary argument. Here, Context-free, grammar and formal provides the most credible route into that argument.
The citation trail is more important than the brevity of the summary: it shows where individual claims can be examined in context. The source revision retrieved here is dated Sep 12, 2026. The linked authority identifier is Q338047. None of the 0 selected statements returned an explicit reference.
A concise general-reference account can conceal disagreements about scope, terminology or the weight assigned to individual sources. The lead is largely declarative, so disagreement and counter-evidence require a deliberate search beyond the opening account. Authority statements aid reconciliation but still require their own references, qualifiers and ranks to be checked.
How to read it
Use the entry as an orientation point, then follow its citations and revision history. Names, dates and institutional relationships should be checked against the original record.
- Subject orientation
- Search vocabulary
- Locating named sources
The closest primary source, responsible institution and strongest cited specialist reference.
Three-step research path
- Establish the record: confirm the title “Context-free grammar”, its source revision and the description used here.
- Expand the search: follow Context-free grammar primary sources, Context-free grammar archive and Context-free research across catalogues and specialist indexes.
- Test the account: compare the strongest cited source with the responsible institution’s current record and note any disagreement.
Questions for further research
- Which source most directly establishes the central claim about “Context-free grammar”?
- Which cited source is closest to the event, object or claim?
- Which institution is responsible for the underlying evidence?
Search terms from this dossier
This entry incorporates text from “Context-free grammar” on English Wikipedia. Contributors are listed in the page history. Text is available under the Creative Commons Attribution-ShareAlike 4.0 License. Selected authority identifiers and statements are retrieved from Wikidata under CC0; their references and qualifiers remain part of the verification path.