You have a response from the original author of core.logic that kits are not supported, but I think that you could formulate your question as a more leading one and perhaps received a more interesting answer about why the kits are not supported (for now) or what may be required to support them. Regarding why, I suspect that they are not really needed, because distincto and permuteo provide goals that can be used to test the properties of the set. As for what might be required to support them in a pool, follow below for a rude, ugly, incomplete, and ineffective first look.
Stack overflow occurs because sets are going and going while walking. But since sets are not supported, there is no transition implementation for sets, and by default for objects it is returning itself. The end result is that, from the point of view of sets, the drums contain themselves, and the stack is blown out, trying to put it to the bottom.
Join me on REPL, looking at the source and allow something to hack.
(use 'clojure.core.logic) (use 'clojure.core.logic.protocols)
Tell core.logic to walk sets using the existing sequence implementation.
(extend-protocol IWalkTerm clojure.lang.IPersistentSet (walk-term [vf] (with-meta (set (walk-term (seq v) f)) (meta v)))) (run* [q] (== q [])) ;=> ([]) (run* [q] (== q
Ok so far ...
(run* [q] (== q [1 2 3])) ;=> ([1 2 3]) (run* [q] (== q
Consistent but not very helpful
(run* [q] (== [1 q 3] [1 2 3])) ;=> (2) (run* [q] (==
Now we have a problem. Both of the last two should return (2) , since the sets are not in order, but both do not return a result. We need to tell core.logic how to unify sets. Let them be lazy and try to use the existing permuteo to convey the lack of order.
(extend-protocol IUnifyTerms clojure.lang.IPersistentSet (unify-terms [uvs] (bind s (permuteo (seq u) (seq v))))) (run* [q] (==
Fine!
(run* [q] (fresh [a1 a2 a3] (==
Very cool.
(run* [q] (==
Nice ... but
(run* [q] (==
So we were too permuteo using permuteo , try to reset it with clojure.math.combinatorics instead
(use 'clojure.math.combinatorics) (extend-protocol IUnifyTerms clojure.lang.IPersistentSet (unify-terms [uvs] (when (set? v) (let [u (seq u) v (seq v)] (reduce
And now...
(run* [q] (==
It looks pretty promising.