Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Given the following regular expression over the alphabet fa, b), a (a* + b)b aa* to transform it to a regular grammar, we first
2. Given the following regular expression over the alphabet fa, b), a (a* + b)b aa* to transform it to a regular grammar, we first transform it to an NFA as the one shown below 0 2 Instead of converting this NFA to a regular grammar directly, we convert it a DFA first and then convert the DFA to a regular grammar (why?) So we construct/closures of the above NFA build the following tree, (3 points) A(0,-(0, 1 ,2} {3} and use distinct nodes of this tree (distinct nodes of the tree are identified level by level and, within each level, from left to right), (1 points) to build a transition table, and rename the states as S (start state), I, J, K and L: points) (4 S (0.1.2 Then convert the table representation to a digraph representation as follows: (3.5 points) However, we don't need the portion circled in the above digraph representation of the DFA (why?). By removing that portion, the DFA is like the one shown on the left side of the following figure. By constructing production rules from this FA, we get the production set of the regular grammar on the right side of the above figure. (4.5 points) The above FA can be further simplified to be of the form shown on the left side of the following figure. (2.5 points) By constructing production rules from this FA, we get the production set on the right side of the above figure (3.5 points). This is the production set of the regular grammar for the regular expression a"(a" + b)b"aa"-a"b"a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started