 (defmulti make-lattice-nc
   "Creates a new lattice from the given arguments, without any
   checks. Use with care."
-  {:arglists '([base-set order-function] [base-set inf sup])}
+  {:arglists '([base-set order-function]
+               [base-set inf sup]
+               [base-set order-function inf sup])}
   (fn [& args] (vec (map clojure-type args))))
 
 (defmethod make-lattice-nc [clojure-coll clojure-coll] [base-set order]

  "Returns for a given context ctx its concept lattice."
  [ctx]
  (make-lattice-nc (set (concepts ctx))
                   (fn inf [[A _] [C _]]
                     (let [A+C (intersection A C)]
                       [A+C (object-derivation ctx A+C)]))

  (intersection (lattice-sup-irreducibles lat)
                (lattice-inf-irreducibles lat)))

(defn lattice-heights
  "Returns a function giving for every element in the base-set of the
  given lattice its height."
  [lat]
  (let [zero (lattice-zero lat),
        maxi (count (base-set lat)),
        heig (memo-fn h [x]
               (if (= x zero)
                 0
                 (inc (reduce (fn [mi a]
                                (if (directly-neighboured? lat a x)
                                  (min mi (h a))
                                  mi))
                              maxi
                              (disj (base-set lat) x)))))]
    (fn [x]
      (when-not (contains? (base-set lat) x)
        (illegal-argument "Given element is not contained in lattice."))
      (heig x))))

;;; FCA

