21
Simulating 2 FSA’s with 1 FSA

Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Simulating 2 FSA’s with 1 FSA

Page 2: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Purpose

• This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as output an FSA which “simulates” both input FSA’s on any input string

• Algorithm Specification

– Input: FSA’s M1 and M2

– Output: FSA M3

Page 3: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

The two input FSA’s

a

b

b b

a

a

a,b

aa

b

b

a,b

I

III

II

A

B

C

D

M1 M2

Page 4: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Initializationa

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A

The initial state of the output FSA M3 is the ordered pair of the initial states of M1 and M2.

I

III

II

A

B

C

D

Page 5: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State I,Aa

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,B

I

III

II

A

B

C

D

Page 6: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Add New Statesa

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,CII,B

I

III

II

A

B

C

D

Page 7: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State I,Ca

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B

I

III

II

A

B

C

D

Page 8: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Add New Statesa

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,BI,BII,D

I

III

II

A

B

C

D

Page 9: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State II,Ba

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,BII,D

I

III

II

A

B

C

D

Page 10: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Add One New Statea

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,BII,DIII,B

I

III

II

A

B

C

D

Page 11: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State I,Ba

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,DIII,B

I

III

II

A

B

C

D

Page 12: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

No New States Addeda

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,DIII,B

I

III

II

A

B

C

D

Page 13: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State II,Da

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B

I

III

II

A

B

C

D

Page 14: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Add One New Statea

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,BIII,D

I

III

II

A

B

C

D

Page 15: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State III,Ba

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D

I

III

II

A

B

C

D

Page 16: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

No New States Addeda

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D

I

III

II

A

B

C

D

Page 17: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State III,Da

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D III,D I,D

I

III

II

A

B

C

D

Page 18: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Add 1 New Statea

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D III,D I,DI,D

I

III

II

A

B

C

D

Page 19: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Expand State I,Da

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D III,D I,DI,D I,D II,D

I

III

II

A

B

C

D

Page 20: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

No More New Statesa

b

b b

a

a

a,b

aa

b

b

a,b

a bI,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D III,D I,DI,D I,D II,D

I

III

II

A

B

C

D

Page 21: Simulating 2 FSA’s with 1 FSA. Purpose This presentation presents an example execution of the algorithm which takes as input two FSA’s and produces as

Determining Accepting Statesa b

I,A I,C II,BI,C I,B II,DII,B II,B III,BI,B I,B II,BII,D II,D III,DIII,B III,B I,BIII,D III,D I,DI,D I,D II,D

a

b

b b

a

aI

III

II

a,b

aa

b

b

a,b

A

B

C

D

Set IntersectionBoth input machines should accept in order for new machine to acceptThe one accepting state of the new machine M3 is I,D

Set UnionIf either input machine accepts, new machine should acceptThe six accepting states of the new machine M3 are I,A; I,C; I,B; II,D; III,D; I,D

Set Difference: M1 should accept but M2 should notThe three accepting states of the new machine M3 are I,A; I,C; I,B

Symmetric Difference: M1 should accept but M2 should not or M2 should accept but M1 should notThe five accepting states of the new machine M3 are I,A; I,C; I,B; II,D; III,D