             (query session sample/find-cold-and-windy))))))
 
 (deftest test-retract! 
-  (let [not-cold-rule (mk-rule [[Temperature (> temperature 50)]] 
+  (let [not-cold-rule (dsl/parse-rule [[Temperature (> temperature 50)]] 
                                (retract! (->Cold 20)))
 
-        cold-query (mk-query [] [[Cold (== ?t temperature)]])
-
-        session (-> (mk-rulebase not-cold-rule cold-query) 
-                    (mk-session)
+        cold-query (dsl/parse-query [] [[Cold (= ?t temperature)]])
+
+        session (-> (mk-session [not-cold-rule cold-query]) 
                     (insert (->Cold 20))              
                     (fire-rules))]
 

          [:not {:type Temperature :constraints ['(> 2 1)]}]
          [:not {:type Temperature :constraints ['(> 3 2)]}]
          [:not {:type Temperature :constraints ['(> 4 3)]}]]
         (to-dnf
          [:and
           [:not
            [:or

    (is (empty? (query session-retracted coldest-query)))))

(deftest test-bound-accumulator-var
  (let [coldest-query (dsl/parse-query [:?loc] 
                                [[?t <- (accumulate
                                         :reduce-fn (fn [value item]
                                                      (if (or (= value nil)
                                                              (< (:temperature item) (:temperature value) ))
                                                        item
                                                        value)))
                                  :from [ Temperature (= ?loc location)]]])

        session (-> (mk-session [coldest-query]) 
                    (insert (->Temperature 15 "MCI"))
                    (insert (->Temperature 10 "MCI"))
                    (insert (->Temperature 5 "SFO")))]
