   (let [intents (titanic (attributes context)
                          (supports context minsupp)
                          1.0
-                         <=)]
+                         #(apply min %))]
     (if (<= (* (count (objects context)) minsupp)
             (count (attribute-derivation context (attributes context))))
       intents

  (titanic (attributes context)
           (supports context 0)
           1.0
           <=))

(defn titanic-iceberg-intent-set
  "Computes the iceberg intent set for given context and minimal

(defn titanic
  "Implements the titanic algorithm. weigh must return for a
  collection of sets a hash-map mapping every set to its weight, with
  max-weight being the maximal weight possbile. weight-minimum is a
  function of one argument being a sequence of weights and returning
  the minimal of those."
  [base-set weigh max-weight weight-minimum]
  (binding [closure       {},
            set-weight    (weigh [#{}]),
            subset-weight (memoize (partial subset-weight max-weight)),
            minimum       weight-minimum]

    (loop [key-set    #{#{}},
           candidates (set-of #{m} [m base-set]),
