Advertisement
austecliano

ConverterAFN

Sep 30th, 2011
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. transicao *AFN_to_AFD(transicao *transicoesNFA, int numTransicoes, transicao *transicoesDFA)
  2. {
  3.     /*
  4.     Se ele passar neste loop, é pq não é um AFN.
  5.     */
  6.  
  7.     int i,j;
  8.     for(i=0;i<numTransicoes;i++)
  9.     {
  10.         for (j=i+1;j<numTransicoes-1;j++)
  11.         { //Se encontrar ao menos dois estados iguais
  12.             if((transicoesNFA[i][0] == transicoesNFA[j][0]) && (transicoesNFA[i][1] == transicoesNFA[j][1])){
  13.                 return converteAFN_to_AFD_Func(transicoesNFA, transicoesDFA);
  14.             }
  15.         }
  16.     }
  17.     return transicoesNFA;
  18. }
  19.  
  20. transicao* converteAFN_to_AFD_Func(transicao *transicoesNFA, int numTransicoes, transicao *transicoesDFA)
  21. {
  22.     //Cara nao to conesguindo fazer isso só no papel, to sem gcc aqui e a internet é uma bosta...
  23.     //Mas vou continuar tentando.  
  24.     trasicoesDFA = transicoesNFA;
  25.  
  26.     return transicoesDFA;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement