I tried this in core.logic
(require [clojure.core.logic :as l])
(l/run* [q]
(l/fresh [a b c]
(l/membero a [1])
(l/membero b [4 5])
(l/membero c [1 2])
(l/== q [a b])))
expecting the result to be [1 4] [1 5]
but it was [1 4] [1 4] [1 5] [1 5]
then I started playing with it and found this:
(require [clojure.core.logic :as l])
(l/run* [q]
(l/fresh [a b c]
(l/membero a [1])
(l/membero b [4 5])
(l/membero c [1 1 1 1 1 1 1 1])
(l/== q [a b])))
;; => ([1 4] [1 4] [1 4] [1 5] [1 4] [1 4] [1 5] [1 4] [1 5] [1 4] [1 5] [1 5] [1 5] [1 5])
where there is a [1 5] interspersed with [1 4]
what is happening? is this repetition thing supposed to be a feature or a bug?