
Formal Languages and Automata 423
{q
3
}{q
1
, q
3
}
∅
C
{q
1
, q
2
}{q
2
, q
3
}{q
2
, q
3
}
{q
1
, q
3
}{q
1
, q
3
}{q
2
} D
{q
2
, q
3
}{q
1
, q
2
, q
3
}{q
3
} E
{q
1
, q
2
, q
3
}{q
1
, q
2
, q
3
}{q
2
, q
3
} F
As states {q
1
} and {q
1
, q
2
} have no transitions going to them, they can be removed from the final
D
4
and it will have the six states A, B, C, D, E, F, as shown.
A.4.4 Conversion of a Regular Grammar to FSM
We have already seen how we can convert an RE to an FSM (see Table A.4). Now we consider
how can we convert a regular grammar to an FSM. Suppose we are given a grammar G = < V
N
,
V
T
, S, P >, we want M = < Q, V
T
, q
0
, F, M >, which will accept exactly the language generated
by G. We can do ...