TRUE CLIPS> (batch "tmplmslt.bat") TRUE CLIPS> (clear) CLIPS> (deftemplate foo (multislot a) (slot x) (multislot b) (slot y)) CLIPS> (defrule bar (foo (a $?a) (b $?b) (x ?x) (y ?y)) => (printout t ?a " " ?b " " ?x " " ?y crlf)) CLIPS> (reset) CLIPS> (assert (foo)) CLIPS> (duplicate 1 (a) (b) (x 8)) CLIPS> (duplicate 1 (a) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1) (b) (x 8)) CLIPS> (duplicate 1 (a 1) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1 2) (b 3 4 5) (x 8)) CLIPS> (facts) f-1 (foo (a) (x nil) (b) (y nil)) f-2 (foo (a) (x 8) (b) (y nil)) f-3 (foo (a) (x 8) (b 1) (y nil)) f-4 (foo (a 1) (x 8) (b) (y nil)) f-5 (foo (a 1) (x 8) (b 1) (y nil)) f-6 (foo (a 1 2) (x 8) (b 3 4 5) (y nil)) For a total of 6 facts. CLIPS> (run) (1 2) (3 4 5) 8 nil (1) (1) 8 nil (1) () 8 nil () (1) 8 nil () () 8 nil () () nil nil CLIPS> (reset) CLIPS> (assert (foo (a) (b) (x 1) (y 2))) CLIPS> (duplicate 1 (a) (b) (x 8)) CLIPS> (duplicate 1 (a) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1) (b) (x 8)) CLIPS> (duplicate 1 (a 1) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1 2) (b 3 4 5) (x 8)) CLIPS> (facts) f-1 (foo (a) (x 1) (b) (y 2)) f-2 (foo (a) (x 8) (b) (y 2)) f-3 (foo (a) (x 8) (b 1) (y 2)) f-4 (foo (a 1) (x 8) (b) (y 2)) f-5 (foo (a 1) (x 8) (b 1) (y 2)) f-6 (foo (a 1 2) (x 8) (b 3 4 5) (y 2)) For a total of 6 facts. CLIPS> (run) (1 2) (3 4 5) 8 2 (1) (1) 8 2 (1) () 8 2 () (1) 8 2 () () 8 2 () () 1 2 CLIPS> (reset) CLIPS> (assert (foo (a 1) (b 2) (x 3) (y 4))) CLIPS> (duplicate 1 (a) (b) (x 8)) CLIPS> (duplicate 1 (a) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1) (b) (x 8)) CLIPS> (duplicate 1 (a 1) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1 2) (b 3 4 5) (x 8)) CLIPS> (facts) f-1 (foo (a 1) (x 3) (b 2) (y 4)) f-2 (foo (a) (x 8) (b) (y 4)) f-3 (foo (a) (x 8) (b 1) (y 4)) f-4 (foo (a 1) (x 8) (b) (y 4)) f-5 (foo (a 1) (x 8) (b 1) (y 4)) f-6 (foo (a 1 2) (x 8) (b 3 4 5) (y 4)) For a total of 6 facts. CLIPS> (run) (1 2) (3 4 5) 8 4 (1) (1) 8 4 (1) () 8 4 () (1) 8 4 () () 8 4 (1) (2) 3 4 CLIPS> (reset) CLIPS> (assert (foo (a 1 2) (b 3 4 5) (x 6) (y 7))) CLIPS> (duplicate 1 (a) (b) (x 8)) CLIPS> (duplicate 1 (a) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1) (b) (x 8)) CLIPS> (duplicate 1 (a 1) (b 1) (x 8)) CLIPS> (duplicate 1 (a 1 2) (b 3 4 5) (x 8)) CLIPS> (facts) f-1 (foo (a 1 2) (x 6) (b 3 4 5) (y 7)) f-2 (foo (a) (x 8) (b) (y 7)) f-3 (foo (a) (x 8) (b 1) (y 7)) f-4 (foo (a 1) (x 8) (b) (y 7)) f-5 (foo (a 1) (x 8) (b 1) (y 7)) f-6 (foo (a 1 2) (x 8) (b 3 4 5) (y 7)) For a total of 6 facts. CLIPS> (run) (1 2) (3 4 5) 8 7 (1) (1) 8 7 (1) () 8 7 () (1) 8 7 () () 8 7 (1 2) (3 4 5) 6 7 CLIPS> (reset) CLIPS> (watch facts) CLIPS> (assert (foo (a) (b) (x 1) (y 2))) ==> f-1 (foo (a) (x 1) (b) (y 2)) CLIPS> (modify 1 (a 1)) <== f-1 (foo (a) ...) ==> f-1 (foo (a 1) ...) CLIPS> (modify 1 (b 1)) <== f-1 (foo ... (b) ...) ==> f-1 (foo ... (b 1) ...) CLIPS> (modify 1 (a 1 2)) <== f-1 (foo (a 1) ...) ==> f-1 (foo (a 1 2) ...) CLIPS> (modify 1 (b 1 2 3)) <== f-1 (foo ... (b 1) ...) ==> f-1 (foo ... (b 1 2 3) ...) CLIPS> (modify 1 (a)) <== f-1 (foo (a 1 2) ...) ==> f-1 (foo (a) ...) CLIPS> (modify 1 (b 1)) <== f-1 (foo ... (b 1 2 3) ...) ==> f-1 (foo ... (b 1) ...) CLIPS> (modify 1 (a 1) (b 1 2)) <== f-1 (foo (a) ... (b 1) ...) ==> f-1 (foo (a 1) ... (b 1 2) ...) CLIPS> (modify 1 (a 1 2) (b)) <== f-1 (foo (a 1) ... (b 1 2) ...) ==> f-1 (foo (a 1 2) ... (b) ...) CLIPS> (modify 1 (a) (b)) <== f-1 (foo (a 1 2) ...) ==> f-1 (foo (a) ...) CLIPS> (unwatch facts) CLIPS> (dribble-off)