                (doseq [[other-fields other-index] indexes]
                  (when (-add-facts facts fields other-index (into-array other-fields))
                    (set!! changed? true)))
-               (when changed?
-                 (set! version (+ version 1)))))
+               changed?))
   (tick [this])
   ;; TODO Knowledge.tick using array of flows, needs dirty tracking per flow (requires map from index to flow)
   (tock [this]))
 
 (defn knowledge []
-  (Knowledge. {} 0))
+  (Knowledge. {}))
 
 ;; COMPILER
 

                                           clause-vars-ixes (map var->ix clause-vars)
                                           clause-keys (map second clause-vars&keys)
                                           index (.get-or-create-index kn "know" name (into-array clause-keys))]
                                       [(btree/contains (btree/iterator index)) (into-array clause-vars-ixes)]))))

              ;; make solver

                                                                                             #js ["make-str" "constant" "js" "\"edge \" + xx + \" \" + yy"]
                                                                                             #js ["know-str" "variable" "name" "zz"]])

(def flows (compile kn))

(set! (.-rules flows) #js ["single-edge" "transitive-edge" "function-edge"])

(enable-console-print!)

(.run flows kn)

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

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