Collapsing Nondeterministic Automata Ashutosh Bhatia Nitin Rai Sep - - PowerPoint PPT Presentation

collapsing nondeterministic automata ashutosh bhatia
SMART_READER_LITE
LIVE PREVIEW

Collapsing Nondeterministic Automata Ashutosh Bhatia Nitin Rai Sep - - PowerPoint PPT Presentation

Collapsing Nondeterministic Automata Ashutosh Bhatia Nitin Rai Sep 12, 2005 FACTS of NFA and DFA A nondeterministic finite automaton (NFA) may be smaller than a DFA by an exponential factor [Meyer and Fischer, 1971]. The minimal DFA is


slide-1
SLIDE 1

Collapsing Nondeterministic Automata Ashutosh Bhatia Nitin Rai Sep 12, 2005

slide-2
SLIDE 2

FACTS of NFA and DFA A nondeterministic finite automaton (NFA) may be smaller than a DFA by an exponential factor [Meyer and Fischer, 1971].

  • The minimal DFA is unique upto isomorphism
  • A state minimal complete DFA is a transition minimal complete DFA, and

vice versa. This does not hold for NFA

  • NFA is most compact if there are no equivalent states. But at the end, it does

not mean state minimization, because there are NFA accepting the same language by a smaller number of states.

slide-3
SLIDE 3

Nondeterminism and Minimality

0,1 0,1 1 0,1

 There may not be a unique minimal NFA for a regular language.

All are reduced with same number of states but not unique. NFAs defining the same language ∑*0 ∑*

slide-4
SLIDE 4

Nondeterminism and Minimality (Contd..)

 4 NFAs accepting the language ending with “a”

slide-5
SLIDE 5

Why not unique minimal NFA ?

 IN DFA, pair of states p and q can be collapse if they have equivalent

relation between them. p ≈ q ⇔ ∀x ∈ ∑* ( δˆ(p,x) ∈ F ⇔ δˆ(q,x) ∈ F ) if p ≈ q ⇔ δ(p,a) ≈ δ(q,a) ( Can be proved by induction)

 But in NFA, two states p and q may be equivalent even though

there are no equivalent state in ∆(p,a) and ∆(q,a).

slide-6
SLIDE 6

Cont.. F A C B G D E

0,1 1

 Need stronger concept than state equivalence like state bisimilarity,

bisimulation, Auto bisimulation.

  • A and B looks like a equivalent as we

can’t find any common distinguishable string. ∆(A,00) and ∆(A,01) ∈ F ∆(B,00) and ∆(B,01) ∈ F but they are not equivalent states because no two of C, D and E are equivalent. What can be said about A and B ?

slide-7
SLIDE 7

STATE BISIMILARITY

  • Two states p and q of NFA M are bisimilar p ≈ q, iff

the following conditions are satisfied. 1. For all a ∈ ∑ and all p’ ∈ ∆(p,a) there exist a state q’ ∈ ∆ (q,a) such that p’ ≈ q’. 3. For all a ∈ ∑ and all q’ ∈ ∆(q,a) there exist a state p’ ∈ ∆ (p,a) such that p’ ≈ q’. In the automaton, we have A ≈ B but B ≈ G

slide-8
SLIDE 8

BISIMULATION

Let M, N be two NFA’s.

Let ≈ be a binary relation relating states of M with states of N that is ⊆ QM x QN.

B ⊆ QN define C ≈(B) = {p∈ QM | ∃q ∈ B p ≈ q}

A ⊆ QM define C ≈(A) = {q∈ QN | ∃p ∈ A p ≈ q}.

The ≈ can be extended in natural way for A ⊆ QM B ⊆ QN

A ≈ B ⇔ A ⊆ C ≈(B) and B ⊆ C ≈(A)

⇔ ∀p ∈ A ∃q ∈ B p ≈ q and ∀q ∈ B ∃p ∈ A p ≈ q.

slide-9
SLIDE 9

M A N B C ≈(B) C ≈(A) M A N B C ≈(B) C ≈(A) A ≈ B A Not ≈ B ≈ Over Sets A ⊆ QM B ⊆ QN C ≈(A) Every element of A should be related to at least one element of B and vice versa

slide-10
SLIDE 10

BISIMULATION ( Contd..)

The relation (≈) is called a bisimulation if the following three condition are met:

 SM ≈ SN  If p ≈ q, then for all a ∈ ∑, ∆M(p,a) ≈ ∆N(q,a); and  If p ≈ q, then p ∈ FM, iff q ∈ FN.

M and N are bisimilar if there exist a bisimulation between them.

The bisimilarity class of M is the family of all NFAs that are bisimilar to M.

Bisimilar class contains a unique minimal NFA

slide-11
SLIDE 11

BISIMULATION Properties

1. Bisimulation is symmetric: if ≈ is a bisimulation between M and N then its reverse { (q,p) | p ≈ q ) is a bisimulation between N and M. 3. Bisimulation is Transitive: if ≈1 is a bisimualtion between M and N and ≈2 is a bisimualtion between N and P, then their composition ≈1 o ≈2 = { (p,r) | ∃q p ≈1 q and q ≈2 r } is a bisimulation between M and P. 5. The union of any nonempty family of bisimulations between M and N is a bisimulation between M and N. 7. Bisimilar automaton accepts the same set (Proof)

slide-12
SLIDE 12

