Hi,
I'm not sure if this is a limitation, a bug, or just I'm not using
it the right way. In the following example, logical CE has rather
strange behavior - two rules interfere with each other. Any ideas?
Xiaocheng
; ---- group 1, doesn't sound right ----
;
(reset)
(assert (dep 1))
(defrule dep-rule-1 (logical (dep 1)) => (assert (success 1)))
(run)
(facts) ; looks ok so far.
(assert (dep 2))
(defrule dep-rule-2 (logical (dep 2)) => (assert (success 2)))
; **** The fact (success 1) is gone, right here!
(run)
(facts) ; all ok but (success 1) is gone.
; ---- group 2, works fine ----
(reset)
(assert (dep-1 1))
(defrule dep-rule-1 (logical (dep-1 1)) => (assert (success 1)))
(run)
(facts)
(assert (dep-2 2))
(defrule dep-rule-2 (logical (dep-2 2)) => (assert (success 2)))
(run)
(facts)
Below I tested template, it has similar problems.
; ---- group 3, template ----
(reset)
(deftemplate person (slot name) (slot age))
(assert (person (name john) (age 10)))
(defrule dep-rule-1
(logical (person (name john) (age 10)))
=>
(assert (success 1))
)
(run)
(facts) ; looks ok so far.
(assert (person (name john) (age 20)))
(defrule dep-rule-2
(logical (person (name john) (age 20)))
=>
(assert (success 2))
)
; **** The fact (success 1) is gone, right here!
(run)
(facts)
- The End.
--------------------------------------------------------------------
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]
--------------------------------------------------------------------