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