-
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
Misleading "verified" gutter icon #3076
Comments
This is nice, but what about |
Is it possible that this could be extended to annotating precondition contradictions as well? I was recently bitten by a super-silly precondition, essentially of the form [1]: power dafny user lesson 1: if your code is consistently passing the verifier and you're starting to think, "boy, am I ever good at writing correct programs", be wary ;-) |
This is a very interesting idea that indeed deserves to be studied on its own. It has its own challenges:
This issue is different, it's about the usual construct
|
This makes a lot of sense; I wasn't sure whether solving this particular issue was a matter of statically checking for "assert <expression that the solver, through its solver magic, can conclude will always be false>". It does make sense that that's a potentially-expensive computation. Happy to split this conversation out into its issue so this one doesn't get cluttered up :-) |
A user should never write |
Are you saying that Agreed to not ignore assume statements in general. Another problem we encountered by changing the background color of elements is the impression that things are "selected", when they are not. So in that sense it's also good to decouple visual feedback. |
Context and issue
After one year of writing Dafny and looking at how people write Dafny code in everyday's life, I came to realize that many of us use
assume false
for temporary verification debugging. And this is an accepted way of debugging when verification is slow, for example. When I designed the gutter icons, I did not realize this would cause a conflict, but there is one now that I realized.It occurred several times that I got the feedback that a user was editing a quite long method, and forgot they had added "assume false" in some places, and the function suddenly verifies.
So they are happy and move on to something else. But...
only later, when they want to compile (if they have the chance to, some never get to this stage and only use Dafny as a model checker), will they realize that they had forgotten one case. That latency is a source of frustration. Having gutter icons telling them the method is "verified" when it had some yet unproven assumptions feels not supportive.
This is not really a bug, this was only a design choice that was missing an element.
Example
For example, let's say, after fixing
![image](https://user-images.githubusercontent.com/3601079/202795399-d61d261c-b918-4a0d-b1f0-5a4a114ed23e.png)
case 1 =>
, the whole gutter icons turn green below:The user is happy and moves on to something else
They might have forgotten, after hours of writing
y := 4
, that there is still an assumption in their code that wouldn't compile.The fact that we show "green line" is thus misleading.
Recommended solution for gutter icons
I strongly suggest we consider a new set of icons that, in addition to all the others existing icons,
This should hold not only for statements like
assume {:false}
, but also for any declarations that can have expressions to verify, because one could insert "assume false;" in these expressions as well. Hence, this needs to be done forThe only place where we would not report assumptions are
assume true
, as inassume {:split_here} true
We might have other design ideas (i.e. warnings in diagnostics, exposing all compiler issues and not just verification issues, etc.) , but gutter icons are de facto one of the most important source of visual verification feedback for our users, so any other approach would be complementary.
The text was updated successfully, but these errors were encountered: