-
Notifications
You must be signed in to change notification settings - Fork 266
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: Omit type antecedents for unassigned variables #5877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this PR does the job! Well done.
function Search4<T(==)>(s: seq<T>, x: T): (o: Option<int>) | ||
ensures | ||
o.Some? && o.value < |s| ==> | ||
s[o.value] == x // error: ".value" may be negative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this function relates to the soundness issue being solved? Is that the baseline without subset types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the baseline -- just to make sure there's nothing else that causes the other tests to pass.
git-issue-1958.dfy(18,16): Error: value does not satisfy the subset constraints of 'R' | ||
git-issue-1958.dfy(32,4): Error: value does not satisfy the subset constraints of 'R' | ||
git-issue-1958.dfy(36,4): Error: value does not satisfy the subset constraints of 'R' | ||
git-issue-1958.dfy(56,16): Error: function precondition could not be proved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one, along with the one line 104, is not triggered on my machine and that's a soundness issue. So you fixed it !
In let expressions and named function results, the bound variable was previously introduced with an assumption that the variable satisfied its type. That is not sound, since the type may be empty. This PR removes those premature type assumptions.
Fixes #1958
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.