1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| #include <stdio.h>
#include <stdlib.h>
#include "proext.h"
void initialiserProlog() {
int err;
if ((err = ProStart("")) == 0)
fprintf(stderr, "initialisation reussie");
else {
fprintf(stderr, "initialisation echouee!");
exit(err);
}
}
void terminerProlog(int condition) {
ProFinal(condition);
}
void erreurProlog(int numErreur) {
terminerProlog(numErreur);
fprintf(stderr, "erreur :'( !");
exit(-1);
}
//////////////
int afficherSimpleTexteProlog() {
int res;
res = new_pattern("outml(coucou)");
if (res)
erreurProlog(res);
res = next_solution();
kill_goal();
return res;
}
//////////////
int main(int argc, char **argv) {
int res;
initialiserProlog();
res = afficherSimpleTexteProlog();
terminerProlog(res);
return res;
} |
Partager