            (dotimes [j (alength dirtied-rules)]
              (aset rule->dirty? (aget dirtied-rules j) true))))))
 
-(deftype SolverFlow [solver sinks]
+(deftype SolverFlow [solvers sinks]
   Object
   (run [this kn rule->dirty? kind->name->rules]
-       (.reset solver)
-       (let [facts&vals (.elems solver)]
+       (let [facts&vals #js []]
+         (dotimes [i (alength solvers)]
+           (let [solver (aget solvers i)]
+             (.reset solver)
+             (js/Array.prototype.push.apply facts&vals (.elems solver))))
          (dotimes [i (alength sinks)]
            (.run (aget sinks i) kn rule->dirty? kind->name->rules facts&vals)))))
 

(ns aurora.language
  (:require [aurora.btree :as btree])
  (:require-macros [aurora.macros :refer [apush aclear set!!]]))

;; KNOWLEDGE


            (swap! rule->flow assoc agg-rule-id (AggregateFlow. index group-len limit-ix ascending? agg-ixes agg-funs sinks))
            (swap! kind->name->rules update-in ["know" (str "delta-" agg-index-id)] conj agg-rule-id)))))

    (doseq [[rule-id clauses] @rule-id->clauses]
      (let [var->when-count (atom {})]

