(defrule call-the-aa (petrol yes)(starter-turning yes) => (printout t "Call the A.A." crlf)) (defrule buy-some-petrol (petrol no)(starter-turning yes) => (printout t "Buy some petrol" crlf)) (defrule replace-starter (terminals-clean yes)(solenoid-click yes)(lights-working yes)(starter-turning no) => (printout t "Replace starter" crlf)) (defrule clean-terminals (terminals-clean no)(solenoid-click yes)(lights-working yes)(starter-turning no) => (printout t "Clean terminals" crlf)) (defrule replace-solenoid (solenoid-fuse-ok yes)(solenoid-click no)(lights-working yes)(starter-turning no) => (printout t "Replace solenoid" crlf)) (defrule replace-fuse (solenoid-fuse-ok no)(solenoid-click no)(lights-working yes)(starter-turning no) => (printout t "Replace solenoid" crlf)) (defrule charge-battery (lights-working no)(starter-turning no) => (printout t "Charge battery" crlf)) (defrule are-lights-working (not (lights-working ?)) => (printout t "Are the car's lights working (yes or no)?") (assert (lights-working (read))) )