If you can't delete the row facts, then either add a "processed" slot
to them so you can modify them to mark them "done", then match "not
done" on the left hand side of the rule, and remove the "no-loop"
declaration; or otherwise use an auxilliary, temporary fact to
indicate that a given row fact has been processed, and again, match
these (or more properly, match the absence of these) on the left hand
side of the rule.


I think yuping he wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi Ernest:
> 
>  Thank you for your answers. I tried (no-loop TRUE) before and I got  f-1
> (MAIN::row (y 0) (data b)) as result.
>  The result I want to get is f-1 (MAIN::row (y 0) (data a b))
>  Do you know how should I change the rule for this to happen without
> retracting ?word fact. (i.e., other rules might reuse the word facts in the
> LHS)
> 
> Thanks.
> Yuping
> 
> 
> On 5/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > "slot-specific" means that modifications to slots that are not matched
> > in the conditions of a rule won't cause the rule to be activated. But
> > this rule matches the "data" slot, and modifies that same slot, so
> > it's an infinite loop -- and it's supposed to be.
> >
> > If you want to break this infinite loop specifically, then that's what
> > the "no-loop" declaration in defrules is for. Perhaps that's what you
> > were thinking of in the first place.
> >
> >
> > I think yuping he wrote:
> > [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > > **
> > > *Hi, I have the following piece of code*
> > > It just adds two words to the row template
> > > Both are slot-specific TRUE, however, myrule gets reactivated after row
> > > templates being modified (infinite loop)
> > >
> > > *(clear)
> > > (reset)
> > > (watch all)
> > > (deftemplate row (declare (slot-specific TRUE)) (slot y) (multislot
> > data))
> > > (deftemplate word  (declare (slot-specific TRUE)) (slot y) (slot text))
> > > (assert (row (y 0)))
> > > (assert (word (y 0) (text a)))
> > > (assert (word (y 0) (text b)))
> > > (defrule myrule
> > >  ?row <- (row (y ?y) (data $?data))
> > >  ?word <- (word (y ?y) (text ?text))
> > > =>
> > >  (bind $?data (insert$ $?data (+ (length$ $?data) 1) ?text))
> > >  (printout t $?data crlf)
> > >  (modify ?row (data $?data))
> > > )
> > > (run)*
> > > **
> > > *Thanks.
> > > Yuping*
> >
> >
> >
> > ---------------------------------------------------------
> > 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]



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

Reply via email to