2

我想在运行规则时增加安全性。现在它什么都没有改变。事实(human_resources n)确实存在。

(defglobal ?安全= 0)

(defrule rule1 (human_resources n) => (defglobal ? security = (+ ? security 1)) )

这导致 ?*security = 1: (defglobal ? security = 0) (defglobal ? security = (+ ? security 1))

4

1 回答 1

5
CLIPS> (defglobal ?*security* = 0)
CLIPS> 
(defrule rule1
   (human_resources n)
   =>
   (bind ?*security* (+ ?*security* 1)))
CLIPS> (reset)
CLIPS> ?*security*
0
CLIPS> (assert (human_resources n))
<Fact-1>
CLIPS> (run)
CLIPS> ?*security*
1
CLIPS> 
于 2011-07-02T21:50:57.313 回答