How should I do math with core.logic in ClojureScript without clojure.core.logic.fd?
At the moment all I need is addition.
it sort of depends, if the variables are ground , you can use project
@hiredman: Thanks for the pointer, but I don’t understand what that means. Can you elaborate or point me somewhere that talks about that?
project is a non-relational thing, because it depends on the order in which your logic program executes, and what it does is, give a logic variable, if by the time the project executes the logic program has already figured out the value of that logic variable, it gives you that value
so something like
(run [q] (fresh [a] (== a 1) (project [a] (== q (inc a))))
will work (I forget the syntax for project)(run [q] (fresh [a] (project [a] (== q (inc a))) (= a 1)))
will noterr that should be '(== a 1)' at the end
Thanks. I’ll play with that.
Perfect. Thanks!