core-logic

nblumoe 2019-06-14T20:06:44.001700Z

Hi! Is there a way to express disequality with core.logic in CLJS? Here is a small example what I would like to do:

(l/run* [p]
          (l/fresh [pos-1 pos-2]
                   (l/membero pos-1 [0 1])
                   (l/membero pos-2 [0 1])
                   (l/!= pos-1 pos-2)                 ;; pos-1 must not be equal to pos-2
                   (l/== p [{:x pos-1}
                            {:x pos-2}])))
https://github.com/clojure/core.logic/wiki/Using-core.logic-with-ClojureScript says disequality constraints aren't available on CLJS. Is there a way around this? Are finite domains available on CLJS?

noprompt 2019-06-14T20:16:29.001800Z

I can’t speak to core logic but you can express this kind of thing in a forward way with Meander. If you’re interested, feel free to share your problem in #meander.