Which formal grammar type has production rules whose left-hand side is a single non-terminal symbol?

Prepare for the GATE General Aptitude and CS Test. Enhance your skills with multiple choice questions and detailed explanations. Elevate your readiness and boost your confidence for the exam!

Multiple Choice

Which formal grammar type has production rules whose left-hand side is a single non-terminal symbol?

Explanation:
In grammars, having a single non-terminal on the left side of every production defines a context-free grammar. In this form, rules look like A -> w, where A is a non-terminal and w can be any string of terminals and non-terminals. This setup lets you rewrite one non-terminal at a time and build up complex, recursive structures, which is exactly what context-free grammars are designed to express. Regular grammars are actually a narrower subset that keeps the left side as a single non-terminal but imposes a stricter shape on the right side (typically a terminal with at most one non-terminal, or just a terminal). Context-sensitive grammars relax the left-hand side, allowing longer strings of symbols, and unrestricted grammars remove such restrictions altogether. So the rule form described corresponds to context-free grammars.

In grammars, having a single non-terminal on the left side of every production defines a context-free grammar. In this form, rules look like A -> w, where A is a non-terminal and w can be any string of terminals and non-terminals. This setup lets you rewrite one non-terminal at a time and build up complex, recursive structures, which is exactly what context-free grammars are designed to express. Regular grammars are actually a narrower subset that keeps the left side as a single non-terminal but imposes a stricter shape on the right side (typically a terminal with at most one non-terminal, or just a terminal). Context-sensitive grammars relax the left-hand side, allowing longer strings of symbols, and unrestricted grammars remove such restrictions altogether. So the rule form described corresponds to context-free grammars.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy