0

有没有办法让我获得我刚刚在规则的 RHS 中断言的事实的事实 ID?类似的东西

?f <- (assert (new-fact))
4

1 回答 1

1
CLIPS> 
(defrule example
   =>
   (bind ?f (assert (new-fact)))
   (bind ?i (fact-index ?f))
   (printout t "The fact index is " ?i crlf))
CLIPS> (reset)
CLIPS> (run)
The fact index is 1
CLIPS> (facts)
f-0     (initial-fact)
f-1     (new-fact)
For a total of 2 facts.
CLIPS> 
于 2013-05-26T21:58:59.163 回答