I did a little bit more research to try to find out what is going on.

I printed the fact id of all the facts that match the accumulate CE, and there fact id's show up from facts that are already deleted. Here is the rule that actually does the deletion:

(defrule RemoveCostOfChange
   (declare (auto-focus TRUE))
   ?pc <- (ModifiabilityReasoningFrameworks::P_CostOfChange (owner ?r))
   (MAIN::ResponsibilityRefinementRelation (parent ?r))
=>
   (retract ?pc)
)

Looks like something is going terribly wrong.

Facts in the program are either inserted by calling assertFact from java or the usual assert/modify/retract commands from Jess.

Not sure that this helps

Felix

[EMAIL PROTECTED] wrote:

I can't reproduce the problem with a simple program, so it's more
complex than just what we can see here. There have been a few patches
to "accumulate" over the last few releases, but none of them dealing
with anything like this. What this looks like to me is working memory
corruption due to out-of-band data changes -- for example, setting
slots value in a Fact directly rather than using "modify", or using
instances of a class with a mutable hashCode as slot data without
using set-nonvalue-class.

In the next release, by the way, the "value class" default is going to
be reversed, so that the slow, safe mode is the default, and the fast
but breakable mode is an option you must turn on explicitly.

I think Felix Bachmann wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
I have a little problem with the accumulate CE. I try to collect a slot value of a set of facts in a list with the following accumulate statement (produced with (ppdefrule). The interesting slot is the "owner" slot. I provided a list of facts (Fact-246 - Fact-259) that match the CE of the accumulate. As a result of this rule a fact is inserted (MAIN::AskQuestion), which should contain the collected list in slot (affectedFacts ?rr). The resulting fact Fact-466 contains duplicates and values that are not even in the matching facts.

Is this a bug, or what am I doing wrong here?

Kind regards

Felix Bachmann

--------------------------------- rule -----------------------
(defrule ImpactAnalysis::__AskcostOfChangeQuestion__
  (declare (salience 500))
  (MAIN::initial-fact)
  ?rr <- (accumulate
    (bind ?res (create$))
    (bind ?res (insert$ ?res 1 ?_20_own))
    ?res
(ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner ?_20_own) (source ArchE)))
  (test (> (length$ ?rr) 0))
(not (MAIN::AskQuestion (questionId costOfChange) (answerAvailable nil)))
  =>
  (bind ?def (create$))
  (foreach ?r ?rr (bind ?def (insert$ ?def 1 \"0.0\")))
(assert (MAIN::AskQuestion (questionId costOfChange) (questionGroup nil) (parent nil) (affectedFacts ?rr) (parameters ) (options ?rr) (default ?def) (answer ) (answerAvailable nil) (log nil))))
------------------ rule fires ---------------------
Jess> FIRE 1 ImpactAnalysis::__AskcostOfChangeQuestion__ f-0, f--2,,
------------------ facts immediately after this rule -----------------
f-246 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-106>) (source ArchE) (status nil)) f-247 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-105>) (source ArchE) (status nil)) f-249 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-103>) (source ArchE) (status nil)) f-251 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-101>) (source ArchE) (status nil)) f-252 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-100>) (source ArchE) (status nil)) f-253 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-99>) (source ArchE) (status nil)) f-254 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-98>) (source ArchE) (status nil)) f-255 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-97>) (source ArchE) (status nil)) f-256 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-96>) (source ArchE) (status nil)) f-257 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-95>) (source ArchE) (status nil)) f-259 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner <Fact-93>) (source ArchE) (status nil))
   ....
f-466 (MAIN::AskQuestion (questionId costOfChange) (questionGroup nil) (parent nil) (affectedFacts <Fact-93> <Fact-106> <Fact-94> <Fact-94> <Fact-95> <Fact-96> <Fact-97> <Fact-98> <Fact-99> <Fact-100> <Fact-101> <Fact-102> <Fact-102> <Fact-103> <Fact-104> <Fact-91> <Fact-91> <Fact-104> <Fact-92> <Fact-92> <Fact-105>) (parameters ) (options <Fact-93> <Fact-106> <Fact-94> <Fact-94> <Fact-95> <Fact-96> <Fact-97> <Fact-98> <Fact-99> <Fact-100> <Fact-101> <Fact-102> <Fact-102> <Fact-103> <Fact-104> <Fact-91> <Fact-91> <Fact-104> <Fact-92> <Fact-92> <Fact-105>) (default "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0") (answer ) (answerAvailable nil) (log nil))



[Attachment, skipping...]



---------------------------------------------------------
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://herzberg.ca.sandia.gov

--------------------------------------------------------------------
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]
--------------------------------------------------------------------


begin:vcard
fn:Felix Bachmann
n:Bachmann;Felix
org:Software Engineering Institute - Carnegie Mellon University;SEI-PLS
adr;dom:;;4500 5th Avenue;Pittsburgh;PA;15213
email;internet:[EMAIL PROTECTED]
tel;work:+1 (412) 268 6194
tel;fax:+1 (412) 268 5758
url:http://www.sei.cmu.edu
version:2.1
end:vcard

Reply via email to