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

[Fwd: [PRD] Difficult test case?]

From: Gary Hallmark <gary.hallmark@oracle.com>
Date: Tue, 06 Jan 2009 10:28:10 -0800
Message-ID: <4963A2BA.5010805@oracle.com>
To: RIF WG <public-rif-wg@w3.org>
sending to a wider distribution in case it comes up at the F2F...

attached mail follows:


Will the following rule fire only once, or loop forever?

_o[_x->1]
if ?o[_x->1] then Do(Retract(?o[_x->1]) Assert(?o[_x->1]))

I think the semantics predicts it will fire once, but most 
implementations will loop forever.  The reason is that in our semantics,
assert and retract simply update working memory, and we consult history 
to see if working memory has changed from once cycle to the next.  In 
real implementations, especially those tightly integrated with a 
programming language such as Java, there is no reliable history that one 
can consult to see if working memory has changed -- instead, the assert 
and modify actions signify a change, even if the actual values did not 
change.

Also, our semantics treats the following two equivalent conditions 
differently with respect to refraction.  Clearly the semantics is not 
quite right:

if ?o[_x->1]
if ?o[_x->?x] and ?x=1

We may need to speak of "normalizing" frames and predicates in 
conditions so only variables can appear and not constants, or we need to 
change the definition of Var() somehow so that it yields the same result 
when applied to either of the above conditions.
Received on Tuesday, 6 January 2009 18:29:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:34:00 GMT