Module 3
Module 3
COMPUTATION
Steps:
Add a new start state and final state add an €-transition
between the new and the existing states
One by one, bypass and eliminate the non initial and the final
states in the transition diagram
A state is bypassed or eliminated by combining each
outgoing edge with the incoming edge
The label of the resultant edge is the concatenation of the
outgoing and incoming edge alphabets along with loop edges
if there is one.
When 2 or more parallel edges are going in the same
direction from one state, unify them by union of (+)
their labels
Finally only one edge is left from initial to final state.
The label on that edge is the regular expression
L={ 00,000,100,000,001,0000,0001,…}
Text : abdababadad
Steps:
a b d
0 0 1 0
1 2 1 0
2 0 1 3
3 4 1 0
4 0 1 0
where
V is a finite set of non-terminal symbols,
Σ is a finite set of terminal symbols,
P is a set of production rules of the form A → α, where A is a non-
terminal symbol and α is a string of symbols in (V ∪ Σ) *, and
S is the start symbol.
Given
S → 0A
A → 1B
B → 0A | 1B | ε
Linear Grammar
When the right side of the Grammar part has only one
terminal then it's linear else non linear.
Left linear grammar
In a left-regular grammar (also called left-linear
grammar), the rules are of the form as given below −
L → Ma
If the non terminal is at the left most in the RHS
A0 -> 1A2
A1 -> 0A2
A2 -> 0
33 Dr. R.V. Aswiga , Assistant Professor (Sr.), School of Computer
Science and Engineering, VIT Chennai.
Regular Grammar to FA Solution
Let M = ( Q, ∑, δ, q0, F ) be a finite-
automata that accepts L (G), where
Q = {A0, A1, A2, Af}
∑ = {0, 1}
A0 is the initial state F = {Af}