/* DISEASE.LOGIC */ /* This is one possible answer to the disease question in Supplement 1. Disease Temp Other Exposed Type of disease symptoms to --------------------------------------------------------------- Dutch M. High irs Holland Remediable Fowlpox. Low irs Poultry Remediable Deodorant Low irs/ Deodorant Allergy allergy. Low hbl Devil's Low irs Devil's Allergy lovebite lovebite allergy. Plague. Low irs/ Plague Plague hbl Batavium- Low irs Batavium Heavy metal poisoning h.m.p. Treatment Type Type of of disease patient ------------------------------------------------ None Plague Any Flush system H.m.p. Any Remove & desens. Allergy Any Prestatine Remediable Pregnant Brontomycin 10mg Remediable Adult non-pregnant Brontomycin 5 mg Remediable Child */ /* X has disease D if X has stated temperature, other symptoms, and things exposed to. */ disease(X,dutch_measles) :- temperature(X,high), other_symptoms(X,itchy_red_spots), exposed_to(X,holland). disease(X,fowlpox) :- temperature(X,low), other_symptoms(X,itchy_red_spots), exposed_to(X,poultry). disease(X,deodorant_allergy) :- temperature(X,low), other_symptoms(X,itchy_red_spots), exposed_to(X,deodorant). disease(X,deodorant_allergy) :- temperature(X,low), other_symptoms(X,hard_black_lumps), exposed_to(X,deodorant). disease(X,devils_lovebite_allergy) :- temperature(X,low), other_symptoms(X,itchy_red_spots), exposed_to(X,devils_lovebite). disease(X,plague) :- temperature(X,low), other_symptoms(X,itchy_red_spots), exposed_to(X,plague). disease(X,plague) :- temperature(X,low), other_symptoms(X,hard_black_lumps), exposed_to(X,plague). disease(X,batavium_heavy_metal_poisoning) :- temperature(X,low), other_symptoms(X,itchy_red_spots), exposed_to(X,batavium). /* The type of a disease. */ type(dutch_measles,remediable_infection). type(fowlpox,remediable_infection). type(deodorant_allergy,allergy). type(devils_lovebite_allergy,allergy). type(plague,plague). type(batavium_heavy_metal_poisoning,heavy_metal_poisoning). /* The treatment for a given disease. */ treatment(X,shoot) :- disease(X,plague). /* Relies on knowledge that only plague has type plague. */ treatment(X,remove_and_desensitise) :- disease(X,D), type(D,allergy). treatment(X,flush_system_and_dialyse) :- disease(X,D), type(D,heavy_metal_poisoning). treatment(X,brontomycin_5_mg) :- disease(X,D), type(D,remediable_infection), is_a(X,child). treatment(X,prestatine_30_mg) :- disease(X,D), type(D,remediable_infection), is_a(X,pregnant_adult). treatment(X,brontomycin_10_mg) :- disease(X,D), type(D,remediable_infection), is_a(X,non_pregnant_adult).