0
我想知道如何我的两个规则相结合,例如:如何将两个规则合并为一个?
(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
声明,如果满足任何条件就会被触发。
谢谢我认为这是有效的,我只是没有得到什么问题,如果可能的话可以请多解释一下吗? –
只要插入(回答衬衫是),(回答红色是),(回答裤子是),(回答蓝色是)穿着红色衬衫和蓝色裤子的绅士。 – laune
哦不,我会添加一些其他信息,使其意味着什么,这只是我有问题的部分,谢谢 –