IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Prolog Discussion :

Problème d'execution 'SYSTEME EXPERT MEDICAL'


Sujet :

Prolog

  1. #1
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2013
    Messages : 43
    Points : 43
    Points
    43
    Par défaut Problème d'execution 'SYSTEME EXPERT MEDICAL'
    Bonjour,

    Je suis débutante en PROLOG et je voudrais faire un système expert médical, en exécutant ce code cette fenêtre s'affiche.

    Nom : ERROR.png
Affichages : 477
Taille : 53,0 Ko

    Ci dessous le code du système expert.

    Prière de diriger vers une solution.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
     
    :- use_module(library(jpl)).
    start :-sleep(0.4),
    		write('-----------------------------------------------------------------'),nl,
    		sleep(0.4),
    		write('*****************************************************************'),nl,
    		sleep(0.2),
    		write("###################||| EXPERT SYSTEM |||#########################"),nl,
    		sleep(0.4),
    		write('*****************************************************************'),nl,
    		sleep(0.4),
    		write('-----------------------------------------------------------------'),nl,nl,nl,
     
    		interface2.
     
        symptom(Patient,fever) :- verify(Patient," have a fever (y/n) ?").
     
        symptom(Patient,rash) :- verify(Patient," have a rash (y/n) ?").
     
        symptom(Patient,headache) :- verify(Patient," have a headache (y/n) ?").
     
        symptom(Patient,runny_nose) :- verify(Patient," have a runny_nose (y/n) ?").
     
        symptom(Patient,conjunctivitis) :- verify(Patient," have a conjunctivitis (y/n) ?").
     
        symptom(Patient,cough) :- verify(Patient," have a cough (y/n) ?").
     
        symptom(Patient,body_ache) :- verify(Patient," have a body_ache (y/n) ?").
     
        symptom(Patient,chills) :- verify(Patient," have a chills (y/n) ?").
     
        symptom(Patient,sore_throat) :- verify(Patient," have a sore_throat (y/n) ?").
     
        symptom(Patient,sneezing) :- verify(Patient," have a sneezing (y/n) ?").
     
        symptom(Patient,swollen_glands) :- verify(Patient," have a swollen_glands (y/n) ?").
     
        hypothesis(Patient,measles) :-
            symptom(Patient,fever),
            symptom(Patient,cough),
            symptom(Patient,conjunctivitis),
            symptom(Patient,runny_nose),
            symptom(Patient,rash).
     
     hypothesis(Patient,german_measles) :-
            symptom(Patient,fever),
            symptom(Patient,headache),
            symptom(Patient,runny_nose),
            symptom(Patient,rash).
     
        hypothesis(Patient,flu) :-
            symptom(Patient,fever),
            symptom(Patient,headache),
            symptom(Patient,body_ache),
            symptom(Patient,conjunctivitis),
            symptom(Patient,chills),
            symptom(Patient,sore_throat),
            symptom(Patient,runny_nose),
            symptom(Patient,cough).
     
        hypothesis(Patient,common_cold) :-
            symptom(Patient,headache),
            symptom(Patient,sneezing),
            symptom(Patient,sore_throat),
            symptom(Patient,runny_nose),
            symptom(Patient,chills).
     
        hypothesis(Patient,mumps) :-
            symptom(Patient,fever),
            symptom(Patient,swollen_glands).
     
        hypothesis(Patient,chicken_pox) :-
            symptom(Patient,fever),
            symptom(Patient,chills),
            symptom(Patient,body_ache),
            symptom(Patient,rash).
     
        hypothesis(Patient,measles) :-
            symptom(Patient,cough),
            symptom(Patient,sneezing),
            symptom(Patient,runny_nose).
     
    	hypothesis(_,"disease. But I'm Sorry, I don't seem to be able to diagnose the disease").
     
        response(Reply) :-
            read(Reply),
            write(Reply),nl.
     
    ask(Patient,Question) :-
    	write(Patient),write(', do you'),write(Question),
     
     
    	interface(', do you',Patient,Question),
    	write('Loading.'),nl,
    	sleep(1),
    	write('Loading..'),nl,
    	sleep(1),
    	write('Loading...'),nl,
    	sleep(1),
        nl.
     
    :- dynamic yes/1,no/1.
     
    verify(P,S) :-
       (yes(S)
        ->
        true ;
        (no(S)
         ->
         fail ;
         ask(P,S))).
     
    undo :- retract(yes(_)),fail.
    undo :- retract(no(_)),fail.
    undo.
     
     
    pt(Patient):-
     
    		hypothesis(Patient,Disease),
    		interface3(Patient,', you probably have ',Disease,'.'),
            write(Patient),write(', you probably have '),write(Disease),write('.'),undo,end.
     
    end :-
    		nl,nl,nl,
    		sleep(0.7),
    		write('*****************************************************************'),nl,
    		sleep(0.4),
    		write("################||| THANK YOU FOR USE ME |||#####################"),nl,
    		sleep(0.4),
    		write('*****************************************************************'),nl.
     
    interface(X,Y,Z) :-
    	atom_concat(Y,X, FAtom),
    	atom_concat(FAtom,Z,FinalAtom),
    	jpl_new('javax.swing.JFrame', ['Expert System'], F),
    	jpl_new('javax.swing.JLabel',['--- MEDICAL EXPERT SYSTEM ---'],LBL),
    	jpl_new('javax.swing.JPanel',[],Pan),
    	jpl_call(Pan,add,[LBL],_),
    	jpl_call(F,add,[Pan],_),
    	jpl_call(F, setLocation, [400,300], _),
    	jpl_call(F, setSize, [400,300], _),
    	jpl_call(F, setVisible, [@(true)], _),
    	jpl_call(F, toFront, [], _),
    	jpl_call('javax.swing.JOptionPane', showInputDialog, [F,FinalAtom], N),
    	jpl_call(F, dispose, [], _),
    	write(N),nl,
    	( (N == yes ; N == y)
          ->
           assert(yes(Z)) ;
           assert(no(Z)), fail).
     
    interface2 :-
    	jpl_new('javax.swing.JFrame', ['Expert System'], F),
    	jpl_new('javax.swing.JLabel',['--- MEDICAL EXPERT SYSTEM ---'],LBL),
    	jpl_new('javax.swing.JPanel',[],Pan),
    	jpl_call(Pan,add,[LBL],_),
    	jpl_call(F,add,[Pan],_),
    	jpl_call(F, setLocation, [400,300], _),
    	jpl_call(F, setSize, [400,300], _),
    	jpl_call(F, setVisible, [@(true)], _),
    	jpl_call(F, toFront, [], _),
    	jpl_call('javax.swing.JOptionPane', showInputDialog, [F,'Hi. How are you? First of all tell me your name please'], N),
    	jpl_call(F, dispose, [], _),
     
    	(	N == @(null)
    		->	write('you cancelled'),interface3('you cancelled. ','Thank you ','for use ','me.'),end,fail
    		;	write("Hi. How are you? First of all tell me your name please : "),write(N),nl,pt(N)
    	).
     
     
    interface3(P,W1,D,W2) :-
    	atom_concat(P,W1, A),
    	atom_concat(A,D,B),
    	atom_concat(B,W2,W3),
    	jpl_new('javax.swing.JFrame', ['Expert System'], F),
    	jpl_new('javax.swing.JLabel',['--- MEDICAL EXPERT SYSTEM ---'],LBL),
    	jpl_new('javax.swing.JPanel',[],Pan),
    	jpl_call(Pan,add,[LBL],_),
    	jpl_call(F,add,[Pan],_),
    	jpl_call(F, setLocation, [400,300], _),
    	jpl_call(F, setSize, [400,300], _),
    	jpl_call(F, setVisible, [@(true)], _),
    	jpl_call(F, toFront, [], _),
    	jpl_call('javax.swing.JOptionPane', showMessageDialog, [F,W3], N),
    	jpl_call(F, dispose, [], _),
    	/*write(N),nl,*/
    	(	N == @(void)
    		->	write('')
    		;	write("")
    	).

  2. #2
    Rédacteur/Modérateur
    Avatar de Trap D
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    4 942
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 4 942
    Points : 6 498
    Points
    6 498
    Par défaut
    Bonjour
    Avant toute chose il faut vérifier la cohérence des installations :
    SWI-Prolog est-il en 32/64 bits ?
    Le jre java est-il en 32/64 bits.
    Il faut le même type d'installations.
    Il faut que jpl.dll soit dans le Path ainsi que le répertoire d'installation du jre (jvm.dll doit être accessible par le Path).
    "La haine seule fait des choix" - Koan Zen
    "Il ne faut pas être meilleur que les autres, il faut être meilleur que soi." Albert Jacquard
    "Ceux qui savent où ils ont posé leur parapluie ne sont pas alcooliques." - pgibonne.
    Faites du Prolog, ça vous changera les idées !
    Ma page Prolog
    Mes codes sources commentés

    Mon avatar : La Madeleine à la veilleuse de Georges de La Tour

  3. #3
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2013
    Messages : 43
    Points : 43
    Points
    43
    Par défaut
    Citation Envoyé par Trap D Voir le message
    Bonjour
    Avant toute chose il faut vérifier la cohérence des installations :
    SWI-Prolog est-il en 32/64 bits ?
    Le jre java est-il en 32/64 bits.
    Il faut le même type d'installations.
    Il faut que jpl.dll soit dans le Path ainsi que le répertoire d'installation du jre (jvm.dll doit être accessible par le Path).
    Bonjour Trap D

    J'ai vérifié et j'ai mis

    1. Dans JAVA_HOME : C:\Program Files\Java\jdk1.7.0_51;

    En effet j'ai deux Path majuscule et minuscule (je ne sais pas si il y a une différence?? une dans la partie user variable et l'autre dans la partie system variable)
    2. Dans les deux j'ai fait pareil : C:\Program Files\Java\jdk1.7.0_51\jre\bin\client (ça c'est pour JVM, je l'ai trouvé dans ce répertoire); C:\Program Files\Java\jdk1.7.0_51;
    3. Pour jpl.dll : C:\Program Files\swipl\bin

    Hélas j’obtiens toujours l'erreur suivante:
    Nom : err.png
Affichages : 314
Taille : 32,2 Ko

    Je ne trouve pas ça logique parce que sur la première erreur c'est marqué
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    is not a valide Win32 application
    et Prolog affiche en haut Peut être j'ai mal compris!!!!!!!!

Discussions similaires

  1. Réponses: 6
    Dernier message: 21/06/2005, 12h39
  2. [Tomcat][plugin]Problème d'execution de Tomcat 5
    Par Carlito_superheros dans le forum Eclipse Java
    Réponses: 14
    Dernier message: 11/03/2005, 13h56
  3. problème d'execution de JSP avec eclipse - TOMCAT
    Par Staron dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 14/12/2004, 21h48
  4. problème lancement executable avec winexec()
    Par semenzato dans le forum MFC
    Réponses: 5
    Dernier message: 19/01/2004, 11h48

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo