static void Remove_Epsilon(string state, CAutomat automat, string fake_state, CAutomat NonEpsilon)
 {
     foreach (CTranzitie Aux_tranz in automat.get_Tranzitii())
     {
         if (state == Aux_tranz.get_dinspre())
         {
             if (Aux_tranz.get_cost() == "e")
             {
                 Remove_Epsilon(Aux_tranz.get_catre(), automat, fake_state, NonEpsilon);
             }
             else
             {
                 var tranz_noua = new CTranzitie(Aux_tranz.get_catre(), fake_state, Aux_tranz.get_cost());
                 NonEpsilon.Accept_Tranzitii(tranz_noua);
             }
         }
     }
 }
 public void Remove_useless_states()
 {
     foreach (string stare in MStari)
     {
         bool ok = false;
         foreach (CTranzitie Aux_tranz in MTranzitii)
         {
             if (stare == Aux_tranz.get_catre())
             {
                 if (Aux_tranz.get_cost() != "e")
                 {
                     ok = true;
                 }
             }
         }
         if (stare == MStare_initiala)
         {
             ok = true;
         }
         if (ok == false)
         {
             foreach (string q in MStari)
             {
                 if (q == stare)
                 {
                     List <string> aux = MStari.ToList();
                     aux.Remove(q);
                     MStari = aux.ToArray();
                 }
             }
             for (int i = 0; i < MTranzitii.Count; i++)
             {
                 if (MTranzitii[i].get_dinspre() == stare)
                 {
                     MTranzitii.Remove(MTranzitii[i]);
                     i--;
                 }
             }
         }
     }
 }