I'm not sure what you're doing, but if I define this rule, assert
these facts, and run, I get an infinite loop, with a combinatorial
explosion of new activations. There's nothing here to restrict a and b
to be unequal, or likewise c and d, so this blows up.

Honestly, this is really a procedural thing you want to do, so it's
best if you just use a procedural solution. Use a defquery to find all
the "con" facts, add each value to a java.util.HashSet, and then
extract all the values from the HashSet and assert them as a new fact.


I think [EMAIL PROTECTED] wrote:
[Charset windows-1252 unsupported, filtering to ASCII...]
> Hi
> 
> I have this facts:
> (con 1 2)
> (con 2 3)
> (con 3 7)
> and I want to generate the following fact, with all the elements 
> contained in the facts, but without repeating them:
> (con 1 2 3 7)
> 
> The rule I wrote searches common elements between facts and asserts a 
> new one:
> 
> (defrule cons
>     (con $?a ?n $?b)
>     (con $?c&~$?a ?n $?d&~$?b)
> =>
>     (assert (con $?a $?b ?n $?c $?d))
> )
> 
> but the rule doesnt fire. Why????
> 
> How can I modify it to get the result I expect????
> 
> Thanks
> 
> Gerardo Becerra
> Pontificia Universidad Javeriana
> Bogota, Colombia.
> 
> --------------------------------------------------------------------
> 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
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]
--------------------------------------------------------------------

Reply via email to