Question: (5+5=10 points) Write a regular expression to denote the set of all strings of letters that contain the five vowels in order. Assume that letters

  1. (5+5=10 points) Write a regular expression to denote the set of all strings of letters that contain the five vowels in order. Assume that letters can only be lower case. Then, re-state the regular expression in terms of a context free grammar.
  2. (5 points) What language does this grammar generate?

-> a b -> b a -> epsilon

where epsilon is the empty symbol, a terminal.

3. (10 points) The following grammar for if-then-else is proposed to remedy the dangling else ambiguity:

-> if then | -> if then else |

Show that this grammar is still ambiguous.

4. (10 points) Consider the language given by Strings of 0s and 1s of the form xx, i.e., consisting of sentences such as 0000, 0101, 11, 010010, and so on. Is this language regular? (i.e., can it be defined by a regular expression?) If yes, give a regular expression. If no, state why not.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!