dimanche 23 avril 2017

NFA to DFA implementation in C++

The title says it all. I need some ideas. The nfa input looks like this and has no epsilon moves.

1 2
0 a 2
1 b 3

etc, meaning that 1 and 2 ar final states and that with 'a' I can get from state 0 to state 2.

I use

struct nod
{
int ns;
char c;
};

vector<nod> v[100];

to save the data, where v[i] is the vector containing all the ways that can go from state i. I need an idea on how to name the new states when there is a multiset of states like

0 a 1
0 a 2
0 a 3

because i can't create state 123 or something like that. And how can i check if a multiset has already been transformed in a state?

Aucun commentaire:

Enregistrer un commentaire