Sorry for the wacky subject line, but can't think of a good way to
describe what I'm attempting.

Suppose I had something like the following:

(deftemplate some-state (multislot list-o-things))
(deftemplate thing (slot id) (slot state (default "1")))

(defrule transition-2
    (some-state (list-o-things $? $?thing-id $?))
    ?thing <- (thing (id ?thing-id) (state "1"))
    =>
    (modify ?thing (state "2"))
    )

(defrule transition-3
    (some-state (list-o-things $? $?thing-id $?))
    ?thing <- (thing (id ?thing-id) (state "2"))
    =>
    (modify ?thing (state "3"))
    )

Note that the "some-state" fact multislot refers to the "thing" facts
indirectly, through an id - this is important, as I cannot have the
"things" embedded in the list, rather they have to be separate facts
that stand on their own.

What I would like to do is define a rule which will fire when all the
elements referred to in the multi-slot are in a particular state.  For
example, I'd like to define a rule which detects when all of the
"things" referred to in the list have "state" value of "2".  Note that
the size of the list can vary between instances of the "some-state",
and the ids are literally UUIDs,  so I can't simply lay down a rule
which enumerates the id's of the "thing"s.

I can't for the life of me figure out how to write such a rule.  So....

a) is it possible at all...
b) what would it look like if it was possible.

Thanks for your consideration.


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