0.8.4-SNAPSHOT Arrow_down_16x16
  • (unifier ts)
  • (unifier opts ts)
Return the unifier for terms ts. Will prep the terms.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core/logic/unifier.clj:148 top

(defn unifier
  "Return the unifier for terms ts. Will prep the terms."
  ([ts] (unifier {} ts))
  ([opts ts]
     (let [opts (if (contains? opts :as)
                  (assoc opts :as
                    (->> (:as opts)
                      (map (fn [[k v]] [(lvar k false) (prep v)]))
                      (into {})))
                  opts)
           ts' (map prep ts)
           lvars (->> (concat ts' (map val (:as opts)))
                   (map #(-> % meta ::lvars))
                   (reduce into))]
       (unifier* (assoc opts :lvars lvars) (map prep ts)))))
Vars in clojure.core.logic.unifier/unifier:
Used in 0 other vars

Comments top

No comments for unifier. Log in to add a comment.