     (doseq [v base-set-1,
             r R,
             :when (seq (.get remove [v r]))] ;i.e. (not (empty? (.get remove [v r])))
-      (.addFirst non-empty-removes [v r]))
-    (while-let [[v r] (.peekFirst non-empty-removes)]
+      (.add non-empty-removes [v r]))
+    (while-let [[v r] (first non-empty-removes)]
       (doseq [w (.get remove [v r]),
               u (pre-1 v r)]
         (when (contains? (.get sim u) w)

        conexp.contrib.dl.framework.semantics
        conexp.contrib.dl.util.graphs)
  (:use clojure.contrib.pprint)
  (:import [java.util HashMap LinkedList]))

(ns-doc
 "Implements description graphs and common operations on them.")

                    (not (contains? sim-u x)))
              (.put remove [u r*]
                    (conj (.get remove [u r*]) w*))
              (.add non-empty-removes [u r*])))))
      (.put remove [v r] #{})
      (.remove non-empty-removes [v r]))
    (HashMap->hash-map sim)))


