-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 #27
Fix associative-commutative relations and the use of term walk groundedness #27
Conversation
c8e9668
to
99c1ed9
Compare
dd5d898
to
74f2332
Compare
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.
4863fda
to
b20dbb2
Compare
I've recently added a new test (an expected failure) that demonstrates how poorly the 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 |
4718256
to
41bbebd
Compare
41bbebd
to
09a8618
Compare
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.