Practice free →
HomeGATE CSEcomputerscienceTheory of Computation › What is a LEFTMOST DERIVATION?

What is a LEFTMOST DERIVATION?

Aa derivation that always picks the rule listed first in $R$
Bat each step, the LEFTMOST non-terminal in the sentential form is expanded
Ca derivation from $\varepsilon$ back to $S$
Da derivation that uses only left-recursive rules
Answer & Solution
Correct answer: B. at each step, the LEFTMOST non-terminal in the sentential form is expanded
1. In a CFG, at each derivation step you choose a NON-TERMINAL in the current sentential form and apply a production rule to it. 2. LEFTMOST DERIVATION: always expand the LEFTMOST non-terminal. 3. RIGHTMOST DERIVATION: always expand the RIGHTMOST non-terminal. 4. Each parse tree corresponds to exactly one leftmost derivation (and one rightmost derivation). So leftmost/rightmost derivations and parse trees are EQUIVALENT representations. 5. Ambiguity is defined via distinct parse trees (or equivalently, distinct leftmost derivations). 6. Options A, C, D mismatch the definition. _Source: Jeff Erickson, "Models of Computation", §5.6 (Leftmost and rightmost derivations)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions