Ejemplo n.º 1
0
int main()
{
/*  char* ch1 = malloc (24*sizeof(char)); // Alloue un tableau de taille 12
    char* ch2 = malloc (24*sizeof(char)); // Alloue un tableau de taille 12
    scanf("%s",ch1); // Lit la chaine 1
    scanf("%s",ch2); // Lit la chaine 2
    printf("La chaine vaut maintenant : %s", concatSansStringH(ch1, ch2));

*/
    automate* A;
    A = construitAutomateExemple();
    afficheAutomate(A);
    printf("Nombre de transitions : %d\n", compteTransition(A));

    printf("\n===============================\n");
    printf("On test de supprimer une transition\n");
    supprimeTransition(A, 4, 4, 'a');
    printf("Nombre de transitions : %d\n", compteTransition(A));


    printf("Si 1, automate complet, sinon 0 : %d\n", complet(A));
    printf("Si 1, automate deterministe, sinon 0 : %d\n", deterministe(A));


    completeAutomate(A);

    printf("\n===============================\n");
    printf("On teste la fonction completeAutomate()\n");
    printf("Si 1, automate complet, sinon 0 : %d\n", complet(A));
}
Ejemplo n.º 2
0
int main(int argc, char *argv[]){
	struct graph G;
	automate self;
	self=construitAutomateExemple();
	automateToGraph(&G,self);
	afficheAutomate(self);
	printGraph(&G);
	if(langageVide(&G,self)){
		printf("Le langage est vide\n");
	}else{
		printf("Le langage est non vide\n");
	}
	char* str=listeTransitions(&G);
	return 0;
}