Left Recursion and Normal Forms: CNF vs GNF vs BNF

Left Recursion and Normal Forms: CNF vs GNF vs BNF

Verified Sources
Sep 14, 2026

In a keyword grammar, a nonterminal AA is left-recursive if there is a derivation A+AαA \Rightarrow^+ A\alpha for some string α\alpha (i.e., AA can derive a sentential form that begins with AA). This notion matters because many top-down parsers (e.g., naive recursive-descent) can loop when confronted with left recursion.

For context-free grammar “normal forms”:

  • keyword A grammar form where productions are restricted to ABCA\to BC or AaA\to a (with an allowance for special start-symbol rules in some definitions).
  • keyword Productions are of the form AaαA\to a\alpha where each rule begins with a terminal.
  • keyword A general notation for context-free grammars with production rules like A::=expressionA ::= \text{expression} (typically no restriction that prevents left recursion).

Key intuition:
If every production for a nonterminal starts with a terminal (as in GNF), then it cannot immediately or indirectly “start by expanding itself” at the left edge in the same way left recursion is defined; whereas CNF and especially BNF do not enforce that “leftmost expansion begins with a terminal.”

The multiple-choice question

Which of the following does not have left recursions?

(i) Chomsky normal form
(ii) Greibach normal form
(iii) Backus-Naur form
(iv) All of the above

From standard grammar theory: Greibach normal form is designed so that derivations from nonterminals begin with terminals in a way that avoids left recursion in the usual sense for the nonterminal rewriting process. BNF is general and can represent left-recursive grammars. CNF does not universally eliminate left recursion either, because it permits rules ABCA\to BC where BB could derive strings that start with AA.

Therefore, the correct choice is:

(ii) Greibach normal form

Left Recursion vs Normal Forms (GNF/CNF) — Educational Overview

Why GNF avoids left recursion (conceptual proof sketch)

In keyword every production has the shape: AaαA \to a\alpha where aa is a terminal and α\alpha is (possibly empty) a string of nonterminals.

Consider the leftmost derivation of AA:

  • The first symbol produced at the left edge must be the terminal aa (because the first production used from AA starts with a terminal).
  • To have left recursion A+AαA \Rightarrow^+ A\alpha, the leftmost symbol of the sentential form after some steps must again begin with AA.
  • But under GNF, after expanding AA (at the left edge), the derivation immediately places a terminal at the leftmost position; you cannot “recover” a sentential form whose leftmost symbol is AA without violating the property that expansions at the left edge begin with terminals.

So GNF’s “leftmost terminal starts” structure blocks the left-recursive pattern.

What “no left recursion” really means here

Many courses treat “GNF has no left recursion” as a property of the restricted production shapes used in GNF derivations (i.e., leftmost derivations cannot keep AA on the left edge). Always align with the course’s exact definition of left recursion and the exact GNF variant.

CNF and BNF can still be left-recursive

CNF restricts productions to: ABCorAaA \to BC \quad \text{or} \quad A \to a But it does not force that the first step from a nonterminal begins with a terminal—it can begin with another nonterminal BB. If BB can derive a string whose leftmost nonterminal expansion leads back to AA, you can get left recursion.

BNF imposes no such structural restriction. Since BNF can express arbitrary productions, it can represent grammars that are directly left-recursive, such as: AAαA \to A\alpha which is immediate left recursion by definition.

Productions like ABCA\to BC may allow A+AαA\Rightarrow^+ A\alpha via indirect derivations.

How to decide whether a normal form avoids left recursion

  1. 1
    Step 1

    Use A+AαA \Rightarrow^+ A\alpha (leftmost symbol remains AA after some positive derivation steps).

  2. 2
    Step 2

    If every expansion from AA begins with a terminal (as in GNF), the leftmost symbol cannot stay AA.

  3. 3
    Step 3

    Ask: after expanding AA once, can the left edge become AA again? If the formalism forces a terminal first, it blocks left recursion.

  4. 4
    Step 4

    BNF allows arbitrary productions; CNF allows ABCA\to BC, which can enable indirect left recursion.

  5. 5
    Step 5

    The option whose production form prevents AA from persisting at the left edge is the one that does not have left recursion.

Do the normal forms structurally prevent left recursion?

Qualitative mapping based on production-shape constraints (typical textbook definitions).

Common confusion checks

Left Recursion & Normal Forms (Quick Recall)

1 / 5
Question · Term

Left recursion (CFG) definition

Click to reveal
Answer · Definition

A+AαA \Rightarrow^+ A\alpha for some AA and string α\alpha.

Knowledge Check

Question 1 of 4
Q1Single choice

A CFG is left-recursive (in the usual definition) if there exists which kind of derivation?