clojure2minizinc是一个通过MiniZinc解决约束满足问题的Clojure库。
clojure2minizinc提供一个state-of-the-artconstraintsolvers(viaMiniZinc)和高级编程语言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)
评论