我在尝试遵循提供的示例(链接:这篇博客文章)(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")]
`