我正在尝试跟随 (link: 这篇博客帖子)(https://mattsenior.com/2014/02/using-clojures-core-logic-to-solve-simple-number-puzzles) 提供的示例,并且发现只有在删除测试负数减法条件的条件下它才会正常工作。我删除了很多不同的东西,结果发现在这个基本示例中也无法找到匹配项
`
(ns example.core
(:refer-clojure :exclude (link: ==))
(:require (link: clojure.core.logic :refer :all))
(:require (link: clojure.core.logic.fd :as fd)))
(run* (link: q)
(fresh (link: a0 a1)
(== q (link: a0 a1))
(fd/in a0 a1 (fd/interval 1 9))
(fd/- a0 a1 -1)
;(fd/eq
; (= (- a0 a1) -1))
))
`
依赖关系(尽管我也尝试了 clojure 1.8 和 1.9)
`
:dependencies (link: [org.clojure/clojure "1.7.0")
(link: org.clojure/core.logic "0.8.11")]
`