[Fwd: [PRD] Difficult test case?]

sending to a wider distribution in case it comes up at the F2F...

Forwarded message 1

  • From: Gary Hallmark <gary.hallmark@oracle.com>
  • Date: Thu, 11 Dec 2008 14:46:16 -0800
  • Subject: [PRD] Difficult test case?
  • To: Christian de Sainte Marie <csma@ilog.fr>, Adrian Paschke <adrian.paschke@biotec.tu-dresden.de>
  • Message-ID: <49419838.8050404@oracle.com>
Will the following rule fire only once, or loop forever?

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 

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 UTC