           q   (add-query _ qid query)
           inf (f/add-vertex! g {:val #{} ::f/collect-fn (collect-inference _ production)})]
       (f/add-edge! g (:result q) inf f/signal-forward nil)
-      inf))
+      {:query q :inf inf}))
   )
 
 (defn triple-graph

   (fn [_ incoming]
     (let [res (vals (peek incoming))]
       (delay
        (when (and (seq res) (every? #(not= #{nil} %) res))
          (->> res
               (map #(disj % nil))
               (set)


(defn signal-select
  [vertex [idx sel]]
  [idx (if sel (@vertex sel [nil]) (->> @vertex vals (mapcat identity)))])

(def collect-select
  (f/simple-collect
