[(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
(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
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
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
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.
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
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
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]
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