-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible search #13
Flexible search #13
Conversation
…on is always choice anyway. (This may have broken waiting-streams, but I'm not sure what they do so its hard to tell)
…em multiple times
Conflicts: src/main/clojure/clojure/core/logic.clj
Conflicts: src/main/clojure/clojure/core/logic.clj
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 :) |
…arch algorithms return nil, others return ())
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 |
Sent the CA on Friday. |
Excellent! Feel free to add a ticket to JIRA w/ attached squashed patch against master. |
Conflicts: src/main/clojure/clojure/core/logic.clj src/main/clojure/clojure/core/logic/bench.clj src/test/clojure/clojure/core/logic/tests.clj
I wonder if the poor performance in the parallel solver is related to this - https://groups.google.com/forum/#!msg/clojure/48W2eff3caU/qKjFmh3dgvMJ |
There's far too much speculation in that thread. Even so, I doubt it. |
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:
(run* ...)
: ~30ms(run 1 ...)
: ~8.5ms(run* ...)
: ~25ms(run 1 ...)
: ~27msI 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:
(binding [*search* dfs-par] (run* ...))
: ~18ms