回到剪辑中的上述规则
Get back to above rule in clips
当我尝试调用已经使用过的 defrule
时,剪辑停止..
有些defrule
需要多次使用,有什么办法吗
这里有一个例子
(
defrule choice-in-powerPlant2
(powerPlant2-question)
=>
(printout t "Are Filter and Carburetor Air working fine(y/n)?" crlf)
(bind ?response (check-YNoptions-input)); Get user input on type of questions
(if (eq ?response y)
then
(assert (powerPlant1-question)
)
)
(if (or(eq ?response q) (eq ?response Q))
then
(output-exitmessage)
)
(if (eq ?response n)
then
(printout t "Have you fixed this(y/n)?" crlf)
(bind ?response (check-YNoptions-input)); Get user input on type of questions
(if (eq ?response y)
then
(assert (powerPlant1-question)
)
)
(if (eq ?response n)
then
(printout req "Please replace Filter and Carburetor Air " crlf)
(assert (powerPlant3-question))
)
)
)
在规则 2 中
我想在输入 "y"=yes
时回到规则 1
" 运行 在我输入 "y" 后停止了
如果您想重新触发与特定事实相匹配的规则,请将该事实作为规则操作的一部分撤回。如果另一条规则断言该特定事实,则将重新触发该规则。例如:
(defrule choice-in-powerPlant2
?f <- (powerPlant2-question)
=>
(retract ?f)
(printout t "Are Filter and Carburetor Air working fine(y/n)?" crlf)
.
.
.
)
当我尝试调用已经使用过的 defrule
时,剪辑停止..
有些defrule
需要多次使用,有什么办法吗
这里有一个例子
(
defrule choice-in-powerPlant2
(powerPlant2-question)
=>
(printout t "Are Filter and Carburetor Air working fine(y/n)?" crlf)
(bind ?response (check-YNoptions-input)); Get user input on type of questions
(if (eq ?response y)
then
(assert (powerPlant1-question)
)
)
(if (or(eq ?response q) (eq ?response Q))
then
(output-exitmessage)
)
(if (eq ?response n)
then
(printout t "Have you fixed this(y/n)?" crlf)
(bind ?response (check-YNoptions-input)); Get user input on type of questions
(if (eq ?response y)
then
(assert (powerPlant1-question)
)
)
(if (eq ?response n)
then
(printout req "Please replace Filter and Carburetor Air " crlf)
(assert (powerPlant3-question))
)
)
)
在规则 2 中 我想在输入 "y"=yes
时回到规则 1" 运行 在我输入 "y" 后停止了
如果您想重新触发与特定事实相匹配的规则,请将该事实作为规则操作的一部分撤回。如果另一条规则断言该特定事实,则将重新触发该规则。例如:
(defrule choice-in-powerPlant2
?f <- (powerPlant2-question)
=>
(retract ?f)
(printout t "Are Filter and Carburetor Air working fine(y/n)?" crlf)
.
.
.
)