-
Notifications
You must be signed in to change notification settings - Fork 115
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
Enable Boogie variables to be monotonic #951
Enable Boogie variables to be monotonic #951
Conversation
I didn't quite understand this feature. Could you provide more background on the Dafny feature motivating this change? Perhaps provide a concrete Dafny example. |
Dafny has assignment tracking variables. Whenever a variable is assigned, it's associated tracking variable is set to true. Whenever a variable is used, we assert that its tracking variable is true. When a loop modifies a variable, then its associated tracking variable is set to true inside the loop, making Boogie consider this tracking variable one of the loop targets, and havoc'ing it after the loop. If the tracking variable was already set to true before the loop, this information is lost. To counteract that information loss, Dafny will, before the loop, assign the values of tracking variables (all of them, since it does not know what the loop targets are) to temporary storage variables, and after the loop With the change in this PR, Dafny can mark all tracking variables as monotonic, so that they won't be havoc'ed by loops, and then it doesn't need the above mechanism. However, I can't think of any other use-cases than what Dafny does. It only works because Dafny only ever asserts that tracking variables are true, so the effect of the solver knowing a tracking variable is false, versus it not knowing the value, is the same: both give an assertion error. |
Closing since I felt this was too much of a hack |
Changes
Add the following field to
Variable
:Testing
Added a CLI test