-
Let L denotes the language generated by the grammar S → 0S0 / 00. Which of the following is true?
-
- L = 0+
- L is regular but not 0+
- L is context-free but not regular
- L is not context-free
- L = 0+
Correct Option: B
S → 0S0 /00
S → 0S0 (type 2 production)
This is a context-free grammar as in CFG, the left hand side of the production rule has no left and right context. S → 00
means S →^ (null)* (type 3 production)
This is called the regular grammar.