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

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

         (- [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]} #{}))

  )
