         facts))
     (meta query)))
 
-(defn project [pattern kn-f]
+(defn project-q [pattern kn-f]
   (let [return-syms (into [] (match/vars pattern))
         return-keys (map keyword return-syms)
         shape (into #{} return-keys)


(comment

  ((project '[a b] to-be) (Knowledge. #{[1 2] [3 4 5] [6 7]} #{} #{}))

  ((join (project '[a b _] to-be) (project '[_ a b] to-be)) (Knowledge. #{[1 2 3] [2 3 4] [2 4 6] [4 6 8]} #{} #{}))

  ((filter-q (project '[a b] to-be) (fnk [a b] (= a b))) (Knowledge. #{[1 2] [3 4] [6 6]} #{} #{}))

  (query* ['[a b _] '[_ a b] (list '? (fnk [a] (integer? a))) (list '+ (fnk [a b] (+ a b)))])


      {::shape shape})))

;; TODO hashjoin instead
(defn join-q [query1 query2]
  (let [shape (union (::shape (meta query1)) (::shape (meta query2)))
        join-shape (intersection (::shape (meta query1)) (::shape (meta query2)))]
    (with-meta
