Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.logic by

Walking a Clojure set seems to cause a StackOverFlowError:

`
(run* [?s] (== ?s #{1 2 3}))

(let [s #{1 2 3}] (run* [?s] (== ?s s)))

(run* [?convertedseq ?seq]
(== ?seq #{1 2 3})
(project [?seq]

(== ?convertedseq (vector ?seq))))

`

`
StackOverflowError

clojure.core.logic/walk*/fn--2722 (logic.clj:216)
clojure.core.logic/eval2927/fn--2928 (logic.clj:956)
clojure.core.logic.protocols/eval1478/fn--1479/G--1469--1486 (protocols.clj:55)
clojure.core.logic/walk* (logic.clj:214)
clojure.core.logic/walk*/fn--2722 (logic.clj:218)
clojure.core.logic/eval2927/fn--2928 (logic.clj:956)
clojure.core.logic.protocols/eval1478/fn--1479/G--1469--1486 (protocols.clj:55)
clojure.core.logic/walk* (logic.clj:214)
clojure.core.logic/walk*/fn--2722 (logic.clj:218)
clojure.core.logic/eval2927/fn--2928 (logic.clj:956)
clojure.core.logic.protocols/eval1478/fn--1479/G--1469--1486 (protocols.clj:55)
clojure.core.logic/walk* (logic.clj:214)

`

3 Answers

0 votes
by

Comment made by: dnolen

core.logic no longer supports unification of sets so you're just seeing an error as result of a complete lack of support. I'm not against supporting basic unification of completely grounded sets, as then we only need to test for equality, but I'm inclined to make the system throw if any logic vars appear in the sets.

0 votes
by

Comment made by: norman

The proposed fix for LOGIC-154 fixes this.

0 votes
by
Reference: https://clojure.atlassian.net/browse/LOGIC-130 (reported by alex+import)
...