Looks perfect, and should work fine. The only way it might not work -- that I can think of -- would be if some of the slots of those facts are populated with Java objects with bad (i.e., changing over time) hashcode values, in which case working memory can be corrupted.

You say you know the rule is firing; did you use "watch all" and if so, do you see something like this, where you can see both the rules firing and the facts being retracted?

FIRE 1 MAIN::remove-end-mill-non-indexable f-4, f-3
<== f-3 (MAIN::end_mill_non_indexable (name n4) (diameter nil) (length nil) (flutelength nil) (flutes nil) (cornerradius nil) (material nil))
FIRE 2 MAIN::remove-end-mill-non-indexable f-4, f-2
<== f-2 (MAIN::end_mill_non_indexable (name n3) (diameter nil) (length nil) (flutelength nil) (flutes nil) (cornerradius nil) (material nil))
FIRE 3 MAIN::remove-end-mill-non-indexable f-4, f-1
<== f-1 (MAIN::end_mill_non_indexable (name n2) (diameter nil) (length nil) (flutelength nil) (flutes nil) (cornerradius nil) (material nil))
FIRE 4 MAIN::remove-end-mill-non-indexable f-4, f-0
<== f-0 (MAIN::end_mill_non_indexable (name n1) (diameter nil) (length nil) (flutelength nil) (flutes nil) (cornerradius nil) (material nil))



On Apr 15, 2010, at 9:16 AM, Adam Malik wrote:

Dear Jess users,

My JESS-code contains two templates,

(deftemplate MAIN::end_mill_non_indexable
   (slot name) (slot diameter) (slot length) (slot flutelength) (slot
flutes) (slot cornerradius) (slot material))

and

(deftemplate MAIN::face
    (slot length)
    (slot width)
    (slot roughness)).

The working memory contains end_mill_non_indexable facts.

This is the rule I want to fire:

(defrule MAIN::remove-end-mill-non-indexable
    "removes some tools"
                ?f <- (face)
                ?t <- (end_mill_non_indexable)
    =>
                (retract ?t)
    )

If I assert a face-fact the rule is firing but the retract-command seems not
to be working correctly. The working memory still contains all
end_mill_non_indexable facts. Why? The rule should remove ALL
end_mill_non_indexable facts!

Thanks in advance for your help.

Adam




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

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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].
--------------------------------------------------------------------

Reply via email to