Lab4 Exercise Rules: Facts
Lab4 Exercise Rules: Facts
Rules:
Facts:
Ed has a very high fever.
Ed has a cough.
Alice doesn't have poison ivy.
Max says Alice has poison ivy.
Grace says Don is healthy.
Grace is a doctor.
Whooping cough is contagious.
Ed contacts Alice.
Step 1. Start by analysing at rules, identify the pieces of information that drive
the rules. Look at the effects that firing the rule has.
Rule 1: If a patient has a very high fever, the patient has a high fever.
Rule 4: If a patient has a high fever and congestion, the patient has the flu.
Rule 5: If a patient has a rash and no high fever, the patient has poison ivy.
LHS: (patient->cough value true) AND (patient-> fever value not very high)
RHS: (patient->whooping cough value true)
Rule 6: If a patient has no fever, no cough, and no rash, the patient is healthy.
LHS: (patient->fever value false) AND (patient->cough value false) AND (patient->
rash value false)
RHS: (patient->healthy value true)
Rule 7: If a patient has a cough and a very high fever, the patient has whooping cough.
LHS: (patient->cough value false) AND (patient-> fever value very high)
RHS: (patient->whooping cough value true)
Rule 8: If one patient has a particular disease which is contagious and that patient contacts
another patient, then the other patient has the disease.
Rule 10: If a person says that a patient has a particular disease or is healthy and that is not
true of the patient, then that otherperson is not a doctor.
Step 2. Refine Rules. Pick out alternate values for same fields. Group together
fields describing entities to pick out entities.
Patient (fever, whooping cough, cough, poison ivy, rash, disease, otherperson
contact, otherperson comment)
Alternate values for fields: e.g. fever – very high, high, none
Whooping cough – true, false
E.g. Whooping cough, poison ivy, flu are all diseases. Have field disease.
Amend possible values for disease to be whooping cough, poison ivy, flu
Step 5: Build rules and test against data given. Then refine, test, refine test ….