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
哦不,我會添加一些其他信息,使其意味着什麼,這只是我有問題的部分,謝謝 –