On Apr 13, 2007, at 1:50 PM, yuping he wrote:
Hi, I am just curious are there any specific reasons that
accumulate won't work with backchain-reactive facts or
any facts that simply starts with pattern (need-???)
No, no specific reason, just an omitted special case. The rule
compiler inserts an extra "X" pattern in the LHS of a need-X rule to
keep the rule from firing unnecessarily, and that's what's causing
the problem here; the extra pattern should not be inserted in this
case. I'll log this as a bug; thanks for the report.
(
(clear)
(reset)
(watch all)
(deffacts myfacts (need-xyz))
(reset)
(defrule rule
?count <- (accumulate
(bind ?c 0)
(bind ?c (+ ?c 1))
?c
(MAIN::need-xyz)
)
=>
(printout t "count: " ?count crlf)
)
Jess> Unexpected exception:
null
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------