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
- A.
SaS
- B.
bc
- C.
Sbc
- 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.