先看一个例子(摘自Cpsb.doc):
(defrule
(difficulty >= easy)
(game-time > 300)
(soldier-count == 0)
(unit-type-count villager < five-percent-pop)
(nand
(players-stance any-human ally)
(stance-toward any-human ally)
)
=>
(set-goal 1 19)
(disable-self)
)
我个人的理解是:
nand相当于逻辑运算符Xor(逻辑异或),facts1与facts2任一为 TRUE,但不同时为 TRUE时,本事实才为TRUE。具体为:
(nand(true)(true))=false
(nand(true)(false))=true
(nand(false)(true))=true
(nand(false)(false))=false
注意:上述说法有误,请参见<b><FONT color=#990000>yesgqt先生的回贴</FONT></b>
<B>介绍AI脚本技术,加精华。按第四等耕战之功论,奖励魅力100——操作人:无知者</B>
[此贴子已经被作者于2004-12-12 12:45:13编辑过]
|