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
I’ve observed that the following code snippet successfully verifies with Gobra. However, in my opinion this should only work if h is marked as a ghost variable.
package main
type Rectangle struct {
Width, Height int
}
ghost
requires acc(r.Height)
ensures acc(r.Height)
pure func GetHeight(r *Rectangle) (res int) {
return r.Height
}
func main() {
r! := Rectangle{Width: 2, Height: 5}
h := GetHeight(&r)
assert h == GetHeight(&r) && h == 5
}
The text was updated successfully, but these errors were encountered:
I’ve observed that the following code snippet successfully verifies with Gobra. However, in my opinion this should only work if
h
is marked as a ghost variable.
The text was updated successfully, but these errors were encountered: