-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix associative-commutative relations and the use of term walk groundedness #40
Draft
brandonwillard
wants to merge
14
commits into
pythological:main
Choose a base branch
from
brandonwillard:fix_term_walk_groundedness
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix associative-commutative relations and the use of term walk groundedness #40
brandonwillard
wants to merge
14
commits into
pythological:main
from
brandonwillard:fix_term_walk_groundedness
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comes along with a warning/clarification to the assoccomm relations. They have always walked the first argument, which, when used with the old `ground_order` would only account for improperly ordered terms when the second argument was fully ground (and the first wasn't). However, it would perform this check repeatedly, incurring a full-traversal cost on every iteration. This inefficiency has been rectified. The new "shallow" ground order should accomplish the same--and more--by reordering according to "groundness" only at next level of traversal. The assoccomm goals need to be updated so that they properly use this shallow ordering, though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ground_order
doesn't really order terms in a way that avoids infinite recursion interm_walko
(e.g. when called by thekanren.assoccomm
goals). There should be a way to handle this—at least better than it currently does.This PR adds a new test,
test_eq_assoccomm_scaling
, (an expected failure) that demonstrates how poorly theassoccomm
goals perform.The test creates a decently sized term graph containing assoc-comm operators and another one that differs only at the top-level (i.e. one graph starts with an
add
operator and the other amul
). This should be no problem, since the two cannot unify from the start due to the operator discrepancy. However, due to the way theassoccomm
goals descend into all permutations, it currently takes too long to fail. The changes in this PR attempt to address this issue.test_eq_assoccomm_scaling
to passThis PR replaces #27.