          (+ [a a a])
          (- [b b b]))
    (Knowledge. #{[1 2 3] [2 3 4] [:a :b :c] [:b :c :d]} #{} #{}))
+
   ((rule [a b _]
          (+ed [_ a b])
          (? (integer? a))


(defn rule* [clauses]
  (let [asserts+retracts (asserts+retracts* clauses)]
    (fn [kn]
      (let [[asserts retracts] (asserts+retracts kn)]
        (reduce retract (reduce assert kn asserts) retracts)))))

(defn chain [rules]
  (fn [kn]

  ((query (+ed [a b])
          (+ [a b]))
   (Knowledge. #{} #{[1 2]} #{}))

  ((query (set x [b c]
               [a b c]
