W3C home > Mailing lists > Public > public-rif-wg@w3.org > November 2009

Fwd: Clips behavior

From: Gary Hallmark <gary.hallmark@oracle.com>
Date: Wed, 25 Nov 2009 08:14:18 -0800
To: RIF WG <public-rif-wg@w3.org>, Neal Wyse <neal.wyse@oracle.com>
Message-ID: <4B0C5035.1030801@oracle.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 November 2009 16:15:34 GMT