Professional Documents
Culture Documents
(FLAT)
U Narasimhulu
Assistant Professor
UNIT - II
Regular Expressions: Finite Automata and Regular Expressions, Applications of Regular
Expressions, Algebraic Laws for Regular Expressions, Conversion of Finite Automata to Regular
Expressions.
Pumping Lemma for Regular Languages, Statement of the pumping lemma, Applications of the
Pumping Lemma.
Closure Properties of Regular Languages: Closure properties of Regular languages, Decision
Properties of Regular Languages, Equivalence and Minimization of Automata.
CONTEXT FREE LANGUAGE
The set of all strings that can be derived from a Grammar is said to be the
LANGUAGE generated from that Grammar.
Example-1:
For generating a language that generates equal number of a’s and b’s in the form a n bn ,
the CFG will be defined as
G = {(S, A), (a, b), (SaAb, AaAb | ε)}
SaAb
a3 b3
an bn
L(G) = {an bn | n >0}
Example-2:
G = {(S, A, B), (a, b), (SAB, Aa, Bb)}
SAB
aB (by Aa)
ab (by Bb)
L(G) = {ab}
Example-3:
G = {(S, A, B), (a, b), (SAB, AaA | a, BbB | b)}
Case-1: Case-2:
SAB
aB (by Aa) SAB
ab (by Bb) aB (by Aa)
abB (by BbB)
abb (by Bb)
Case-3: Case-4:
SAB SAB
aAB (AaA) aAB (by AaA)
aAb (Bb) aAbB (by BbB)
aab (Aa) aabB (by Aa)
aabb (by Bb)