oracle-samples/clara-rules

Resolve behavior when an accumulator constraint binding may exist

Opened this issue · 0 comments

Along with the discussion in issue 373 here is another ambiguous case. There are enough such cases that I thought having a separate issue would be easier than interspersing comments on different cases in the main issue.

[:or [?a <- [A]]
     [?b <- [B]]]
[?facts <- (acc/all) :from [C (= field ?a)]]

In issue 102 we established the behavior for the case without an :or. Namely, that if ?a is bound by another condition, then we would fire with the initial value, if provided, for each value of ?a. However, in this case, ?a may or may not be bound as discussed here. We should also consider the behavior in the case where the order is reversed. My instinct here is that the logical semantics should not depend on ordering.

[?facts <- (acc/all) :from [C (= field ?a)]]
[:or [?a <- [A]]
     [?b <- [B]]]