Suppose A->xBz and B->y, then the simplified grammar would be:

Khang Lê

New member
Suppose A->xBz and B->y, then the simplified grammar would be:
A. A->xyz
B. A->xBz|xyz
C. A->xBz|B|y
D. none of the mentioned
 
Answer: A
Explanation: For the first step, substitute B in first production as it only produces terminal and remove B production as it has already been utilized.
We get A->xBz|xyz and now, as B has no production, we eliminate the terms which hold the variable B, thus the answer remain A->xyz.
 

Tìm kiếm

Back
Top