-
Notifications
You must be signed in to change notification settings - Fork 35
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
When is the Position of an AST node mandatory? #732
Comments
My guess would be that deduplication is used because you're likely to get the exact same error on multiple paths (because you reach e.g. the same assert statement that fails on different paths).
It seems to be the position that would be reported for the error, which as far as I can see is always the position of the offendingNode. What AST node is used for that will depend on the type of error, so that question doesn't have a short answer.
I don't think that question has an answer. Silicon works (as in, doesn't crash or do anything unsound) without unique positions, as you see, it just filters out all errors that would have the same exact error message. What I don't understand is this: |
Yes, which means that we are generating dummy positions for AST nodes for which we should instead generate unique positions. Knowing that those are the offendingNodes helps, thanks! Last question, then we can close:
|
My impression was that the important thing is that position.toString() is unique. So if the string representation contains line, column, and ID, then making any of those unique would suffice. But I guess the ID is something Prusti-specific? I think that's not a part of a standard Viper position. So I don't know what the implementation of toString for your Position class does. |
Are you sure that it's the All positions constructed by Prusti are instances of Silver's |
I assumed |
Oooh, you mean that |
In Prusti, we only generate
Position
instances (with a unique line, column and ID) for the AST nodes that we know might be the offending node of a verification error. Sometimes, we also generate positions for the AST nodes that we know might be the reason of a verification error. For any other AST node we generate a dummy position where the line and column are zero.This worked well so far when using Silicon configured to report one verification error per method. However, when we configure Silicon to report multiple verification errors we still only receive one verification error per method. Aurel found that by removing .distinctBy(failureFilterAndGroupingCriterion) we actually get all the errors that we expect, but I then wonder why the deduplication is there in the first place.
I have a few questions about this:
The text was updated successfully, but these errors were encountered: