If all the production rules have single non-terminal symbol on the left side,…

2015

If all the production rules have single non-terminal symbol on the left side, the grammar defined is :

  1. A.

    Context free grammar

  2. B.

    Context sensitive grammar

  3. C.

    Unrestricted grammar

  4. D.

    Phase grammar

Attempted by 171 students.

Show answer & explanation

Correct answer: A

Answer: Context-free grammar. A grammar where every production has a single non-terminal on the left-hand side is called a context-free grammar.

  • Formal definition: Each production has the form A -> α, where A is a single non-terminal and α is any string of terminals and/or non-terminals.

  • Example: S -> aSb | ε generates balanced strings of a's and b's and shows a typical context-free production pattern.

  • Why other classes do not match:

  • Context-sensitive grammars: Left sides can include surrounding context (e.g., αAβ -> αγβ) and productions typically must not decrease string length; the left side is not restricted to a single non-terminal.

  • Unrestricted or phrase-structure grammars: No restriction on the left-hand side; they are the most general class and do not require a single non-terminal on the left.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor