Closed dijkstracula closed 2 years ago
My first hypothesis here is that, when model compression is enabled, variables that Dafny expects to exist in the model are not available, and therefore it crashes. Disabling model compression (as described here) allows Dafny to complete. However, it should at the very least produce a useful error message when used with model compression, and ideally still produce some useful output.
I suspect that the appropriate fix for this is to automatically enable the necessary prover options, as described in #2029.
The documentation was fixed, so this issue is no longer an issue. However, I'm adding a recovery mechanism now so that 1) No more null pointer exception is thrown 2) If a null pointer exception was thrown previously, an error depicting the missing command-line flag is shown on the command line.
On Dafny with /Version output
Dafny 3.5.0.40314
:Consider the following Dafny program:
Dafny correctly indicates that our loop invariants are incorrect (as the implementation swapped the cases). The VS Code plugin is able to show counterexamples, but the CLI interface has a few problems:
1. Outdated documentation string for the
/extractCounterexample
flag:The CLI interface explicitly states that some additional flags need to be set.
However, the
model_compress
option is no longer known to Dafny:Crash during counterexample generation
More seriously, a null pointer exception is raised while attempting to extract a counterexample (irrespective of whether or not those unknown flags are present):
I can't figure out exactly how the VSCode plugin or the language server is driving the Dafny counterexample generator here, but since this doesn't seem to be a problem in the IDE, I guess something specific to the CLI is broken.
Thanks!