BISIMULATION of NFA’s P Q

0,1

S1 B D

1 0,1

F S2

1 0,1

Accept the Language ends with a “0”.

X

0,1

Z Y Q

1

P Q

0,1

slide-13
SLIDE 13

AUTOBISIMULATION

An autobisimulation is bisimulation between an automaton and itself.

Any nondeterministic automaton M has coarsest autobisimulation ≡M and relation ≡M is an equivalence relation. Proof :

4.

Let B be the set of all autobisimulation on M

5.

B is Non empty since it contains identity relation

6.

Let ≡M be the union of all relation in B

7.

By definition of bisimulation ≡M in B (Why)

8.

The relation ≡M is reflexive , since it contains identity element and symmetric and transitive by definition of bisimulation. The ≡M is an equivalence relation

9.

The ≡M is called maximal autobisimulation ((Why)

slide-14
SLIDE 14

IF A ≈ B => ∆M(A,x) ≈ ∆N(B,x)

Let ≈ be a bisimulation between M and N . If A ≈ B , then for all x ∈ ∑* , ∆M(A,x) ≈ ∆N(B,x)

Proof:

  • 3. For x = ε it is trivial
  • 4. For x = a , if p ∈ A there exists q ∈ B s.t p ≈ q (Why)
  • 5. ∆M(p,a) ⊆ C ≈(∆N(q,a))
  • 6. ∪p ∈ A ∆M(p,a) ⊆ ∪ q ∈ B C ≈(∆N(q,a))
  • 7. ∆M(A,a) ⊆ C ≈(∆N(B,a))
slide-15
SLIDE 15

Cont…….

  • 5. ∆M(A,a) ≈ ∆N(B,a)
  • 6. By induction. Suppose that ∆M(A,x) ≈ ∆N(B,x)
  • 7. ∆M(A,xa) = ∆M ( ∆M(A,x) , a)

≈ ∆N (∆N(B,x) , a) ) ≈ ∆N(B,xa)

slide-16
SLIDE 16

Bisimilar Automata accepts the same Language

  • 1. Let ≈ is Bisimulation between M and N

2. For any x ∈ ∑* , ∆M(SM,x) ≈ ∆N(SN,x)

  • 3. By Definition of Bisimulation

∆M(SM,x) ∩ F M ≠ φ ⇔ ∆N(SN,x) ∩ FN ≠ φ

4. x ∈ L(M) ⇔ x ∈ L(N)

L(M) = L(N)

slide-17
SLIDE 17

Quotient automaton M’ (collapsing of states) Let M = (Q, ∑, ∆ , S ,F) be a NFA

Let ≡M be the maximal autobisimulation on M

For p ∈ Q define [p] denote the equivalence class of p Define A’ = { [p] | p ∈ A }

Now M’ be defined the quotient automation M’ = (Q’, ∑, ∆’ , S’ ,F’) Where Q’ , S’ and F’ refer to above definition and

∆’ ([p],a) defined as ∆(p,a) ‘ The quotient automaton is the minimal automaton bisimilar to M and is unique up to isomorphism

slide-18
SLIDE 18

An Algorithm for computing Maximum bisumlation

Write down a table of all pairs, initially unmarked.

Mark pair (p,q) if p ∈ FM and p ∉ FN or vice versa.

Repeat the following until no more changes occur: if (p,q) is unmarked, and if for some a ∈ ∑, either

 There exists p’ ∈ ∆M(p,a) such that for all q’ ∈ ∆N(q,a), (p’,q’)

is marked, or

 There exists q’ ∈ ∆N(q,a) such that for all p’ ∈ ∆M(p,a), (p’,q’)

is marked, then mark (p,q).

Define p ≡ q iff (p,q) is never marked. Check whether SM ≡ SN. If so, then ≡ is the maximal bisimulation between M and N.

slide-19
SLIDE 19

X

0,1

Z Y

0,1

Z Y X Z Y X

M x M = {(X,X) , (X,Y) , (X,Z) , (Y,X) , (Y,Y) , (Y,Z) , (Z,X) , (Z,Y) , (Z,Z)} ≈ { (X,X) , (Y,Y), (Z,Z) , (Y,Z) } ≈ is a Bisimulation b.z X ≈ X (Initial states), Y ≈ Z final states And since it is reflexive it ≈ is Autobisimulation

X

0,1

Y

Example 1

slide-20
SLIDE 20

S1 B D

1 0,1

F S2

1 0,1

D D F B S2 S1 F B S2 S1

All Four S1 , S2 , B , D are Equivalent

S

0,1

F

Example 2

slide-21
SLIDE 21

P Q

0,1

Z X

0,1

Y

1

P Q Z Y X

(X,0) -> {X,Z) and (Q,0) -> {Q,P} Don’t Mark (X,1) -> {X,Y) and (Q,1) -> {Q} Don’t Mark (Y,0) -> {X) and (Q,0) -> {Q,P} Mark Y and Q 1 1 Since Initial sates are not equivalent M and N are not Bisimilar Two NFAs accepting same language may not be bisimilar

slide-22
SLIDE 22

Conclusion

1. Bisimulation doesn’t mean state minimization 2. The Algorithm presented only calculates the maximal autobisimulation/bisimulation among the bisimulation class if it exists 3. The Algorithm doesn’t include the inaccessible states 4. The quotient automaton is unique under isomorphism but only under bisimulation classand it is minimal