Avoiding Viper functions in hashsets and as keys in hashmaps#867
Merged
marcoeilers merged 4 commits intomasterfrom Nov 6, 2025
Merged
Avoiding Viper functions in hashsets and as keys in hashmaps#867marcoeilers merged 4 commits intomasterfrom
marcoeilers merged 4 commits intomasterfrom
Conversation
This was referenced May 15, 2025
jcp19
reviewed
May 15, 2025
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.
I recently saw a Viper program where some consistency checks that need the call graph between functions took literal minutes, because various parts of the code calculating that graph use Viper AST functions as keys in maps. So lots of operations have to compute the hash code of those functions, which is apparently not cached in Scala's generated hash code implementation for case classes. And if the functions are sufficiently complex, this can apparently take forever.
So this PR just changes that code to compute maps from function names to sets of function names, instead of directly mapping functions to sets of functions.
This requires simple adaptations in Silicon and Carbon, which need to be merged first.