-
Notifications
You must be signed in to change notification settings - Fork 257
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
Assert failing in strange way #1570
Comments
I tried moving out the contents of the module, or removing the const (which is unused), but any of those changes would suddenly make the assert pass. |
I've triangulated the breakage to this Dafny PR, which moved Boogie from 2.9.4 to 2.9.6: #1543. (Side note: Unfortunately there are quite a few Boogie changes between 2.9.4 and 2.9.5 so I'll have to continue searching through those in turn tomorrow. @keyboardDrummer do you see any obvious culprits in there? It may not be practical to revert the offending change at this point, but I'm not sure what code change to suggest until we at least understand what Dafny change caused this. |
Looks like it was boogie-org/boogie#439 |
@hmijail it looks like you're running into an issue that we're calling 'verification instability', which is mentioned in this ticket. To summarise: some correct Dafny programs are difficult for Dafny to verify, and then may or may not verify depending on seemingly unimportant program changes (I'll call these changes refactorings). Due to changes we made in Dafny's verification pipeline, upgrading Dafny has a similar effect to the verification of your program as applying refactorings. If you change your program to use a (much) small number then the verification instability disappears:
@RustanLeino do you know how to make this program verify stably without having to restrict the number |
FWIW, we often find that use of non-linear arithmetic correlates strongly with proof instability. Hence, for any non-trivial project, we try to run with the |
Thanks @parno, awesome suggestion! I hadn't thought this qualified as a "non-trivial" assertion and didn't even think of using I'm still interested in understanding why boogie-org/boogie#439 caused this to break, so I'd like to leave this open even if the solution above works for you @hmijail. |
@robin-aws @parno @hmijail I discussed this issue with @hmijail (we work together) and indeed we found out that:
It is very good that there is a standard library now. In previous projects we wrote a lot of code with folk theorems about e.g. sequences (for instance [] + e == e + [] == e) and they can be shared. |
This behavior is indeed surprising, and it's an issue that I've been working to resolve. I didn't create a GitHub issue for this before but I've created one now: #1585 |
Is there any way to make the Dafny Language Server use the |
Not yet. I was thinking about providing the option to apply all the Dafny settings that the language server doesn't support yet. Something like an expert setting where users should be aware that they may override settings the language server relies on (most importantly For example, something like this: dotnet DafnyLanguageServer.dll --dafny:settings="/noLarith" |
Dafny 3.3 (commit 88cf232)
macOS 11.6
The assert fails:
I have tried reducing further the file, but the moment I change anything, it stops failing.
Interestingly, Dafny 3.2 verified this file correctly. BUT, if the commented lines are uncommented, then the same failure appears there.
The text was updated successfully, but these errors were encountered: