Simulated Pediatric Disease Diagnosis
Simulated Pediatric Disease Diagnosis
10-06-2008 10-07-2008
EXPERIMENT NO:01
CÓDIGO-FONTE:
domínios
disease,indication,name=symbol
predicados
hypothesis(name,disease)
symptom(name,indication)
cláusulas
symptom(charlie,fever).
symptom(charlie,rash).
symptom(charlie,headache).
symptom(charlie,runny_nose).
hipótese(Paciente, sarampo):-
limparjanela
symptom(Patient,fever),
symptom(Patient,cough),
symptom(Patient,conjunctivities),
symptom(Patient,runny_nose),
symptom(Patient,rash).
hipótese(Paciente, sarampo_alemão):-
symptom(Patient,fever),
symptom(Patient,headache),
symptom(Patient,runny_nose),
symptom(Patient,rash).
hipótese(Paciente,gripe):-
symptom(Patient,fever),
symptom(Patient,headache),
symptom(Patient,body_ache),
symptom(Patient,conjunctivities),
symptom(Patient,chills),
symptom(Patient,sore_throat),
symptom(Patient,cough),
symptom(Patient,runny_nose).
hipótese(Paciente,resfriado_comum):-
symptom(Patient,headache),
symptom(Patient,sneezing),
symptom(Patient,sore_throat),
symptom(Patient,chills),
symptom(Patient,runny_nose).
hipótese(Paciente, caxumba):-
symptom(Patient,fever),
symptom(Patient,swollen_glands).
hipótese(Paciente,catapora):-
symptom(Patient,fever),
symptom(Patient,rash),
symptom(Patient,body_ache),
symptom(Patient,chills).
hypothesis(Patient,whooping_cough):-
symptom(Patient,cough),
symptom(Patient,sneezing),
symptom(Patient,runny_nose).
Goal:hypothesis(Patient,Disease)
Patient=charlie, Disease=german_measles
1 Solução
DATE OF EXPERIMENT: DATE OF SUBMISSION:
10-06-2008 10-07-2008
EXPERIÊNCIA Nº: 02
CÓDIGO FONTE:
domínios
disease,indication=symbol
patient=string
predicados
hypothesis(patient,disease)
symptom(patient,indication)
resposta(caractere)
vá
cláusulas
ir:-
Qual é o nome do paciente?
lerln(Paciente),
hypothesis(Patient,Disease),
escreva(Paciente, " provavelmente tem ", Doença, "."), nl.
ir:-
Desculpe, não parece que eu consiga
diagnosticar a doença.
symptom(Patient,fever):-
escreva("O(a)
response(Reply),
Reply='y'.
symptom(Patient,rash):-
O paciente
response(Reply),
Reply='y'.
symptom(Patient,headache):-
Escreva("Dose ", Paciente, " tem dor de cabeça (s/n)?"),
response(Reply),
Reply='y'.
sintoma(Paciente, nariz_correndo):-
Escreva("O paciente ", Paciente, " tem um nariz escorrendo (s/n)?")
response(Reply),
Reply='y'.
sintoma(Paciente,conjuntivite):-
o paciente tem conjuntivite (s/n)?
response(Reply),
Reply='y'.
symptom(Patient,cough):-
O paciente
response(Reply),
Reply='y'.
symptom(Patient,body_ache):-
escreva("O paciente ", Paciente, " tem dores no corpo (s/n)?")
response(Reply),
Reply='y'.
symptom(Patient,chills):-
O paciente
response(Reply),
Reply='y'.
symptom(Patient,sore_throat):-
escreva("O paciente ", Paciente, " tem dor de garganta (s/n)?"),
response(Reply),
Reply='y'.
symptom(Patient,sneezing):-
Escreva("Está
response(Reply),
Reply='y'.
symptom(Patient,swollen_glands):-
write("Dose ",Patient," have swollen glands (y/n)?"),
response(Reply),
Reply='y'.
hipótese(Paciente, sarampo):-
symptom(Patient,fever),
symptom(Patient,cough),
symptom(Patient,conjunctivities),
symptom(Patient,runny_nose),
symptom(Patient,rash).
hipótese(Paciente, sarampo_alemão):-
symptom(Patient,fever),
symptom(Patient,headache),
symptom(Patient,runny_nose),
symptom(Patient,rash).
hipótese(Paciente,gripe):-
symptom(Patient,fever),
symptom(Patient,headache),
symptom(Patient,body_ache),
symptom(Patient,conjunctivities),
symptom(Patient,chills),
symptom(Patient,sore_throat),
symptom(Patient,cough),
symptom(Patient,runny_nose).
hipótese(Paciente, resfriado_comum):-
symptom(Patient,headache),
symptom(Patient,sneezing),
symptom(Patient,sore_throat),
symptom(Patient,chills),
symptom(Patient,runny_nose).
hipótese(Paciente, caxumba):-
symptom(Patient,fever),
symptom(Patient,swollen_glands).
hipótese(Paciente,varicela):-
symptom(Patient,fever),
symptom(Patient,rash),
symptom(Patient,body_ache),
symptom(Patient,chills).
hipótese(Paciente,coqueluche):-
symptom(Patient,cough),
symptom(Patient,sneezing),
symptom(Patient,runny_nose).
response(Reply):-
lercaractere(Resposta),
escreva(Responder),nl.
Meta: ir