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 Testing {
trait V {
ghostfunctionRepr() : set<object>readsthisghostpredicateValid()
readsthisreadsRepr()
methodUpdate()
requiresthis.Valid()
modifiesRepr()
ensuresthis.Valid()
}
classC<T extends V>
{
var t: T
ghostfunctionRepr() : set<object>readsthisreads t as V
{
{ this, t as V } + (t as V).Repr()
}
ghostpredicateValid()
readsRepr()
{
(t as V).Valid()
}
constructorCreate(x: T)
{
t := x;
}
methodHUpdate()
requiresValid()
modifiesRepr()
ensuresValid()
{
(t as V).Update();
assert((t as V).Valid()); // Why doesn't this follow from the postcondition of `V.Update`?
}
}
}
Command to run and resulting output
C:\Apps\TestDafny>C:\Bin\dafny-4.8.1-win\Dafny.exe verify --type-system-refresh test.dfy
test.dfy(45,12): Error: assertion might not hold
|
45 | assert((t as V).Valid()); // Why doesn't this follow from the postcondition of `V.Update`?
| ^^^^^^^^^^^^^^^^^^
Dafny program verifier finished with 4 verified, 1 error
What happened?
I expected the assert to hold, since it follows directly from the postcondition of V.Update.
What type of operating system are you experiencing the problem on?
Windows
The text was updated successfully, but these errors were encountered:
jaylorch
added
the
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
label
Oct 17, 2024
Dafny version
4.8.1
Code to produce this issue
Command to run and resulting output
What happened?
I expected the
assert
to hold, since it follows directly from the postcondition of V.Update.What type of operating system are you experiencing the problem on?
Windows
The text was updated successfully, but these errors were encountered: