Math 2.0

Computer science Definition

Greibach normal form

Builds on Context-free grammarContext-free language

Definition

Let G=(N,Σ,P,S)G = (N, \Sigma, P, S) be a context-free grammar. The grammar GG is in Greibach normal form if every rule in PP has one of the following forms:

  1. A→aA1A2⋯AkA \to a A_1 A_2 \cdots A_k, where A∈NA \in N, a∈Σa \in \Sigma, k≥0k \ge 0 and A1,…,Ak∈NA_1, \dots, A_k \in N;
  2. S→εS \to \varepsilon, allowed only if SS does not occur on the right side of any rule.

Remarks

Example: the rules S→aSBS \to aSB, S→aBS \to aB, B→bB \to b form a grammar in Greibach normal form. Each right side is one terminal followed by nonterminals (SBSB, BB, or nothing), so clause 1 holds; it generates {anbn:n≥1}\set{a^n b^n : n \ge 1}. Non-example: the rule S→SaS \to Sa fails clause 1, because its right side starts with a nonterminal; such a rule is called left-recursive. Every context-free language is generated by a grammar in Greibach normal form. In such a grammar, a word of length n≥1n \ge 1 has derivations of exactly nn steps.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Context-free grammar concept
  2. Context-free language concept
  3. Greibach normal form definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Greibach_normal_form
About this page
TagF95BZ9QHS9
URIm2://F95BZ9QHS9
Kinddefinition
WritingW0 stub
MSC68Q42, 68Q45
DefinesGreibach normal form
UsesContext-free grammar, Context-free language
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.