sending to a wider distribution in case it comes up at the F2F...
Forwarded message 1
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.