我想知道如何组合我的两个规则,例如:
(defrule Rules::pants
(declare (auto-focus TRUE))
(answer (ident color) (text red))
(answer (ident pants) (text yes))
=>
(printout t "you are wearing red pants"))
(defrule Rules::shirt
(declare (auto-focus TRUE))
(answer (ident shirt) (text blue))
(answer (ident red) (text yes))
=>
(printout t "you are wearing blue shirt"))
如果我写这两个规则,例如:
(defrule Rules::pants
(declare (auto-focus TRUE))
(answer (ident red) (text yes))
(answer (ident pants) (text yes))
(answer (ident shirt) (text yes))
(answer (ident blue) (text yes))
=>
(printout t "you are wearing blue shirt and red pants"))
我希望它像一个OR
语句一样,如果满足任何条件就被触发。