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
Thanks a lot David. As much as I'd like to contribute, I've only just started looking into logic programming. Stathis On Wednesday, 19 September 2012 17:42:09 UTC+1, David Nolen wrote: > > On Wed, Sep 19, 2012 at 11:11 AM, Stathis Sideris > > > wrote: > > Hello, > > > > Is there a way to negat

Re: Negation in core.logic

2012-09-19 Thread David Nolen
On Wed, Sep 19, 2012 at 11:11 AM, Stathis Sideris wrote: > 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) > >