This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-07
Channels
- # aleph (19)
- # aws (1)
- # beginners (75)
- # boot (28)
- # cider (1)
- # cljs-dev (12)
- # cljsrn (20)
- # clojure (350)
- # clojure-argentina (1)
- # clojure-chicago (2)
- # clojure-dev (2)
- # clojure-russia (5)
- # clojure-spec (2)
- # clojure-uk (14)
- # clojure-ukraine (3)
- # clojurescript (68)
- # component (87)
- # core-async (25)
- # core-logic (13)
- # cursive (4)
- # data-science (72)
- # datascript (59)
- # datomic (15)
- # defnpodcast (7)
- # emacs (33)
- # hoplon (5)
- # immutant (73)
- # jobs (21)
- # klipse (6)
- # lumo (14)
- # off-topic (26)
- # om (23)
- # onyx (6)
- # parinfer (37)
- # protorepl (4)
- # re-frame (13)
- # ring (2)
- # rum (3)
- # spacemacs (2)
- # specter (22)
- # sql (47)
- # uncomplicate (10)
- # unrepl (79)
- # untangled (66)
- # vim (47)
- # yada (17)
Hello all, I have something like this [:A :B] [:A :C] [:B :C]
how can I get the result [:A [:B :C]], is that possible with core.logic?
What exactly are you asking? Are you asking how to transform the results of your core.logic query? Or are you asking how to rewrite your core.logic query? (in which we’d need a query)
user> (reduce (fn [m [k v]] (update-in m [k] #(conj (or % #{}) v))) {} [[:A :B] [:A :C] [:B :C]]) {:A #{:B :C}, :B #{:C}}
Hi, is there a way to use core.logic as a kind of backward chaining rule engine? I kind of figured out that I can write a goal to encapsulate the singe execution of a rule, but how could I express that a portion of goal could be used multiple times to derive a conclusion?
@norman well, I´m trying to use it like I used to use in Prolog as I remember
repetition ([X|T]) :- repetition(X,A), repetition(X,B), A != B.
I don´t know if it´s correct🙂 ok, I´m trying to use core.logic instead of using something like http://www.clara-rules.org/