A formal conversion to regular grammar
For any regular formula R selecting a nonterminal Z → Z generation rule R
1. rules of the form A → ab converted into A → aB, B → b
2. the form A → a | b rules, be converted into A → a, A → b (A → a | b)
3. The form A → a * b rules, be converted into A → aA, A → b
The form A → ba * As a rule, be converted into A → Aa, A → b
Continue using the conversion rules, each rule comprising at most until a terminator far.
1(0|1)*101
(a|b)*(aa|bb)(a|b)*
((0|1)*|(11))*
(0|110)
solution:
1.
S->A1
A->B0
B->C1
C->1(0|1)*->C0|C1|1
2.
S->(a|b)S
S->(aa|bb)(a|b)*->S(a|b)
S->(aa|bb)->Aa|Bb
In summary:
S-> ThE | P | In | SB | Aa | Bb
A->a
B->b
3.
((0|1)*|(11))*
S->ε|((0|1)*|(11))S->ε|(0|1)*S|(11)S->ε|(0|1)*S|(11)S->ε|(0|1)S|(11)S->ε|0S|1S|1A
A->1S
4.
(0|11*0)*
S->ε|(0|11*0)S->ε|0S|(11*0)S
S->(11*0)S->11*0S->1A
A->1*0S->1A|0S
In summary:
S->ε|0S|1A
A->1A|0S
2. automaton M = ({q0, q1, q2, q3}, {0,1}, f, q0, {q3})
Where f:
(q0,0)=q1
(q1,0)=q2
(Q2,0) = q3
(q0,1)=q0
(q1,1)=q0
(Q2,1) = q0
(Q3,0) = q3
(Q3,1) = q3
Now draw the state transition matrix and state transition diagram, identify what language
3. configured by regular automatic machine NFA formula R
(A | b) * abb
(a|b)*(aa|bb)(a|b)*
1(1010*|1(010)*1)*0