Which grammar rules violate the requirement of the operator grammar? A, B, C…
2020
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals.
i. A → BC
ii. A → CcBb
iii. A → BaC
iv. A → ε
- A.
i only
- B.
i and ii
- C.
i and iii
- D.
i and iv
Attempted by 86 students.
Show answer & explanation
Correct answer: D
An Operator Grammar must satisfy two strict conditions:
No production can have an ε (null) on the right-hand side.
No two non-terminals (variables) can appear adjacently on the right-hand side.
Rule i (A → BC): Violates condition 2 because B and C are adjacent variables.
Rule ii (A → CcBb): Valid. Variables are separated by terminal c.
Rule iii (A → BaC): Valid. Variables are separated by terminal a.
Rule iv (A → ε): Violates condition 1 due to the null production.
Thus, i and iv violate the requirements.
Correct Answer: i and iv (Option D).