You are on page 1of 1

struct DFAState {

bool marked;
std::vector<int> states;
std::map<char,int> moves;
};

typedef std::map<int, DFAState> DFATableType;


E-closure(IO) = {1,2,5} = 0

Mark 0
{1,2,5} --a--> {3}
E-closure{3} = {3} = 1
{1,2,5} --b--> {6}
E-closure{6} = {6} = 2

Mark 1
{3} --b--> {4}
E-closure{4} = {4,8,9,11} = 3

Mark 2
{6} --a--> {7}
E-closure{7} = {7,8,9,11} = 4

Mark 3
{4,8,9,11} --a--> {10}
E-closure{10} = {9,10,11} = 5

Mark 4
{7,8,9,11} --a--> {10}
E-closure{10} = {9,10,11} = 5

Mark 5
{9,10,11} --a--> {10}
E-closure{10} = {9,10,11} = 5

Initial State: {0}


Final State(s): {3,4,5}
State a b
0 {1} {2}
1 {} {3}
2 {4} {}
3 {5} {}
4 {5} {}
5 {5} {}

You might also like