Re: Program using distincto runs forever.

2014-02-02 Thread David Nolen
[(geto r k v)]) > > > (defn keyso [c k] > (matche [c] > ([[]] (nilo k)) > ([[f . r]] (fresh [a b] (firsto f a) > (keyso r b) > (conso a b k) > > > (defn distinctkeyso [c] > (fresh

Re: Program using distincto runs forever.

2014-02-02 Thread Atamert Ölçgen
(firsto f a) (keyso r b) (conso a b k) (defn distinctkeyso [c] (fresh [x] (keyso c x) (distincto x))) (run 1 [q] (fresh [x] (geto x :tree false) (== q true) (geto x :tree q) (distinctkeyso x))) But it doesn't co

Re: Program using distincto runs forever.

2014-02-02 Thread Atamert Ölçgen
ojure.org/jira/browse/LOGIC > > David > > > On Mon, Feb 3, 2014 at 12:51 AM, Atamert Ölçgen > wrote: > >> This succeeds: >> >> (run 1 [q] >> (distincto q) >> (== q [1 2 3])) -> ((1 2 3)) >> >> >> >> But this runs forev

Re: Program using distincto runs forever.

2014-02-02 Thread David Nolen
This is not a bug, just a result of the evaluation model - order matters. Bugs can be filed here: http://dev.clojure.org/jira/browse/LOGIC David On Mon, Feb 3, 2014 at 12:51 AM, Atamert Ölçgen wrote: > This succeeds: > > (run 1 [q] > (distincto q) > (== q [1 2

Program using distincto runs forever.

2014-02-02 Thread Atamert Ölçgen
This succeeds: (run 1 [q] (distincto q) (== q [1 2 3])) -> ((1 2 3)) But this runs forever: (run 1 [q] (distincto q) (== q [1 2 3 1])) BTW, why is it so difficult to create a bug report for core.logic? Issue tracker is not enabled in GitHub. I signed up to http://dev.clojure.

Re: distincto

2012-01-01 Thread David Nolen
On Sat, Dec 31, 2011 at 10:10 PM, cej38 wrote: > Ambrose, > Thanks for pointing me to the cKanren branch. > > Happy New Year. Just to be clear, hardly anythings works in the cKanren branch at the moment. But yes that definition of distincto looks good. David -- You received

Re: distincto

2011-12-31 Thread cej38
Ambrose, Thanks for pointing me to the cKanren branch. Happy New Year. On Dec 31, 9:18 pm, Ambrose Bonnaire-Sergeant wrote: > I had a peek on the cKanren branch, distincto is basically all-diffo in > cKanren. > > https://github.com/clojure/core.logic/blob/cKanren/src/ma

Re: distincto

2011-12-31 Thread Ambrose Bonnaire-Sergeant
I had a peek on the cKanren branch, distincto is basically all-diffo in cKanren. https://github.com/clojure/core.logic/blob/cKanren/src/main/clojure/clojure/core/logic.clj#L2229 Here's the port to core.logic. (change !=c to !=) (defn distincto [l] (conde [(== l ())] [(fresh [a]

distincto

2011-12-31 Thread cej38
three != lines, something like, (distincto [a b c]) such that I could rewrite the above problem as (run* [q] (fresh [a b c] (membero a [1 2 3]) (membero c [1 2 3]) (== b 2) (distincto [a b c]) (== q [a b c]))) I tried to write several functions but they are all end up inside