I think Nik Joshi wrote:
>
> So, my question is if there is any way to get the one alert fact to activate
> tryrule 3 times and then be able to automatically retract the fact?
>
Break tryrule into two rules; one that prints the message, and another
that retracts the fact. Give this second one a negative salience
value.
(defrule tryrule1a
?a1 <- (alert (name ?name1) (globfacts $? ?gf1 $?))
(test (> ?gf1 10))
=>
(printout t "Got num: " ?gf1 crlf)
)
(defrule tryrule1b
(declare (salience -10))
?a1 <- (alert (name ?name1) (globfacts $? ?gf1 $?))
(test (> ?gf1 10))
=>
(retract ?a1)
)
You'll get the behavior you want.
>
> Question 2. I have a multislot in a fact that matches on the LHS of a rule.
> I want to be able to access the entire multislot AS WELL AS one single
> expression within the multislot on the RHS of the rule. E.g.:
>
> (defrule tryrule
> (alert (name ?name1) (globfacts $?gfall))
> =>
>
You can use the multislot functions (nth$, in particular) to dissect
the multislot on the rule's RHS.
---------------------------------------------------------
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]
--------------------------------------------------------------------