Question: (b) In this question, we consider CFGs in which we take S to be the initial variable. For each of the following statements, state whether


(b) In this question, we consider CFGs in which we take S to be the initial variable. For each of the following statements, state whether they are true or false. Correct answers are awarded 4 marks; wrong answers are penalised by 1 mark (to a minimum of 0 marks for this question). Omitted answers do not contribute positively or negatively to your grade. [16 marks] i. The CFG over the alphabet {a,b, =, +, 1,; } with reductions S + A;S A - +a=E A +6=E E+ E +6E+1E+V+V True or false: the language of this CFG is infinite (meaning: contains infinitely many strings). ii. The CFG over the alphabet {(,)} with reductions S + (S) | $ +(SS) | S +() True or false: the language of this CFG is precisely the set of non-empty strings over {(,)} with balanced brackets, including e.g. (), (()), (((()),... iii. The CFG over the alphabet {(,)} with reductions S +(T) | S +T(T) S + (T((T)T)) | S + | T +S True or false: the language of this CFG is precisely the set of (possibly empty) strings over {(,)} with balanced brackets, including e.g. (), (()), (((()), .... iv. The CFG over the alphabet {a,!} with reductions S + HSHS S + aH!! H + SHS True or false: the CFG is left-recursive. S +
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
