Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(b) In this question, we consider CFGs in which we takeSto be the initialvariable. For each of the following statements, state whether they aretrue or

(b) In this question, we consider CFGs in which we takeSto be the initialvariable. For each of the following statements, state whether they aretrue or false. Correct answers are awarded4marks; wrong answersare penalised by1mark (to a minimum of0marks 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 reductionsSA;SAa=EAb=EEaEbE1EV+VTrue or false: the language of this CFG is infinite (meaning: containsinfinitely many strings).ii. The CFG over the alphabet{(,)}with reductionsS(S)S(SS)S()True or false: the language of this CFG is precisely the set ofnon-empty strings over{(,)}with balanced brackets, includinge.g.(),(()),(()(())), ...iii. The CFG over the alphabet{(,)}with reductionsS(T)ST(T)S(T((T)T))STSTrue or false: the language of this CFG is precisely the set of(possibly empty) strings over{(,)}with balanced brackets, includinge.g.(),(()),(()(())), ....

v. The CFG over the alphabet{a,!}with reductionsSHSHSSaH!!SHSHSTrue or false: the CFG is left-recursive

image text in transcribed

(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;8|1 a=E|1 +6=E|E+a|E+6E+1|E +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 +(5) | 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. 0, 0), (0(0)),... ii. The CFG over the alphabet {(,)} with reductions $+(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. (),(0), (000)),.... 2 Compilers and Computer Architecure G5035 iv. The CFG over the alphabet {a,!} with reductions S+HSHS | S +aH!! | S + | H+SHS True or false: the CFG is left-recursive

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions