oracle-samples/clara-rules

Define semantics of bindings used in consecutive accumulators

Opened this issue · 2 comments

An ugly edge case came up here that we should work out:

#102 (comment)

I copied Will's comment here for convenience:

Using the existing topological sort to create the bindings without relying on the ordering seems reasonable. The part that still seems ambiguous to me with that behavior is what happens when you have something like

(defquery two-temp-conditions
       []
       [?t1 <- (acc/all) :from [Temperature (< temperature 20) (= ?location location)]
      [?t2 <- (acc/all) :from [Temperature (even? temperature) (= ?location location)])

Which accumulator should be required to create a ?location binding? This sort of case is something I'd like to mull on some tonight.

A possible solution to this is discussed at [1]. I haven't done any work on it though apart from thinking about it enough to convince myself that the proposed solution would probably work. I think this will probably be simpler if we can keep it in the compiler (leaving the engine as is) and this approach would allow that.

  1. #102 (comment)

Yeah, this one is still interesting. However, I think it is less pressing than some of the other changes we have made to accumulators already. We have more than enough to release already I think. :)