Collapsing Nondeterministic Automata Ashutosh Bhatia Nitin Rai Sep - - PowerPoint PPT Presentation
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
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.
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 ∑*
Nondeterminism and Minimality (Contd..)
4 NFAs accepting the language ending with “a”
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).
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 ?
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
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.
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
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
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)
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
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)
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))
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)
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)
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
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).