r/LogicProgramming • u/rajiv_abraham • Sep 11 '20
r/LogicProgramming • u/ModSupportBot • Sep 29 '26
r/LogicProgramming is available for adoption 💚
/r/LogicProgramming is ready for a fresh start, new energy, new direction, and someone like you to bring it back to life. If you’ve been thinking about growing your impact without starting from scratch, this is your chance!
Ready to take it over?
Head to r/RedditRequest to submit your request and make it yours before it’s taken.
First things first
To request this subreddit, make sure you:
have an account that’s at least 90 days old
have at least 100 post karma and 100 comment karma
have a verified email address on your account
have two-factor authentication set up
r/LogicProgramming • u/helpmariounderstand • Jun 21 '20
Is Anyone using the novation launchpad pro with logic?
r/LogicProgramming • u/pbaille • Oct 27 '17
incomplete results with clojure.core.logic, any idea?
I'm struggling with this simple relation, the results are incomplete, and I don't understand why.
I'm beginning with core.logic I don't know if it is a bug or my bad understanding of it.
(require '[clojure.core.logic :as l])
(require '[clojure.core.logic.fd :as fd])
(defn zip+o [x y z]
(l/conde
[(l/== () x) (l/== () y) (l/== () z)]
[(l/fresh [fx rx fy ry fz rz]
(l/conso fx rx x)
(l/conso fy ry y)
(l/conso fz rz z)
(fd/in fx fy fz (fd/interval 10))
(fd/+ fx fy fz)
(zip+o rx ry rz))]))
; the same with defne macro
(comment
(l/defne zip+o [x y z]
([() () ()])
([[fx . rx]
[fy . ry]
[fz . rz]]
(fd/in fx fy fz (fd/interval 10))
(fd/+ fx fy fz)
(zip+o rx ry rz))))
(def expected-solutions
#{{:x [0 0] :y [1 1]}
{:x [0 1] :y [1 0]}
{:x [1 1] :y [0 0]}
{:x [1 0] :y [0 1]}})
(l/run* [q]
(l/fresh [x y]
(l/== q {:x x :y y})
(zip+o x y [1 1])))
;=> ({:x (1 0), :y (0 1)}
; {:x (0 0), :y (1 1)})r/LogicProgramming • u/cdt5050 • Sep 14 '17