Introduce a pure miniKanren graph apply/reduce relation #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The added
graph_reduceo
can find fixed-points for reduction relations over graphs in both directions. This meansgraph_reduceo
can find fixed-points for a given graph and sequences of graphs satisfying given fixed-points, as well as graphs satisfying "patterns"/relations between those two.Of course the convergence of
graph_reduceo
depends on the relation and terms its given, but it works for strongly normalizing rewrite rules/relations and that's the baseline requirement for completely replacing—and going well beyond—Theano's optimization framework.The general "search" performance can always be addressed with things like
condp
, or any other adjustments to thecond*
relations that provide run-of-the-mill controlled graph traversal (e.g. depth-limited or weighed traversal). See the discussion in #6 for more details.Otherwise, after adding tests and replacing Theano functions, this closes #6, and, with the addition of a basic collection of graph-normalizing reductions and standard algebraic relations, we should be able to close #5, as well.