SlideShare a Scribd company logo
1 of 84
Download to read offline
1
Ms. Bushra Abdullah Al-Anesi
Compiler Construction
Alfred V. Aho, , "Compilers", Addison Wesley Publishing Company; 2 edition (2007).
Lexical Analysis
Chapter 3
1/23/2019
2
CPCS 302 ch3
Conversion of NFA to DFA
❑ Subset construction algorithm
▪ Input: An NFA N
▪ Output: A DFA D accepting the same language as N
▪ Algorithm: construct a transition table Dtran corresponding to D
3
CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
2/9/2019 4
CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
2/9/2019 4
CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
o ε - closure(0) = { 0, 1, 2, 4, 7}
2/9/2019 4
CPCS 302 ch3
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
1. Compute ε - closure (0), which are all states reachable from 0 on
ε -transitions (including 0 itself)
o ε - closure(0) = { 0, 1, 2, 4, 7}
• Add to Dtrans table
2/9/2019 4
NFA State a b
{0,1, 2, 4, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
{3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
o Add set to Dtrans table:
• for symbol a
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, a) =
o Add set to Dtrans table:
• for symbol a
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7}
ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
{5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is
the states reachable on x-transitions (possibly preceded with ε -transitions)
followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions
o move ({0, 1, 2, 4, 7}, b) =
o Add set to Dtrans table
• for symbol
• As new state if not already there
ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 3, 4, 6, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a))
o move ({1, 2, 3, 4, 6, 7, 8}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b))
o move ({1, 2, 3, 4, 6, 7, 8}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
{ 1, 2, 4, 5, 6, 7}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) =
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) =
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a))
o move ({ 1, 2, 4, 5, 6, 7}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
{3, 8}
ε - closure for symbol
a need not be
computed ➔ all have
same set of states
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) ={5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) ={5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b))
o move ({ 1, 2, 4, 5, 6, 7}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8}
{1, 2, 4, 5, 6, 7, 9}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a))
o move ({ 1, 2, 4, 5, 6, 7, 9}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = {3, 6, 1,2, 4, 7, 8}{3, 8 }
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) ={5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) ={5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) = { 5, 6, 7, 1, 2, 4, 10 }{5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b))
o move ({ 1, 2, 4, 5, 6, 7, 9}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5, 10}) = { 5, 6, 7, 1, 2, 4, 10 }{5, 10}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) ={3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a))
o move ({ 1, 2, 4, 5, 6, 7, 10}, a) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({3, 8}) = {3, 6, 1, 2, 4, 7, 8 }{3, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
{5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5}) ={5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5}) = { 5, 6, 7, 1, 2, 4 }{5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
Conversion of NFA to DFA
❑ Compute a sequence of ε – closures and moves:
11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b))
o move ({ 1, 2, 4, 5, 6, 7, 10}, b) =
o Add set to Dtrans table:
• for symbol
• As new state if not already there
ε -closure ({5}) = { 5, 6, 7, 1, 2, 4 }{5}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
E
A
a B
C
b
a
D
b
a
b
a
b
a
b
Start
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
DFA
Conversion of NFA to DFA
❑ Construct the DFA transition graph using the Dtrans table:
❑ For each NFA state in the table, create a new DFA state symbol:
NFA State a b
{0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
{ 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
{1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10}
{1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
DFA State NFA State a b
A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 9} =
D
C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} =
B
{1, 2, 4, 5, 6, 7, 10} =
E
E {1, 2, 4, 5, 6, 7,
10}
{1, 2, 3, 4, 6, 7, 8} =
B
{ 1, 2, 4, 5, 6, 7} = C
E
A
a B
C
b
a
D
b
a
b
a
b
a
b
Start
❑ Construct the
graph based on
table data:
*DFA state with NFA
final state is a DFA final
state ➔ E
DFA NFA
CPCS 302 ch3
Conversion of NFA to DFA
❑ Subset construction algorithm
▪ Input: An NFA N
▪ Output: A DFA D accepting the same language as N
▪ Algorithm: construct a transition table Dtran corresponding to D
2/9/2019 16

More Related Content

What's hot

Modern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsModern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsAmr E. Mohamed
 
Introduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysisIntroduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysis宗翰 謝
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Amr E. Mohamed
 
Discrete state space model 9th &10th lecture
Discrete  state space model   9th  &10th  lectureDiscrete  state space model   9th  &10th  lecture
Discrete state space model 9th &10th lectureKhalaf Gaeid Alshammery
 
Design of sampled data control systems part 2. 6th lecture
Design of sampled data control systems part 2.  6th lectureDesign of sampled data control systems part 2.  6th lecture
Design of sampled data control systems part 2. 6th lectureKhalaf Gaeid Alshammery
 
Computer Science Programming Assignment Help
Computer Science Programming Assignment HelpComputer Science Programming Assignment Help
Computer Science Programming Assignment HelpProgramming Homework Help
 
Datastage real time scenario
Datastage real time scenarioDatastage real time scenario
Datastage real time scenarioNaresh Bala
 

What's hot (20)

Digitalcontrolsystems
DigitalcontrolsystemsDigitalcontrolsystems
Digitalcontrolsystems
 
Lec2
Lec2Lec2
Lec2
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
 
Signals and Systems Assignment Help
Signals and Systems Assignment HelpSignals and Systems Assignment Help
Signals and Systems Assignment Help
 
Lec9
Lec9Lec9
Lec9
 
Modern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsModern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI Systems
 
Simpler java
Simpler javaSimpler java
Simpler java
 
Operating System Engineering
Operating System EngineeringOperating System Engineering
Operating System Engineering
 
Lec5
Lec5Lec5
Lec5
 
Lecture 23 loop transfer function
Lecture 23 loop transfer functionLecture 23 loop transfer function
Lecture 23 loop transfer function
 
Introduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysisIntroduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysis
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
 
Lec10
Lec10Lec10
Lec10
 
Lec10
Lec10Lec10
Lec10
 
Discrete state space model 9th &10th lecture
Discrete  state space model   9th  &10th  lectureDiscrete  state space model   9th  &10th  lecture
Discrete state space model 9th &10th lecture
 
Design of sampled data control systems part 2. 6th lecture
Design of sampled data control systems part 2.  6th lectureDesign of sampled data control systems part 2.  6th lecture
Design of sampled data control systems part 2. 6th lecture
 
Computer Science Programming Assignment Help
Computer Science Programming Assignment HelpComputer Science Programming Assignment Help
Computer Science Programming Assignment Help
 
Computational Assignment Help
Computational Assignment HelpComputational Assignment Help
Computational Assignment Help
 
Lec23
Lec23Lec23
Lec23
 
Datastage real time scenario
Datastage real time scenarioDatastage real time scenario
Datastage real time scenario
 

Similar to Ch03 lexical analysis nfa_2_dfa_2019

4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...venkatapranaykumarGa
 
Lecture 03 lexical analysis
Lecture 03 lexical analysisLecture 03 lexical analysis
Lecture 03 lexical analysisIffat Anjum
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsRushabh2428
 
aho corasick paper study note
 aho corasick paper study note aho corasick paper study note
aho corasick paper study noteYi-Jun Zheng
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysisDattatray Gandhmal
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfSergioUlisesRojasAla
 
Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monadskenbot
 
Lecture 17- F19.pdf
Lecture 17- F19.pdfLecture 17- F19.pdf
Lecture 17- F19.pdfAbrar11535
 
Principles of Compiler Design
Principles of Compiler DesignPrinciples of Compiler Design
Principles of Compiler DesignBabu Pushkaran
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First SearchKevin Jadiya
 
Topological sort
Topological sortTopological sort
Topological sortjabishah
 

Similar to Ch03 lexical analysis nfa_2_dfa_2019 (20)

4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
 
Lecture 03 lexical analysis
Lecture 03 lexical analysisLecture 03 lexical analysis
Lecture 03 lexical analysis
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
 
Lifting 1
Lifting 1Lifting 1
Lifting 1
 
aho corasick paper study note
 aho corasick paper study note aho corasick paper study note
aho corasick paper study note
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
 
Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monads
 
Lec1.pptx
Lec1.pptxLec1.pptx
Lec1.pptx
 
Lecture 17- F19.pdf
Lecture 17- F19.pdfLecture 17- F19.pdf
Lecture 17- F19.pdf
 
Ch3.ppt
Ch3.pptCh3.ppt
Ch3.ppt
 
Compiler Design Material 2
Compiler Design Material 2Compiler Design Material 2
Compiler Design Material 2
 
Pcd(Mca)
Pcd(Mca)Pcd(Mca)
Pcd(Mca)
 
PCD ?s(MCA)
PCD ?s(MCA)PCD ?s(MCA)
PCD ?s(MCA)
 
Principles of Compiler Design
Principles of Compiler DesignPrinciples of Compiler Design
Principles of Compiler Design
 
Pcd(Mca)
Pcd(Mca)Pcd(Mca)
Pcd(Mca)
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
Topological sort
Topological sortTopological sort
Topological sort
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Ch03 lexical analysis nfa_2_dfa_2019

  • 1. 1 Ms. Bushra Abdullah Al-Anesi Compiler Construction Alfred V. Aho, , "Compilers", Addison Wesley Publishing Company; 2 edition (2007).
  • 3. CPCS 302 ch3 Conversion of NFA to DFA ❑ Subset construction algorithm ▪ Input: An NFA N ▪ Output: A DFA D accepting the same language as N ▪ Algorithm: construct a transition table Dtran corresponding to D 3
  • 4. CPCS 302 ch3 Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 1. Compute ε - closure (0), which are all states reachable from 0 on ε -transitions (including 0 itself) 2/9/2019 4
  • 5. CPCS 302 ch3 Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 1. Compute ε - closure (0), which are all states reachable from 0 on ε -transitions (including 0 itself) 2/9/2019 4
  • 6. CPCS 302 ch3 Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 1. Compute ε - closure (0), which are all states reachable from 0 on ε -transitions (including 0 itself) o ε - closure(0) = { 0, 1, 2, 4, 7} 2/9/2019 4
  • 7. CPCS 302 ch3 Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 1. Compute ε - closure (0), which are all states reachable from 0 on ε -transitions (including 0 itself) o ε - closure(0) = { 0, 1, 2, 4, 7} • Add to Dtrans table 2/9/2019 4 NFA State a b {0,1, 2, 4, 7}
  • 8. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7}
  • 9. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7}
  • 10. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7} {3, 8}
  • 11. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7} ε -closure ({3, 8}) ={3, 8}
  • 12. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7} ε -closure ({3, 8}) ={3, 8}
  • 13. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = NFA State a b {0,1, 2, 4, 7} ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
  • 14. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = o Add set to Dtrans table: • for symbol a • As new state if not already there NFA State a b {0,1, 2, 4, 7} ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8}
  • 15. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 2. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, a)) avoiding repetitions o move ({0, 1, 2, 4, 7}, a) = o Add set to Dtrans table: • for symbol a • As new state if not already there NFA State a b {0,1, 2, 4, 7} ε -closure ({3, 8}) ={3, 8} {3, 6, 1, 2, 4, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 16. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 17. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 18. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there {5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 19. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there ε -closure ({5}) ={5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 20. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there ε -closure ({5}) ={5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 21. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8}
  • 22. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 3. Compute for each input symbol x move({0, 1, 2, 4, 7}, x), which is the states reachable on x-transitions (possibly preceded with ε -transitions) followed by ε – closures (move ({0, 1, 2, 4, 7}, b)) avoiding repetitions o move ({0, 1, 2, 4, 7}, b) = o Add set to Dtrans table • for symbol • As new state if not already there ε -closure ({5}) ={5} {5, 6, 1, 2, 4, 7} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 23. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 24. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 25. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there {3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 26. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 27. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 28. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 29. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 4. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, a)) o move ({1, 2, 3, 4, 6, 7, 8}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} { 3, 6, 1, 2, 4, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 30. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 31. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 32. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there {5, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 33. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 9}) ={5, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 34. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 9}) ={5, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 35. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 36. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 5. Compute ε – closures (move ({1, 2, 3, 4, 6, 7, 8}, b)) o move ({1, 2, 3, 4, 6, 7, 8}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 9}) ={5, 9} {5, 6, 7, 1, 2, 4, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9}
  • 37. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9}
  • 38. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9}
  • 39. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8}
  • 40. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8}
  • 41. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8}
  • 42. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8}
  • 43. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 44. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 6. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, a)) o move ({ 1, 2, 4, 5, 6, 7}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = { 3, 6, 1, 2, 4, 7, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {3, 8} ε - closure for symbol a need not be computed ➔ all have same set of states NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 45. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 46. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 47. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there {5 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 48. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5 }) ={5 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 49. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5 }) ={5 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 50. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9}
  • 51. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 7. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7}, b)) o move ({ 1, 2, 4, 5, 6, 7}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5 }) = { 5, 6, 7, 1, 2, 4 }{5 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9}
  • 52. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 53. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 54. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 55. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there {3, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 56. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 57. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 58. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 8. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, a)) o move ({ 1, 2, 4, 5, 6, 7, 9}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = {3, 6, 1,2, 4, 7, 8}{3, 8 } NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 59. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 60. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 61. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there {5, 10} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 62. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 10}) ={5, 10} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 63. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 10}) ={5, 10} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 64. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 10}) = { 5, 6, 7, 1, 2, 4, 10 }{5, 10} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8}
  • 65. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 9. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 9}, b)) o move ({ 1, 2, 4, 5, 6, 7, 9}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5, 10}) = { 5, 6, 7, 1, 2, 4, 10 }{5, 10} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10}
  • 66. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 67. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 68. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there {3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 69. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 70. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) ={3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 71. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 10. Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, a)) o move ({ 1, 2, 4, 5, 6, 7, 10}, a) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({3, 8}) = {3, 6, 1, 2, 4, 7, 8 }{3, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 72. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 73. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 74. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there {5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 75. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5}) ={5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 76. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5}) ={5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 77. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5}) = { 5, 6, 7, 1, 2, 4 }{5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8}
  • 78. Conversion of NFA to DFA ❑ Compute a sequence of ε – closures and moves: 11.Compute ε – closures (move ({ 1, 2, 4, 5, 6, 7, 10}, b)) o move ({ 1, 2, 4, 5, 6, 7, 10}, b) = o Add set to Dtrans table: • for symbol • As new state if not already there ε -closure ({5}) = { 5, 6, 7, 1, 2, 4 }{5} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 79. Conversion of NFA to DFA ❑ Construct the DFA transition graph using the Dtrans table: ❑ For each NFA state in the table, create a new DFA state symbol: NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7}
  • 80. Conversion of NFA to DFA ❑ Construct the DFA transition graph using the Dtrans table: ❑ For each NFA state in the table, create a new DFA state symbol: NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} DFA State NFA State a b A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 9} = D C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 10} = E E {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C
  • 81. Conversion of NFA to DFA ❑ Construct the DFA transition graph using the Dtrans table: ❑ For each NFA state in the table, create a new DFA state symbol: NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} DFA State NFA State a b A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 9} = D C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 10} = E E {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C ❑ Construct the graph based on table data: *DFA state with NFA final state is a DFA final state ➔ E
  • 82. Conversion of NFA to DFA ❑ Construct the DFA transition graph using the Dtrans table: ❑ For each NFA state in the table, create a new DFA state symbol: NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} DFA State NFA State a b A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 9} = D C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 10} = E E {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C E A a B C b a D b a b a b a b Start ❑ Construct the graph based on table data: *DFA state with NFA final state is a DFA final state ➔ E DFA
  • 83. Conversion of NFA to DFA ❑ Construct the DFA transition graph using the Dtrans table: ❑ For each NFA state in the table, create a new DFA state symbol: NFA State a b {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 9} { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7, 10} {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} { 1, 2, 4, 5, 6, 7} DFA State NFA State a b A {0,1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C B {1, 2, 3, 4, 6, 7, 8} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 9} = D C { 1, 2, 4, 5, 6, 7} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C D {1, 2, 4, 5, 6, 7, 9} {1, 2, 3, 4, 6, 7, 8} = B {1, 2, 4, 5, 6, 7, 10} = E E {1, 2, 4, 5, 6, 7, 10} {1, 2, 3, 4, 6, 7, 8} = B { 1, 2, 4, 5, 6, 7} = C E A a B C b a D b a b a b a b Start ❑ Construct the graph based on table data: *DFA state with NFA final state is a DFA final state ➔ E DFA NFA
  • 84. CPCS 302 ch3 Conversion of NFA to DFA ❑ Subset construction algorithm ▪ Input: An NFA N ▪ Output: A DFA D accepting the same language as N ▪ Algorithm: construct a transition table Dtran corresponding to D 2/9/2019 16