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
functionF(x: int): intmethodWorks() {
var a :| F(a) == 2 by {
assume {:axiom} F(10) == 2;
}
}
methodByClauseIsIgnored() {
var a;
a :| F(a) == 2 by { // this gives an error, but it should notassume {:axiom} F(10) == 2;
}
}
Command to run and resulting output
% dafny verify test.dfy
test.dfy(11,4): Error: cannot establish the existence of LHS values that satisfy the such-that predicate
|
11 | a :| F(a) == 2 by { // this gives an error, but it should not
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dafny program verifier finished with 1 verified, 1 error
What happened?
The by clause in method Works works. The assumption contained therein proves the existence of an a.
Method ByClauseIgnored is similar, but uses just an assign-such-that statement with a by clause (rather than a statement that combines var and :=). Here, the assume statement does not help and the verifier cannot prove the existence of an a. Indeed, there is no trace of the assume statement in the Boogie that's generated.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered:
Dafny version
4.9.1
Code to produce this issue
Command to run and resulting output
What happened?
The
by
clause in methodWorks
works. The assumption contained therein proves the existence of ana
.Method
ByClauseIgnored
is similar, but uses just an assign-such-that statement with aby
clause (rather than a statement that combinesvar
and:=
). Here, theassume
statement does not help and the verifier cannot prove the existence of ana
. Indeed, there is no trace of theassume
statement in the Boogie that's generated.What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: