                (fn [query clause]
                  (debug-q
                   (cond
-                   (project? clause) (join query (project clause))
+                   (project? clause) (join query (project clause to-be))
+                   (project-asserted? clause) (join query (project clause :asserted))
+                   (project-retracted? clause) (join query (project clause :retracted))
                    (filter? clause) (filter-q query (second clause))
                    :else query)))
                empty-q

        facts))
    (meta query)))

(defn project [pattern]
  (let [return-syms (into [] (match/vars pattern))
        return-keys (map keyword return-syms)
        shape (into #{} return-keys)

         (- [b b b]))
   (Knowledge. #{[1 2 3] [2 3 4] [:a :b :c] [:b :c :d]} #{} #{}))

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

  )
