|
Hi,
What is the problem here? It appears that
the code below produces an unexpected nested multifield.
When variable $?x is removed from rule r1 the
code behaves as expected.
Thanks,
Marc.
;***** SAMPLE ****
(clear)
(reset) (watch all) (deftemplate foo1 (multislot a))
(deftemplate foo2 (multislot b)) (do-backward-chaining foo2) (assert (foo1 (a)))
(defrule r1
(foo1 (a $?x)) (foo2 (b $?x))=>) (defrule r2
(need-foo2 (b ?head $?tail)) => (printout t "> head:" ?head " tail:" $?tail crlf)) (run)
;**** OUTPUT: ****
Jess> ==> f-1 (MAIN::foo1 (a
))
<Fact-1> Jess> ==> f-2 (MAIN::need-foo2 (b )) MAIN::r1: +1+1+1+1+1+2+t TRUE Jess> ==> Activation: MAIN::r2 : f-2, MAIN::r2: +1+1=1+1+1+2+t TRUE Jess> FIRE 1 MAIN::r2 f-2, > head:() tail:() <== Focus MAIN 1 |
