Skip to content

Commit

Permalink
Merge pull request #21 from itzala/master
Browse files Browse the repository at this point in the history
Résolution conflit
  • Loading branch information
itzala committed May 13, 2014
2 parents 31301fb + ade2965 commit 3b75ac3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
12 changes: 7 additions & 5 deletions src/automate.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,10 @@ int get_min_etat( const Automate* automate ){
Automate * mot_to_automate(const char * mot){
Automate* res = creer_automate();
int length = sizeof(mot) / sizeof(char);
int i = 0;
ajouter_etat_initial(res, i+1);
for ( ; i < length; ++i)

int i;
ajouter_etat_initial(res, 1);
for (i = 0; i < length; ++i)
{
ajouter_transition(res, i+1, mot[i], i+2);
}
Expand Down Expand Up @@ -507,7 +508,7 @@ Ensemble* etats_accessibles( const Automate * automate, int etat ){
}

Automate *automate_accessible( const Automate * automate){
printf("[Automate accessible] Début fonction....\n");
/*printf("[Automate accessible] Début fonction....\n");
Automate* clone = copier_automate(automate);
Ensemble* etats = creer_ensemble(NULL, NULL, NULL);
Ensemble_iterateur it_etat;
Expand All @@ -527,7 +528,8 @@ Automate *automate_accessible( const Automate * automate){
it_etat = iterateur_suivant_ensemble( it_etat )){
if (est_une_transition_de_l_automate(automate))
}
return clone;
return clone;*/
return NULL;
}

void reverse_transition(int origine, char lettre, int fin, void* automate)
Expand Down
26 changes: 15 additions & 11 deletions src/test_automate.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ int main(){
printf("\n'%s' est reconnu....\n", mot5);
else
printf("\n'%s' n'est pas reconnu....\n", mot5);

liberer_automate(automate);

print_automate(automate);
print_separation_tests();

Automate * automate2 = creer_automate();
Expand All @@ -106,9 +105,13 @@ int main(){

liberer_automate(automate2);

Automate* suffixes = creer_automate_des_prefixes(automate2);
printf("\n\n\nAutomate des prefixes de Automate2\n");
Automate* suffixes = creer_automate_des_suffixes(automate2);
printf("\n\n\nAutomate des suffixes de Automate2\n");
print_automate(suffixes);

Automate* prefix = creer_automate_des_prefixes(automate2);
printf("\n\n\nAutomate des prefixes de Automate2\n");
print_automate(prefix);

Automate* facteur = creer_automate_des_facteurs(automate2);
printf("\n\n\nAutomate des facteurs de Automate2\n");
Expand All @@ -121,12 +124,6 @@ int main(){
Automate* sousmot = creer_automate_des_sous_mots(automate2);
printf("\n\n\nAutomate des sous mots de Automate2\n");
print_automate(sousmot);

liberer_automate(suffixes);
liberer_automate(prefix);
liberer_automate(facteur);
liberer_automate(surmot);
liberer_automate(sousmot);

print_separation_tests();

Expand Down Expand Up @@ -155,6 +152,14 @@ int main(){
print_automate(melange);

liberer_automate(mot_automate);
liberer_automate(suffixes);
liberer_automate(prefix);
liberer_automate(facteur);
liberer_automate(surmot);
liberer_automate(sousmot);
liberer_automate(aaa);
liberer_automate(bbb);
liberer_automate(melange);

// Test creer_automate_de_concatenation
print_separation_tests();
Expand Down Expand Up @@ -189,6 +194,5 @@ int main(){

printf("Automate concaténé\n");
print_automate(concatenation);

exit(1);
}

0 comments on commit 3b75ac3

Please sign in to comment.