Which grammar rules violate the requirement of the operator grammar? A, B, C…
2015
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals
1) A → BC
2) A → CcBb
3) A → BaC
4) A → ε
- A.
1 only
- B.
1 and 2 only
- C.
1 and 3 only
- D.
1 and 4 only
Attempted by 67 students.
Show answer & explanation
Correct answer: D
An operator grammar strictly forbids productions with adjacent variables on the right-hand side and prohibits ε-productions. Rule 1 (A → BC) violates this constraint because variables B and C appear consecutively without intervening terminals. Rule 4 (A → ε) is invalid because operator grammars do not allow empty string productions. Rules 2 and 3 contain terminals separating the variables, satisfying the adjacency requirement.
A video solution is available for this question — log in and enroll to watch it.