Read Jess 6 manual sections 2.8.1, "Defrules," and 2.8.1.4, "'Not'
patterns." Synopsis: the things on rule LHSs are always -patterns-,
never function calls, but you've written the function call
(not(member$ ?path $?list)). This will be true whenever there is no
fact that matches "(member$ ?path $?list)." Presumably you never have
such facts, so this pattern always succeeds.
If you want to use a function on a rule LHS, see section 2.8.1.5, "The
'test' conditional element."
I think [EMAIL PROTECTED] wrote:
> Hi to all,
>
> I have a bug in my code that eludes me. I have defined paths and a list to
> hold them:
>
> (deftemplate path
> (slot name)
> (slot cost))
>
> (deftemplate path-list
> (multislot list))
>
> Then I tried to set a rule that would add any paths (actually their fact#) to
> the list if they were not there already:
>
> (defrule add-path-to-list
> ?path <- (path)
> ?pathlist <- (path-list(list $?list))
> (not(member$ ?path $?list))
> =>
> (modify ?pathlist (list (create$ $?list ?path))))
>
> This adds paths to the list, but will continue to add them even though they
> are in the list. Any Assistance would be greatly appreciated.
>
> Matt J
>
> ---------------------------------------------------------------------
> 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
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------