-
Notifications
You must be signed in to change notification settings - Fork 25
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
chore: Remove Dafny trigger warnings #160
Conversation
This removes Dafny warnings around `forall` statments lacking a `{trigger}`
@@ -209,7 +209,7 @@ module {:options "-functionSyntax:4"} DivMod { | |||
ensures forall a: int, b: int, d: int, R: int {:trigger d * ((a + b) / d) - R, d*(a/d) + d*(b/d)} | |||
:: 0 < d && R == a%d + b%d - (a+b)%d ==> d*((a+b)/d) - R == d*(a/d) + d*(b/d) | |||
{ | |||
forall (a: int, b: int, d: int, R: int {:trigger true} | 0< d && R == a%d + b%d - (a+b)%d) | |||
forall (a: int, b: int, d: int, R: int {:trigger d * ((a + b) / d) - R, d*(a/d) + d*(b/d)} | 0< d && R == a%d + b%d - (a+b)%d) |
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.
I think you can't use interpreted functions, like any of the arithmetic or logical operators, in a trigger. Sorry that there is no automatic feedback on this, or even good documentation. And to be honest I'm not sure what the right trigger for this forall would be. @MikaelMayer @atomb ?
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.
You can run Dafny and it will give you some help, but also {:nowarn}
works in newer versions of Dafny, and that gets me what I want!
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.
Please use {:nowarn}
everywhere then. These triggers are not valid triggers because they map to builtin operators that do not work with pattern matching.
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.
LGTM
This removes Dafny warnings around
forall
statments lacking a{trigger}
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.