COMPUTER SCIENCE AND ENGINEERING
THEORY OF COMPUTATION
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
In context to the process of removing useless symbols, which of the following is correct?
|
We remove the Nullable variables
|
|
We eliminate the unit productions
|
|
We eliminate products which yield no terminals
|
|
All of the mentioned
|
Explanation:
Detailed explanation-1: -Step 1: To remove A → B, add production A → x to the grammar rule whenever B → x occurs in the grammar. Step 2: Delete A → B from the grammar. Step 3: Repeat the first and the second steps until all the unit productions are removed.
Detailed explanation-2: -Useless symbol is the one which does not derive any string. Q does not derive any string. So, production S → PQ does not have any meaning. Since S → PQ is removed, P → p is not reachable it is also useless.
There is 1 question to complete.