fd/*
似乎在处理负数时遇到问题,即使它们只是常数。它在许多情况下都有效。我做错了什么?
(require '[clojure.core.logic :as l]
'[clojure.core.logic.fd :as fd])
; Works, returns (1):
(l/run* [q]
(fd/* -1 q -1))
; Works, returns (1):
(l/run* [q]
(fd/in q (fd/domain 1))
(fd/* -1 q -1))
; Fails, returns ():
(l/run* [q]
(fd/in q (fd/domain 0 1))
(fd/* -1 q -1))