                (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

(defn project? [clause]
  (not (seq? clause)))

(defn filter? [clause]
  (and (seq? clause) (= '? (first clause))))


    (with-meta
      (fn [kn]
        (into #{}
              (for [fact (kn-f kn)
                    :let [vals (f fact)]
                    :when vals]
                (zipmap return-keys vals))))
