; java -classpath jess.jar jess.Main ; (batch examples.clp) ; (reset) ; (run) ; (facts) ; (exit) (defrule R1 (happy ?x) => (assert (laughing ?x))) (defrule R2 (rich ?x) => (assert (happy ?x))) (defrule R3 (tickled ?x) => (printout t "tickling " ?x "..." crlf) (assert (laughing ?x))) (deffacts F (happy buda) (rich buffett) (poor charlie) (tickled elmo) (capital texas austin) (see pedestrian) (light green) ) (defrule R4 (in ?x texas) => (assert (big ?x))) (defrule R5 (capital ?x ?y) => (assert (city ?y)) (assert (in ?y ?x))) (defrule R6 (see pedestrian) => (printout t "stop!" crlf)) (defrule R6b (light red) => (printout t "stop!" crlf)) (defrule R7 (not (see pedestrian)) (light green) => (printout t "go!" crlf))