On Saturday, October 6, 2012 1:53:42 AM UTC+2, David Nolen wrote:
>
> On Mon, Oct 1, 2012 at 9:13 AM, Reinout Stevens
> <[email protected]<javascript:>
> > wrote:
>
>> Hi,
>>
>>
>> I quickly changed the code so that the graph structure no longer contains
>> the list of nodes, and the same behaviour still persists. For the actual
>> implementation I have changed it to a function that returns a list of
>> nodes, which can be compared in O(1) instead of looping over the data
>> structure, and also here we get the same behaviour.
>>
>> Personally, I don't see the difference between calling solve-goal or
>> solve-goals, as both should have an equally large table. The recursive step
>> of solve-goals shouldn't do anything, as we are only passing a list
>> containing a single item. In attachment the updated code (aka: just removed
>> the :node key from the graph).
>>
>>
>> Thanks for taking your time and looking into this,
>>
>>
>> Reinout
>>
>
> Hi I've been able to significantly improve the performance of core.logic's
> tabling for your use case with this commit:
> http://github.com/clojure/core.logic/commit/03ad0a425c5b3b91a00142ff91e5fcd378daa682
>
> Can you please try this out? Is the performance at least acceptable now? I
> think we could still do a lot better but it would require some more
> consideration.
>
> David
>
Hi,
Your solution seems to work fine. I got one error, namely there was no
implementation for the IRefinable protocol for the nil class, but I quickly
added it (and hopefully it is correct, just copied the one defined on
Object).
(extend-type nil
clojure.core.logic/IRefinable
(refinable? [_] false))
Another question: is it possible to manually reset the contents of the
tables?
Thanks a lot
Reinout
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en