Fork me on GitHub

@hiredman Thanks. But how can I represent the lvars in fresh. I might have 3 lvars or 10 lvars to fresh and I might have and those lvars of the name mapped to different constraints. I am trying to solve the coloring problem using core.logic and I want to make the state var to be supplied as lvar to fresh. Also I have the neighbor clauses which I want to generate from a map. Does using and* correctly match the lvars from fresh to the one generated. I might be doing something wrong here since I am new to core.logic and clojure macros.


fresh you can think of as a macro, (fresh [x] ...) -> (let [x (lvar)] ...)


Thanks. I saw the code for solve-bench. So I can just use

(run 1 [q] 
(and (foo (:x bench) (:y bench)) 
        (foo (:y bench) (:x bench))) 
(== q bench))


Is there a limit on the stack or anything in JVM for the number of lvars. I am trying to unify some 600 lvars against around 4000 goals. The prolog version segfaulted on my machine. Just wanted to know if something that big is done or possible technically.


Also I realize the whole unification is dependent on each other and cannot be parallelized


I don't know


Hi! I'm a beginner with logic programing. does anyone mind to tell me how can I make this code work:


(run 1 [q]
       (fresh [dom a b]
              (== dom (apply fd/domain (range 11)))
              (l/everyg #(fd/in % dom) [a b])
              (== q [a b])
              (fd/* a b 100)))


I've got this error: IllegalArgumentException No implementation of method: :-lb of protocol: #'clojure.core.logic.fd/IInterval found for class: clojure.core.logic.LVar clojure.core/-cache-protocol-fn (core_deftype.clj:568)


ok I've found


I have to use interval intead of row lvars


sorry for the noise


what are some logic programing utils libraries built on top of core.logic?