Repository navigation
Code tree results: number equality sort variables first, as the compiler does - #1028
Closed
quickbeam123 wants to merge 1 commit into
Closed
quickbeam123 wants to merge 1 commit into
quickbeam123 wants to merge 1 commit into
Conversation
…ler does The substitutions returned by code-tree generalization queries translate the key's variables to binding slots via a Renaming. For an equality literal, Renaming::normalizeVariables visits the arguments before the sort, whereas CodeTree::Compiler (and the flat term) visit the sort first, so the slots could be permuted and the substitution came out wrong (ill-sorted terms, e.g. TermSharing / SortHelper assertion violations). Fix it locally in CodeTreeInterfaces.hpp rather than changing Renaming, which the substitution trees rely on in its current order. Reproducer: the new unit test TermIndex/gen_equality_sort_variables_numbered_first (fails before the change). Fixes #1023 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
Author
|
On my machine, the two problematic runs from #1023 no longer crash... |
This file contains hidden or 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
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.
The substitutions returned by code-tree generalization queries translate the key's variables to binding slots via a Renaming. For an equality literal, Renaming::normalizeVariables visits the arguments before the sort, whereas CodeTree::Compiler (and the flat term) visit the sort first, so the slots could be permuted and the substitution came out wrong (ill-sorted terms, e.g. TermSharing / SortHelper assertion violations).
Fix it locally in CodeTreeInterfaces.hpp rather than changing Renaming, which the substitution trees rely on in its current order.
Reproducer: the new unit test TermIndex/gen_equality_sort_variables_numbered_first (fails before the change).
Fixes #1023