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 names in a multislot). It could be something like

  (deftemplate item (slot name))
  (deftemplate bag-of-items (multislot names))

  (assert (item (name A))
  (assert (bag-of-items (names A B))

What I am trying to write is a rule that would, for any bag-of-items fact,
fire if all the items listed in the multislot 'name' are item facts that
have been asserted.

I am wondering if there is an easy way to do that, or if I'll need to hack
my way through it with loops and tests in the LHS of my rule.

Any suggestion?

View this message in context:
Sent from the Jess mailing list archive at

To unsubscribe, send the words 'unsubscribe jess-users'
in the BODY of a message to, NOT to the list
(use your own address!) List problems? Notify

Reply via email to