Given a grammar: S₁ → Sc S → SA | A A → aSb | ab There is a rightmost…

2013

Given a grammar:

S₁ → Sc
S → SA | A
A → aSb | ab

There is a rightmost derivation:
S₁ ⇒ Sc ⇒ SAc ⇒ SaSbc

Thus, SaSbc is a right sentential form, and its handle is

  1. A.

    SaS

  2. B.

    bc

  3. C.

    Sbc

  4. D.

    aSb

Attempted by 51 students.

Show answer & explanation

Correct answer: D

To identify the handle, analyze the final step of the rightmost derivation: SAc ⇒ SaSbc.

In this step, the non-terminal A is replaced by aSb using the production rule A → aSb.

The handle is the substring that reduces back to A in this rightmost derivation, which corresponds to aSb.

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

Explore the full course: Mppsc Assistant Professor