Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- notice:-
- write('System ekspertowy AI 2018'),nl.
- /*HIPOTEZY*/
- disease(Patient,zdolny):-
- symptom(Patient, dobra_krew),
- symptom(Patient, dobre_ekg),
- symptom(Patient, dobre_zeby),
- symptom(Patient, dobry_kregoslup).
- disease(Patient,niezdolny):-
- symptom(Patient, dobra_krew),
- symptom(Patient, zle_ekg),
- symptom(Patient, dobre_zeby),
- symptom(Patient, zle_zeby),
- symptom(Patient, zly_kregoslup).
- disease(Patient,badania):-
- symptom(Patient, kontuzja),
- symptom(Patient, dobra_krew),
- symptom(Patient, dobre_ekg),
- symptom(Patient, dobre_zeby),
- symptom(Patient, niekregoslup).
- /*REGULY*/
- symptom(P, Val):-ask('Does the Patient have',Val).
- ask(Obj, Val):-known(Obj, Val, true),!.
- ask(Obj, Val):-known(Obj, Val, false),!, fail.
- ask(Obj, Val):-nl,write(Obj),write(' '),
- write( Val) , write('?(y/n)'), read(Ans), !,
- ((Ans=y, assert(known(Obj, Val, true)));(assert(known(Obj, Val, false)),fail)).
- diagnose:-nl,write('Ocenianie zdolnosci...'),nl,disease(symptom,Disease) ,!,nl,
- write('Sportowiec jest: '), write(Disease).
- diagnose:- nl, write('Nie mozna okreslic!!').
- start:-notice,repeat, abolish(known/3),dynamic(known/3), retractall(known/3), diagnose,nl,nl, write('Try again ? (y/n)'),read(Resp),\+ Resp=y,
- nl,write('Bye ! Thanks for using this system'),abolish(known,3) .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement