I am working with a very simple pair of rules:

(defrule is-child
    "Definition of child is under 14 years or 50 kg"
    (patient {age < 14 || weight < 50})
    =>
        (assert(pediatric)))

    

(defrule is-adult
    "Definition of adult is over 14 years or 50 kg"
    (patient {age >= 14 || weight >= 50})
    =>
        (assert(adult)))

If I assert (patient (age 33) (weight 73)) then the is-adult rule is activated and fired.
If I assert (patient (age 3) (weight 3)) then the is-child rule is activated and fired.

If, however, I assert (patient (age 33)(weight 3)) then neither rule is activated.  Since I have written
these as logical ORs, I would expect them BOTH to be activated, and fired, as there is no rule
that restricts both (adult) and (pediatric) to co-exist.  If I change the is-adult rule to be logical and 
with &&, this does not change the behavior - namely, the is-child rule is not activated.

I am badly confused.  Thanks.


Reply via email to