Re: Negation in core.logic

2013-08-09 Thread Alex
Hi, Norman Richards, In the example, "arg" and "goal" were not literal but were meant to be replaced with something appropriate to whatever you are trying to do. Yes, unless you use a projected value, it is equivalent to precomputing it outside the run*. The point was that, although very hacky, th

Re: Negation in core.logic

2013-08-09 Thread Norman Richards
Sorry - gmail spasm What I was trying to say is that what I think your code is doing is running a Clojure expression once and unifying with 0. It's equivalent to precomputing that outside of the run*: (let [result (count (run* [arg] (goal arg))] (run* [q] ;; whatever-else-you-were doi

Re: Negation in core.logic

2013-08-09 Thread Norman Richards
On Fri, Aug 9, 2013 at 4:19 PM, Alex Dowad wrote: > > (== 0 (count (run* [arg] (goal arg > What this is actually doing (run* [q] ;;... some stuff -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: Negation in core.logic

2013-08-09 Thread David Nolen
I've since added an experimental Prolog style negation as failure constraint `nafc`. On Fri, Aug 9, 2013 at 5:19 PM, Alex Dowad wrote: > Sorry to post on an old thread, but just in case someone comes here from > Google: > > I'm just playing with core.logic, and I think I found a way to negate a

Re: Negation in core.logic

2013-08-09 Thread Alex Dowad
Sorry to post on an old thread, but just in case someone comes here from Google: I'm just playing with core.logic, and I think I found a way to negate a goal... I don't know if this is advisable or not, but it seems to work: (== 0 (count (run* [arg] (goal arg -- -- You received this mess

Re: Negation in core.logic

2012-09-20 Thread Stathis Sideris
ground. So it's not relational. > > I have some leads based on recent Prolog research (CiaoProlog, and an > interesting dissertation on the abstract interpretation of Prolog) for > really handling negation in core.logic but I don't think I'll have time to > deal with it

Re: Negation in core.logic

2012-09-19 Thread David Nolen
search (CiaoProlog, and an interesting dissertation on the abstract interpretation of Prolog) for really handling negation in core.logic but I don't think I'll have time to deal with it any time soon. Again, more than willing and excited to collaborate with people who would like to see it don

Negation in core.logic

2012-09-19 Thread Stathis Sideris
Hello, Is there a way to negate a goal in core.logic? I have written this goal below, and I would like to use it to query all the pairs of people who are *not* relatives according to my facts (for dating purposes of course :-D) (defn relative [p1 p2] (conde [(parent p1 p2)] [(parent p