1. regular conversion to the 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
S->A1
A->B0
B->C1
C->1(0|1)*
->1|C0|C1
(a|b)*(aa|bb)(a|b)*
S->(a|b)S
S->(aa|bb)(a|b)*
S->S(a|b)
S->(aa|bb)
S->aA
A->a
S->bB
B->b
S-> ThE | P | In | SB | AA | BB
((0|1)*|(11))*
S->((0|1)*|(11))S|E
S->(0|1)*S|11S|E
S->(0|1)*S
S->(0|1)S
S->0S|1S
S->1A
A->1S
S->0S|1S|1A|E
(0|110)
S->0
S->1A
A->1B
B->0
S->0|1A
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.
Transformation matrix:
0 | 1 | |
q0 | q1 | q0 |
q1 | q2 | q0 |
q2 | q3 | q0 |
q3 | q3 | q3 |
State transition diagram:
Recognition of language: (1 | 01 | 001) * 000 (0 | 1) *
3. configured by regular automatic machine NFA formula R
(A | b) * abb
(a|b)*(aa|bb)(a|b)*
1(1010*|1(010)*1)*0