                  [plan node] (add-flow plan (->FilterMap nodes filter-map-fun))]
              [plan [node] vars]))))
 
+(comment
+  (let [plan empty-flow-plan
+        [plan nodes-a vars-a] (recall->nodes plan (Recall. :known&pretended (->edge 'x 'y)))
+        [plan nodes-b vars-b] (compute->nodes plan nodes-a vars-a (Compute. (->Let 'z '[x y] "x + y")))]
+    [plan nodes-a nodes-b vars-a vars-b])
+
+
+  (let [plan empty-flow-plan
+        [plan nodes-a vars-a] (recall->nodes plan (Recall. :known&pretended (->edge 'x 'y)))
+        res (compute->nodes plan nodes-a vars-a (Compute. (->Let 'z '[w x y] "w + x + y")))]
+    res)
+
+  (let [plan empty-flow-plan
+        [plan nodes-a vars-a] (recall->nodes plan (Recall. :known&pretended (->edge 'x 'y)))
+        [plan nodes-b vars-b] (compute->nodes plan nodes-a vars-a (Compute. (->When '[x y] "x > y")))]
+    [plan nodes-a nodes-b vars-a vars-b])
+  )
+
 (defn computes->nodes [plan nodes vars computes]
     (loop [orig-nodes nodes
            plan plan

        [plan lookup-b] (add-flow plan (->Lookup [index-b] index-a key-ixes-b val-ixes-b))]
    [plan [lookup-a lookup-b] (distinct (concat vars-a vars-b)) (union computes-applied-a computes-applied-b)]))

;; RULES

(defrecord Rule [clauses])

  (let [[plan node] (add-flow plan (FilterMap. (memory->nodes memory) (pattern->deconstructor pattern)))]
    [plan [node] (pattern->vars pattern)]))

(comment
  (let [plan empty-flow-plan
        [plan nodes-a vars-a] (recall->nodes plan (Recall. :known&pretended (->edge 'x 'y)))
        [plan nodes-b vars-b] (recall->nodes plan (Recall. :known (->connected 'x 0)))]
    [plan nodes-a nodes-b vars-a vars-b])
  )

;; if clause can be calculated somehow then return a new [plan node vars] pair that calculates it
;; TODO make this extensible
(defn compute->nodes [plan nodes vars {:keys [pattern]}]
