0% found this document useful (0 votes)
28 views28 pages

Lesson 14

Uploaded by

meeramjung1998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views28 pages

Lesson 14

Uploaded by

meeramjung1998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 28

RECAP Lecture 13

 Examples of Kleene’s theorem part III


(method 1) continued ,Kleene’s theorem part III
(method 2: Concatenation of FAs),
 Example of Kleene’s theorem part III
(method 2 : Concatenation of FAs)

1
Task

 Build an FA equivalent to the following FA

Z2
a a b
a
b
Z1- a b Z4 + Z5 +
b a

Z3+ b

2
Solution of the Task

Z2
a
a a

Z1- a b Z4 +
b b

Z3+ b

3
Task

Build an FA corresponding to the union of


these two FAs i.e. FA1 U FA2 where a,b

FA1 x2 b x3 +
x1 - a,b
a

x4 a,b

b a b
FA2 y1 - y2+
a
4
Task solution

• RE corresponding to FA1 may be


(a+b)b(a+b)* which generates the
language of strings, defined over
Σ={a,b}, with b as second letter.
• RE corresponding to FA2 may be
b*a(b+ab*a)* which generates the
language of strings, defined over
Σ={a,b}, with odd number of a’s.
5
Solution continued …
a,b

x2 b x3 +
x1 - a,b
a
b a b
x4 a,b
y1 - y2+
a

New States after reading


Old States
a b
6
z -(x ,y ) (x ,y ) z (x ,y )  z
Solution continued …

New States after reading


Old States
a b

z2+(x2 , y2) (x4,y1)z4 (x3,y2) z5


z3 (x2,y1) (x4,y2)z6 (x3,y1) z7
z4(x4,y1) (x4,y2) z6 (x4,y1) z4
z5+(x3,y2) (x3,y1) z7 (x3,y2) z5
z7+(x3,y1) (x3,y2)z5 (x3,y1) z7 7
z6+(x4,y2) (x4,y1) z4 (x4,y2) z6
Solution continued …

z1
z4 b z 5+ b
a
a b

z 2+
a a a a
b

b z 6+ a z3 b z 7+ b 8
Example

Let r1=((a+b)(a+b))* and the


corresponding FA1 be
a,b
x1± x2
a,b

also r2 = (a+b)((a+b)(a+b))* or
*
((a+b)(a+b)) (a+b)
a,b
and FA2 be
y1- y2+
9

a,b
Example continued …
a,b
x1± x2
a,b

a,b

y1- y2+
a,b

New States after reading


Old States
a b
10
z -(x ,y ) (x ,y ) z (x ,y )  z
Example continued …

New States after


Old States reading
a b

z2+(x2,y2) (x1,y1) z1 (x1,y1)  z1

11
Example continued …

a,b

y1- y2+
a,b

12
Task

Build FA corresponding to the concatenation of


these two FAs i.e. FA1FA2 where a,b

FA1 x2 b x3 +
x1 - a,b
a

x4 a,b

b a b
FA2 y1 - y2+
a
13
Kleene’s Theorem Part III
Continued …
• Method3: (Closure of an FA)
Building an FA corresponding to r*, using
the FA corresponding to r.
It is to be noted that if the given FA
already accepts the language expressed
by the closure of certain RE, then the
given FA is the required FA. However the
method, in other cases, can be developed
considering the following examples 14
Closure of FA Continued …

Closure of an FA, is same as


concatenation of an FA with itself,
except that the initial state of the
required FA is a final state as well.
Here the initial state of given FA,
corresponds to the initial state of
required FA and a non final state of
the required FA as well.
15
Example

Let r=(a+b)*b and the corresponding


FA be
a b b

X1 – X2 +

a
then the FA corresponding to r* may
be determined as under
16
Example continued …
a b b a b b

X1 – X2 + X1 – X2 +

a a

New States after reading


Old States
a b

Final z1 ±x1 x1z2 (x2,x1) z3 17


Example continued …
New States after reading
Old States
a b

Non-final z2x1 x1z2 (x2,x1)z3


z3+(x2,x1) x1z2 (x2,x1)z3
The corresponding transition diagram may
be as under

18
Example continued …

z 1±

b a

b a

z 3+ z2 a

b 19
Example

Let r=(a+b)*aa(a+b)* and the


corresponding FA be
b a,b
a
y2 a
y1- y3+
b

20
Example continued …
b a,b
a
y2 a
y1- y3+
b
b a,b
a
y2 a
y1- y3+
b
New States after reading
Old States
a b

Final z1±y1 y2z3 y1 z2 21


Example continued …
Old States New States after reading

a b
z2y1 y2z3 y1 z2

z3y2 (y3,y1)z4 y1 z2

z4+(y3,y1) (y3 ,y1,y2) z5 (y3,y1) z4

z5+ (y3,y1,y2) (y3,y1 ,y2)z5 (y3,y1) z4


22
Example continued …

a
b
a a a
z 1± z3 z 4+ z 5+
a b
b
b
z2
b

23
Example

Consider the following FA, accepting


the language of strings with b as
a,b
second letter
y2 b y3 +
y1 - a,b
a

y4 a,b

24
Example continued …
a,b

y2 b y3 +
y1 - a,b
a

y4 a,b

New States after reading


Old States
a b
z1±y1 y2z2 y2 z2
25
Example continued ...
New States after reading
Old States
a b
z2y2 y4z3 (y3,y1) z4
z3y4 y4z3 y4z3
z4+(y3,y1) (y3 ,y1 ,y2) z5 (y3 ,y1 ,y2) z5
z5+(y3,y1,y2) (y3,y1 ,y2 ,y4) z6 (y3,y1,y2) z5
z6(y1,y1 ,y2 ,y4) (y1,y1 ,y2 ,y4)z6 (y1,y1 ,y2 ,y4)z6
26
Example continued ...
a,b

z2 a z3
z1± a,b
b

z 4+ a,b
z 5+ b

z 6+ a,b

27
Summing Up

• Examples of Kleene’s theorem part III


(method 1) continued ,Kleene’s theorem
part III (method 2: Concatenation of FAs),
Examples of Kleene’s theorem part
III(method 2:concatenation FAs)
continued, Kleene’s theorem part III
(method 3:closure of an FA), examples of
Kleene’s theorem part III(method
3:Closure of an FA) continued
28

You might also like