Oh, now we have another possibility. I guess I was actually "thinking" of
marking a fact so that changes to it wouldn't activate rules at all, so that
only changes to the (x) fact would trigger count-x-facts. In effect, this
would convert the "fact" into a variable that nonetheless could be matched
like a fact (it just wouldn't figure into activating rules).

On 1/6/03 1:05 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> I think Prof. Michael Stiber wrote:
>> Please pardon me if I missed part of this discussion by overzealous email
>> deletions (holiday email cleanup), but is this property more appropriately
>> attached to the fact, rather than the rule (as is "logical")? In the example
>> below, the "count" template could be marked so that changes to it won't
>> re-activate any rules. This seems to match the intuition that the "count"
>> template below is a different _kind_ of fact than the "x" one.
> 
> 
> Well, first, yes, you're right, that's an interesting alternative way
> to express this -- a (single) or (one-shot) conditional element that
> would apply to patterns within a rule. That would give finer grained
> control at the expense of a little overhead for every rule (whether it
> used this feature or not.)
> 
> In the rule below, though, you'd actually want to mark the first
> pattern, not the second, yes? You'd want the rule to fire many times
> for the single (count) fact, but only once for the (x) fact, even when
> the (x)'s slots were modified.
> 
> 
>> 
>> On 1/5/03 4:01 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> 
>>>>> (defrule count-x-facts
>>>>>         (declare (one-shot TRUE))
>>>>>         (x)
>>>>>         ?count <- (count (x ?n))
>>>>>         =>
>>>>>         (modify ?count (x (+ ?n 1))))
> 
> 
> ---------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 
> 

-- 
Prof. Michael Stiber                    [EMAIL PROTECTED]
Computing and Software Systems          http://faculty.washington.edu/stiber
University of Washington, Bothell       tel: +1-425-352-5280
Box 358534, 18115 Campus Way NE         fax: +1-425-352-5216
Bothell, WA 98011-8246 USA

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