fork download
  1. :- set_prolog_flag(verbose,silent).
  2. :- prompt(_, '').
  3. :- use_module(library(readutil)).
  4.  
  5. main:-
  6. process,
  7.  
  8. process:-
  9. /* your code goes here */
  10. symptom(amit,fever).
  11. symptom(amit,rash).
  12. symptom(amit,headache).
  13. symptom(amit,runn_nose).
  14.  
  15. symptom(kaushal,chills).
  16. symptom(kaushal,fever).
  17. symptom(kaushal,hedache).
  18.  
  19. symptom(dipen,runny_nose).
  20. symptom(dipen,rash).
  21. symptom(dipen,flu).
  22.  
  23.  
  24. hypothesis(Patient,measels):-
  25. symptom(Patient,fever),
  26. symptom(Patient,cough),
  27. symptom(Patient,conjunctivitis),
  28. symptom(Patient,rash).
  29.  
  30. hypothesis(Patient,german_measles) :-
  31. symptom(Patient,fever),
  32. symptom(Patient,headache),
  33. symptom(Patient,runny_nose),
  34. symptom(Patient,rash).
  35.  
  36. hypothesis(Patient,flu) :-
  37. symptom(Patient,fever),
  38. symptom(Patient,headache),
  39. symptom(Patient,body_ache),
  40. symptom(Patient,chills).
  41.  
  42. hypothesis(Patient,common_cold) :-
  43. symptom(Patient,headache),
  44. symptom(Patient,sneezing),
  45. symptom(Patient,sore_throat),
  46. symptom(Patient,chills),
  47. symptom(Patient,runny_nose).
  48.  
  49. hypothesis(Patient,mumps) :-
  50. symptom(Patient,fever),
  51. symptom(Patient,swollen_glands).
  52.  
  53. hypothesis(Patient,chicken_pox) :-
  54. symptom(Patient,fever),
  55. symptom(Patient,rash),
  56. symptom(Patient,body_ache),
  57. symptom(Patient,chills).
  58.  
  59. :- main.
Success #stdin #stdout #stderr 0.09s 32936KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/jT5CrA/prog:59:
	No permission to modify static procedure `true/0'
Warning: /home/jT5CrA/prog:61:
	Goal (directive) failed: user:main
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit