                                   (when (or (nil? remember) (btree/key-not= key remember))
                                     (.push forgets key)))))
                     (.add-facts this "know" name fields remembers)
-                    (.del-facts this "know" name fields forgets))))
+                    (.del-facts this "know" name fields forgets)
+                    (or (> (alength remembers) 0) (> (alength forgets) 0)))))
   (tick [this name->transient?]
-        (let [names (js/Object.keys name->transient?)]
+        (let [names (js/Object.keys name->transient?)
+              changed? false]
           (dotimes [i (alength names)]
             (let [name (aget names i)]
               (if (true? (aget name->transient? name))
                 (.clear-facts kn name)
-                (.update-facts kn name)))))))
+                (when (true? (.update-facts kn name))
+                  (set!! changed? true)))))
+          changed?))
+  (quiesce [this name->transient?]
+           (while (true? (.tick this name->transient?)))))
 
 (defn knowledge []
   (Knowledge. {}))

                 (recur 0))
               (recur (+ i 1)))))))
  (tick [this kn]
        (.tick kn name->transient?)))

;; COMPILER



(.get-or-create-index kn "forget" "str-edge" #js ["name"])

(.quiesce flows kn)

(.get-or-create-index kn "know" "edge" #js ["x" "y"])

