clojure2minizincMiniZinc 的 Clojure 接口库
clojure2minizinc 是一个通过 MiniZinc 解决约束满足问题的 Clojure 库。
clojure2minizinc 提供一个 state-of-the-art constraint solvers (via MiniZinc) 和高级编程语言 Clojure 之间的接口。
代码示例:
(ns clojure2minizinc.examples (:require [clojure2minizinc.core :as mz])) (mz/minizinc (mz/clj2mnz (let [a (mz/variable (mz/-- -1 1)) b (mz/variable (mz/-- -1 1))] (mz/constraint (mz/!= a b)) (mz/solve :satisfy) (mz/output-map {:a a :b b}))) :num-solutions 3)
评论