Fwd: Clips behavior

A colleague and I have tested OBR, Jess, and Clips refraction behavior. All are consistent. All contradict PRD. I do not think the issue is whether actions are effective immediately, although there may also be issues with that. Rather, the issue ssems to be that PRD should consider all rule vars in the IF part, even existential vars, as part of the rule instance. Thus far, I have only heard that ILOG works like PRD says, and I haven't actually seen a test report verifying that.

-------- Original Message --------
Subject: Clips behavior
From: Neal Wyse <neal.wyse@oracle.com>
To: Gary Hallmark <Gary.Hallmark@oracle.com>
CC: null

Hi Gary,

I've attached 3 Clips examples.
rif1.clp - Modify_loop test
rif2.clp, rif3.clp - two approaches to the Modify_noloop test
They all loop with Clips which is what I expected.
I'm not sure if we can get closer than that for the noloop test.

Neal
(deftemplate foo
    (slot count)
)

(defrule r3
 (and
   ?f1 <- (foo (count ?c))
   (not (not (test (> ?c 0))))
 )
 =>
 (modify ?f1 (count (- ?c 1)))
 (printout t (str-cat "r3 fired: ") ?c crlf)
)

(assert (foo (count 10)))
(run)
(deftemplate foo
    (slot count)
)

(defrule r1
   ?f1 <- (foo (count ?c&:(> ?c 0)))
 =>
 (modify ?f1 (count (- ?c 1)))
 (printout t (str-cat "r1 fired: ") ?c crlf)
)

(assert (foo (count 10)))
(run)
(deftemplate foo
    (slot count)
)

(defrule r2
 (and
   ?f1 <- (foo)
   (not (and  (foo (count ?c))
      (test (not (> ?c 0))))
   )
 )
 =>
 (bind ?cnt (fact-slot-value ?f1 count))
 ;(modify ?f1 (count (- (fact-slot-value ?f1 count) 1)))
 (modify ?f1 (count (- ?cnt 1)))
 (printout t (str-cat "r2 fired: ") ?cnt crlf)
)

(assert (foo (count 10)))
(run)

Received on Wednesday, 25 November 2009 16:15:33 UTC