Docsity

Equivalent States and Minimization in Deterministic Finite Automata (DFA), Slides of Computer Science

Partial preview of the text

Download Equivalent States and Minimization in Deterministic Finite Automata (DFA) and more Slides Computer Science in PDF only on Docsity!

1

Minimization;

Pumping Lemma.

2

Equivalent States.

Example

Consider the accept states c and g. They are both sinks

meaning that any string which ever reaches them is

guaranteed to be accepted later.

Q: Do we need both states?

a

b

d

e

c

f g

4

Equivalent States.

Example

A: Yes, b and f. Notice that if you‟re in b or f then:

1. if string ends, reject in both cases

2. if next character is 0, forever accept in both cases

3. if next character is 1, forever reject in both cases

So unify b with f.

a

b

d

e

cg

f

5

Equivalent States.

Example

Intuitively two states are equivalent if all

subsequent behavior from those states is

the same.

Q: Come up with a formal characterization of

state equivalence.

a

d

e

cg

bf

7

Finishing the Example

Q: Any other ways to simplify the

automaton?

a

d

e

cg

bf

8

Useless States

A: Get rid of d.

Getting rid of unreachable useless

states doesn‟t affect the accepted

language.

a

e

cg

bf

10

The Game of MINIMIZE

  1. All useless players are disqualified.
  2. Game proceeds in rounds.
  3. Start with 2 teams: ACCEPT vs. REJECT.
  4. Each round consists of sub-rounds – one

sub-round per team.

  1. Two members of a team are said to agree

if for a given label, they want to pass the

buck to same team. Otherwise, disagree.

  1. During a sub-round, disagreeing members

split off into new maximally agreeing teams.

  1. If a round passes with no splits, STOP.

11

The Game of MINIMIZE

a

b

d

e

c

f g

13

Minimization Algorithm.

(Partition Refinement) Code

DFA defineMinimizor

(DFA (Q, S, d, q 0

, F ), Partition P )

Set Q‟ =P

State q‟ 0

= the set in P which contains q 0

F‟ = { S  P | S  F }

for (each S  P, a  S)

define d ‟ (S,a) = the set T  P which contains

the states d ‟(S,a)

return ( Q‟, S, d ‟, q‟

0

, F‟ )

14

Minimization Example

Start with a DFA

16

Minimization Example

Split into two teams.

ACCEPT

vs.

REJECT

17

Minimization Example

0-label doesn‟t split

up any teams

19

Minimization Example

No further splits. HALT!

Start team

contains

original

start

20

Minimization Example.

End Result

States of the minimal automata are

remaining teams. Edges are

consolidated across each team. Accept

states are break-offs from

original ACCEPT team.