On Monday, October 8, 2012, Reinout Stevens wrote: > > > > 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 <rest...@vub.ac.be> 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
That's good to hear! Yes, that works though IRefinable was a bad idea and will be removed from the next alpha which shouldn't be far off. I worked out what needs to be done and made a first pass at implementing it. I'm now working through the failing tests. Figuring out the best way to reset tabled goals created w/ the tabled macro needs some thought. Currently the only way this supported to use the table function on a defn that has been declared ^:dynamic. Then the tabling is limited to a single run. David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en