Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Flexible search #13
Replaces the core stream data-structure with a lazy tree of continuations (ITake becomes ISearchTree).
Adds optional fair conjunction (via bind-fair and all-fair).
Adds new search algorithms: bfs-lazy (the original algorithm), bfs-strict, dfs-lazy, dfs-strict, dfs-par (using fork-join).
Unfortunately, introduces performance regressions for lazy search. For example, for bench/zebrao I see:
I suspect that this is simply a missing thunk somewhere but I've run out of time to work on this. Given that laziness is now largely controlled by the search algorithm it may also be worth deprecating the various variants of run.
As a consolation prize:
Excellent, however the usual spiel - I can't merge pull requests for official Clojure projects. I need an enhancement ticket + squashed patch in JIRA, http://dev.clojure.org/jira/browse/LOGIC. I also can only take patches from people that have signed the Contributor Agreement (CA) - http://clojure.org/contributing. Please mail this in, once that's on its way to North Carolina I will happily apply the JIRA patch.
As far as feedback this looks like a fairly small set of changes! To make that even more clear please remove the whitespace changes from the JIRA patch - this is pretty easy to do w/ git if you interactively add the changes via git when creating the patch.
Would love to get this in, this looks like a great step forward for customizable search in core.logic. Thanks much.
Oh and some tests would make me a little bit more confident when applying this :)
I'll send off the CA on Friday.
In the meantime, I poked around at those performance regressions and I'm now wondering if it's just a matter of different search order. In theory
I wonder if the poor performance in the parallel solver is related to this - https://groups.google.com/forum/#!msg/clojure/48W2eff3caU/qKjFmh3dgvMJ