Formal Methods in Computer Science CS1502 Equivalence of NFAs and DFAs PowerPoint PPT Presentation

presentation player overlay
1 / 15
About This Presentation
Transcript and Presenter's Notes

Title: Formal Methods in Computer Science CS1502 Equivalence of NFAs and DFAs


1
Formal Methods in Computer ScienceCS1502Equivale
nce of NFAs and DFAs
  • Patchrawat Uthaisombut
  • University of Pittsburgh

2
Goals
  • Equivalence of NFAs and DFAs
  • Closure properties of regular languages.
  • General idea of closure property
  • Closure of regular languages under regular
    operations.

3
?? and P(Q)
  • ?? ? ? ?
  • If ? a, b
  • Then ?? a, b, ?
  • P(Q) power set of Q
  • If Q A,B,C
  • Then P(Q) , A, B, C, A,B, A,C,
    B,C, A,B,C
  • Note, if Q has n members, then P(Q) has 2n
    members.

4
Definition of DFA
  • A (Deterministic) Finite Automaton(FA, DFA) is a
    5-tuple (Q,?,?,q0,F) where
  • Q is a finite set of states
  • ? is a finite alphabet
  • ?Q???Q is the transition function
  • q0?Q is the start state
  • F?Q is the set of accept states

5
Definition of NFA
  • A Nondeterministic Finite Automaton (NFA) is a
    5-tuple (Q,?,?,q0,F) where
  • Q is a finite set of states
  • ? is a finite alphabet
  • ?Q????P(Q) is the transition function
  • q0?Q is the start state
  • F?Q is the set of accept states

6
  • M (Q,?,?,q1,F) where
  • Q q1,q2,q3,q4,q5
  • ? 0, 1
  • ? is given as the table
  • q1 is the start state
  • F q3, q5 .

?Q????P(Q)
7
0,1
p
1, ?
0
p
q
r
0100
8
DFAs vs. NFAs
  • Are DFAs more powerful than NFAs?
  • Is there a language L that is recognized by some
    DFA but is not recognized by any NFA?
  • No. DFAs are special cases of NFAs.
  • Are NFAs more powerful than DFAs?
  • Unclear.
  • We will show that they are not.

9
0,1
p
1, ?
0
p
q
r
0100
10
E(R)
  • E(R) q q can be reached from R by traveling
    along zero or more ? transitions
  • E( q1 ) ?
  • q1, q2, q3, q4
  • E( q2, q4 ) ?
  • q2, q3, q4

11
Equivalence of NFAs and DFAs
  • Let N(Q,?,?,q0,F) be an NFA
  • Construct a DFA M(Q,?,?, q0,F) as follows
  • Q P(Q)
  • for R?Q and a??,let ?(R,a) q ? Q q ?
    E(?(r,a)) for some r ? R .
  • q0 E( q0 )
  • F R?Q R contains an accept state of N
  • We claim that L(M) L(N).

12
Implications
  • Are NFAs more powerful than DFAs?
  • Is there a language L that is recognized by some
    NFA but is not recognized by any DFA?
  • We can use NFAs to study the question
  • If A and B are regular, is A . B regular?

13
Union revisit
  • If A and B are regular, is A ? B regular?
  • Yes. We proved that by simulating 2 machines in
    parallel.
  • A new proof
  • Make use of the equivalence of DFAs and NFAs.

14
Closure property
  • A set X and an operation y.
  • X is said to be closed under y if when we apply
    operation y to any member of X, the result is
    still a member of X.
  • Examples
  • The set of integers is closed under addition
  • The set of integers is not closed under division
  • The set of regular languages is closed under
    union.
  • Take any union of two regular languages and the
    result is still a regular language.

15
Closure under regular operations
  • The class of regular languages is closed under
    union.
  • The class of regular languages is closed under
    concatenation.
  • The class of regular languages is closed under
    star.
  • Proofs
Write a Comment
User Comments (0)
About PowerShow.com