You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module M {
opaque functionToSet(xs: seq<int>): set<int> {
set x: int | x in xs
}
lemmaLemmaCardinality(xs: seq<int>)
ensures |ToSet(xs)| <= |xs|
{}
lemmaLemmaEmpty(xs: seq<int>)
requires xs == []
ensures |ToSet(xs)| == 0
{
assumefalse;
}
}
Command to run and resulting output
$ dafny verify --warn-redundant-assumptions --warn-contradictory-assumptions tmp.dfy
tmp.dfy(8,2): Error: a postcondition could not be proved on this return path
|
8 | {}
| ^
tmp.dfy(7,12): Related location: this is the postcondition that could not be proved
|
7 | ensures |ToSet(xs)| <= |xs|
| ^^^^^^^^^^^^^^^^^^^
|
12 | ensures |ToSet(xs)| == 0
| ^^^^^^^^^^^^^^^^
tmp.dfy(12,12): Warning: ensures clause proved using contradictory assumptions
|
11 | requires xs == []
| ^^^^^^^^
tmp.dfy(11,13): Warning: unnecessary requires clause
Dafny program verifier finished with 1 verified, 1 error
What happened?
The two errors and two warnings are all correct, but the warnings' messages are displayed below the code snippet context, whereas they should appear above the context.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered:
alex-chew
added
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
part: CLI
interacting with Dafny on the command line
labels
Nov 16, 2023
Dafny version
master (f81c316)
Code to produce this issue
Command to run and resulting output
What happened?
The two errors and two warnings are all correct, but the warnings' messages are displayed below the code snippet context, whereas they should appear above the context.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: