sixthnormal / clj-3df

Clojure(Script) client for Declarative Dataflow.
Eclipse Public License 2.0
328 stars 13 forks source link

FnExpr symbols and implicit clause order #16

Closed bachdavi closed 5 years ago

bachdavi commented 5 years ago

Quoting: At the very least, result-sym should be part of the bound symbols. But we also have to think about whether the ouput binding is supposed to replace the input binding, or whether they co-exist, etc...

comnik commented 5 years ago

I think we have to be even more careful. Assuming the current semantics of transform, which replace the input binding, rather than tacking on output bindings, consider

[(transform ?x) ?y]
[(satisfies? x)]

Clearly we have to implement the predicate first, because the predicate might not make sense for transformed values. Similarly

[(transform ?x) ?y]
[(satisfies? y)]

would have to be unified the other way round.

This leads me to believe that the in-place semantics are (as always) the problem, and we should move to transform meaning the following:


;; input tuples
[?x0 ?x1 ?x2 ...] [?x0 ?x1 ?x2 ...] [?x0 ?x1 ?x2 ...]
;; transform
[(transform ?x1) ?y1]
;; output tuples
[?x0 ?x1 ?x2 ... ?y1] [?x0 ?x1 ?x2 ... y1] [?x0 ?x1 ?x2 ... ?y1]