RE: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Friedman-Hill, Ernest
re once for every bag for which this condition holds. -Original Message- From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On Behalf Of Aurelien Mazurie Sent: Wednesday, July 31, 2013 1:13 AM To: jess-users Subject: Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS Thank yo

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Wolfgang Laun
On 30/07/2013, Aurelien Mazurie wrote: > Thank you very much for this answer. It seems like 'forall' will fire the > rule only if all the 'bag-of-items' facts are validated (i.e., if all of > them have 'item' facts with the names listed in their 'names' slot). Is that > correct? Yes. > > If yes,

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Aurelien Mazurie
Thank you for this tip. It is not what I am trying to achieve, however. I must apologize if my original email was misunderstood. My goal is to write a rule that would fire for any 'bag-of-items' fact whose item names, as listed in a multislot, are all represented by 'item' facts. The rule shoul

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Aurelien Mazurie
Thank you very much for this answer. It seems like 'forall' will fire the rule only if all the 'bag-of-items' facts are validated (i.e., if all of them have 'item' facts with the names listed in their 'names' slot). Is that correct? If yes, then what I am trying to do is slightly different. I do

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Jason Morris
Another "old skool" way of doing it using predicate constraints is... (clear) (deftemplate item (slot name)) (deftemplate bag-of-items (multislot item-names)) (defrule fire-for-all-members-in-bag ; If you have a bag of item names ... (bag-of-items (item-names $?item-names)) ; and there is a

RE: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Friedman-Hill, Ernest
set (initial-fact). -Original Message- From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On Behalf Of Aurelien Mazurie Sent: Friday, July 26, 2013 4:56 PM To: jess-users Subject: JESS: [EXTERNAL] Dynamic rule matching in the LHS Dear Jess users, I am wondering how t

JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Aurelien Mazurie
Dear Jess users, I am wondering how to write a rule that would dynamically match multiple facts based on their names. Let say I have two types of facts; one representing the information that an item (with a given name) exists, and the other one representing a list of items (e.g., as a list of name