sorry not to describe my problem clearly. Thanks in advace for your help.  I
try to explain it here.

To save the memory space and implement that a fact is used only once, I do
not store all the facts in JESS. I only want to store those facts that cause
partial matches. For example, e3 only fire rule 2, and e3 is used only once
in our system, then I want to remove e3 from JESS after it fires rule 2. I
cannot remove it unless I can distinguish whether there is a partial match
or not. Otherwise, I'll remove some facts by mistake. For instance, e1 and
e2 together will fire rule1. if e1 comes first, ideally  I should store e1
and wait for e2, after e2 comes, I want to remove e1 and e2 from JESS.
Although e1 fires nothing at first, I can not remove it from JESS because it
has a partial match for rule1.

If a rule comes after a fact, I do not want the rule being fired by the old
fact. That is the reason why I want to remove facts from JESS after using
them. Maybe it is not a traditional way to use JESS? I can use JESS to
support my system with only primitve event rules well. Now I want to support
composite event rules. Here comes my problem about partial match.

Is it clear? Is there a way to tell whether there is a partial match? Thanks
a lot for your patience!

regard,

guoli


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 19, 2004 11:28 AM
Subject: Re: JESS: about partial match of a rule


> I think Guoli Li wrote:
> [Charset iso-8859-2 unsupported, filtering to ASCII...]
> > Hi, all,
> >
> > Now I'm using JESS. I have a question, and I'll show it with an example.
Here
> > are two rules:
> >
> > Rule 1: e1 ^ e2 => printout e1 and e2 happened
> >
> > Rule 2: e3 => printout e3 happend
> >
> > when e3 comes, I do the following: 1.(assert e3) 2. (run) rule 2 is
fired, and
> > e3 is only for rule 2, and I can retract it using (retract e3) after
(run).
> >
> > While for e1 and e2 things are different.
> >
> > when e1 comes, no rules are fired, but their is a partial match of rule
1. I
> > need to store e1 until e2 comes. My question is " how could I find when
a fact
> > triggers part of a rule?" and " can I retract a fact according to its
content,
> > e.g. the slot value?"
> >
> >
>
> I'm having a hard time understanding what you're saying here; it
> sounds like you're making something very simple into something very
> complicated. Jess "remembers" all the facts that are asserted, and a
> rule that matches two facts will match regardless of the order in
> which the facts arrive; references to both facts can be obtained by
> the right-hand-side of the rule, where they can be retracted
> directly. Thus you can simply write rule 1 to print the message and
> retract the two facts, and everything will work just fine without any
> special consideration.
>
>
>
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Science and Engineering PSEs        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]
> --------------------------------------------------------------------
>

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