Hi,
I have a little problem with firing rules in different modules
accessing facts in MAIN.
For example, the following works as expected:
(assert (fact1))
(defmodule MODULE1)
(defrule rule1
(fact1)
=>
(assert (fact2)))
(focus MODULE1)
(run)
Whereas the following does not:
(defmodule MODULE1)
(defrule rule1
(fact1)
=>
(assert (fact2)))
(assert (MAIN::fact1))
(focus MODULE1)
(run)
It seems like inserting the fact AFTER defining the rule does not
work here.
You have to define the template before defining the fact to make it
work again:
(deftemplate fact1)
(defmodule MODULE1)
(defrule rule1
(fact1)
=>
(assert (fact2)))
(assert (MAIN::fact1))
(focus MODULE1)
(run)
But, on the other side, the following works again:
(defmodule MODULE1)
(defrule rule1
(MAIN::fact1)
=>
(assert (fact2)))
(assert (MAIN::fact1))
(focus MODULE1)
(run)
This looks kind of wrong to me, since the rule should always look
for the facts in MAIN if not found in
the focus model. Can you explain this behaviour to me? I could not
find an explanation in the manual.
Thank you, Julian Hoch
--------------------------------------------------------------------
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]
--------------------------------------------------------------------