Regular Languages: Outline
Regular Languages: Outline
Regular grammars
Automata
Finite State Automata (FSA)
Regular expressions
Minimization of DFSA
Identification of non-regular languages
Pumping Lemma for Regular languages
Example:
Let G=(N, T, P, S) be a regular grammar with
P: SaA|bB
AaA|a
BbB|b
Draw a transition diagram that represents G
Types of automata
Final State Automata (FSA)
Deterministic FSA (DFSA)
Nondeterministic FSA (NFSA)
Push Down Automata (PDA)
Deterministic PDA (DPDA)
Nondeterministic PDA (NPDA)
Turing Machine (TM)
A a
B C b D
a
b
State Input Next state Check whether the following
S a A strings are accepted or not:
S b B
A a A • ab
A b C • ba
B b B • bbaba
B a C • aa
C b D • aaabbaaa
D a D
Extensions of t
t needs to be extended as:
t: Q X Σ* Q
let x ε Σ*, then
i) x = λ
ii) x = ay, a ε Σ, y ε Σ*
Then i) t(q, λ) = q
ii) t(q, x) = t(q, ay)
= t(t(q, a), y)
Eg. a) t(S, ab)
b) t(S, bbba)
c) t(S, aaa)
Let M be an NFSA,
L(M) = set of strings accepted by M
= {x Є Σ* | t(qo, x) n F ≠ Ø}
q1 q2
b
b
a
Example:
α = a*(b+c)
L(α) = L(a*(b+c))
= L(a*)L(b+c)
= L(a)*(L(b) U L(c))
= {a}*({b} U {c})
= {a}*({b,c})
Note: In the absence of parentheses, the hierarchy of operations is as
follows: iteration, concatenation, and union.
ØR = RØ = R
λ* = λ, Ø*λ
R+R = R
R*R* = R*
RR* = R*R
(R*)* = R*
λ + RR* = R* = λ + R*R
(PQ)*P = P(QP)*
(P+Q)* = (P*Q*)* = (P*+Q*)*
a b
b b a b
b
3 4 5
a
a
a 3 5
a
1 b
b
b
a
2 4
a, b