(deffacts dane ; dane nie beda potrzebne - wczytamy je z klawiatury ;-) ) (defrule czytaj (not (dane ?)) => (printout t "Podaj liczbe: " ) (assert (dane (read))) ) (defrule sprawdzaj ?i<-(dane ?x) (test (not (numberp ?x))) => (printout t "Skup sie! To nie jest liczba!!!" crlf) (retract ?i) ) (defrule za-duza ?i<-(dane ?x) (test (numberp ?x)) (test (> ?x 100)) => (retract ?i) (printout t "Za duza ta liczba!!!" crlf) ) (defrule za-mala ?i<-(dane ?x) (test (numberp ?x)) (test (< ?x 100)) => (retract ?i) (printout t "Za mala ta liczba!!!" crlf) ) (defrule jak-trzeba (dane ?x) (test (numberp ?x)) (test (= ?x 100)) => (printout t "OK! Teraz jest akurat!!!" crlf) )