我需要使用逻辑运算符或在这种情况下,但我得到此语法错误。写这个的确切语法是什么?
CLIPS>
(defrule case2
(or ((PNP Y) (PLF Y) (PIU Y))
((PNP Y) (PLF N) (PIU Y)))
=>
(printout t "- Check the printer-computer cable" crlf))
[PRNTUTIL2] Syntax Error: Check appropriate syntax for the first field of a pattern.
ERROR:
(defrule MAIN::case2
(or ((
CLIPS>
答案 0 :(得分:0)
以下任何一种方法在语法上都是正确的,并会产生相同的结果:
(defrule case2
(or (and (PNP Y) (PLF Y) (PIU Y))
(and (PNP Y) (PLF N) (PIU Y)))
=>
(printout t "- Check the printer-computer cable" crlf))
(defrule case2
(PNP Y)
(or (PLF Y)
(PLF N))
(PIU Y)
=>
(printout t "- Check the printer-computer cable" crlf))
(defrule case2
(PNP Y)
(PLF Y | N)
(PIU Y)
=>
(printout t "- Check the printer-computer cable" crlf))