   ([ctx]
      (canonical-base ctx #{}))
   ([ctx background-knowledge]
-     (assert (context? ctx)
-             "First argument must be a formal context")
      (with-binary-context ctx 
        (let [next-closure (fn [implications last]
-                            (next-closed-set object-count
-                                             attribute-count
-                                             (clop-by-implications implications)
-                                             last)),
+                            (nc/next-closed-set object-count
+                                                attribute-count
+                                                (clop-by-implications implications)
+                                                last)),
              runner       (fn runner [implications, ^BitSet candidate]
                             (when candidate
-                              (let [conclusions (bitwise-context-attribute-closure
+                              (let [conclusions (nc/bitwise-context-attribute-closure
                                                  object-count
                                                  attribute-count
                                                  incidence-matrix

(in-ns 'conexp.contrib.algorithms)

(use 'conexp.contrib.algorithms.bitwise)
(require '[conexp.main :as cm])

(import '[conexp.fca.implications Implication])



                                    (cons impl
                                          (lazy-seq (runner impls (next-closure impls candidate)))))
                                  (recur implications (next-closure implications candidate))))))]
         (map (fn [^Implication bit-impl]
                (cm/make-implication (to-hashset attribute-vector (.premise bit-impl))
                                     (to-hashset attribute-vector (.conclusion bit-impl))))
              (lazy-seq (runner (vec background-knowledge)
                                (close-under-implications background-knowledge
                                                          (to-bitset attribute-vector #{})))))))))
