-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accumulator bindings can remain after the facts that created those bindings are retracted #188
Comments
Good find. This is similar enough to #189 that I'll comment on both here, at least for now. I think we need to add a check when the last value is retracted and include logic similar to the logic at [1], where we only send the initial value if all bindings are satisfied. (Not clear how to do this check that the "last" value is retracted for an accumulator. I'm going to take a closer look at that.) As for the discussion in #102, I had forgotten about that issue but think that we shouldn't propagate down the network unless all variables can be bound, which I think is what I was trying to do with the logic at [1]. That would actually simplify the fix to this problem, since we'd propagate the initial value per distinct set of bindings in the accumulator, which fits in nicely with the existing flow since we activate the accumulator with each distinct set of bindings. Furthermore, I like the guarantee that a rule can only be activated if everything is bound...eliminates errors from subsequent tests and the rule itself. |
I see two broad approaches on how to check that the last value is retracted:
|
@rbrush I agree. Closing. |
I'd expect the ?temperature binding go away in the following case:
However, it does not:
I believe the reason for this is that when we retract an element
from an AccumulateNode we repropagate the new result, if any exists,
with the same bindings as the token that was retracted. [1]
The same behavior exists for the AccumulateWithJoinFilterNode [2].
However, if the original elements that created these bindings in the
first place are retracted it is no longer valid for these bindings to exist.
I discovered this while writing tests for [3] but the behavior is the same both before
and after those changes; this is a different concern.
The text was updated successfully, but these errors were encountered: