             [conexp.io.util :refer :all]
             [conexp.util.exec :refer :all])
   (:import conexp.fca.implications.Implication
-           [java.util ArrayList BitSet LinkedList List ListIterator]))
+           [java.util ArrayList BitSet LinkedList List ListIterator]
+           [clojure.lang IFn PersistentHashSet PersistentVector]))
 
 
 ;;; Helpers to convert to and from BitSets

    A))

(defn next-closed-set
  "Computes the next closed set of closure after A. Returns nil if there is none."
  [^long attribute-count, closure, ^BitSet A]
  (let [^BitSet B (.clone A)]
    (loop [i (dec attribute-count)]
      (cond
       (== -1 i)
       nil,
       (.get B i)
       (do (.clear B i)
           (recur (dec i))),
       :else
       (do (.set B i)
           (let [A_i (closure B)]
             (if (lectic-<_i i A A_i)
               A_i
               (do (.clear B i)
                   (recur (dec i))))))))))


;;; Computing Canonical Base efficiently



;;; Next Closure

(defn- bitwise-context-attribute-closure
  "Computes the closure of A in the context given by the parameters."
