We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code results in a violation within the desugarer: main.gobra:
main.gobra
package main import pkg "pkg" type Impl struct{ x *int } pred (impl Impl) inv() { acc(impl.x) } func main() { x@ := 0 cl := preserves acc(&x) func closureImpl() int { x += 42 return x } proof cl implements pkg.ClosureSpec{Impl{&x}} { unfold Impl{&x}.inv() res = cl() as closureImpl fold Impl{&x}.inv() } }
pkg/pkg.gobra:
pkg/pkg.gobra
package pkg type Calls interface { pred inv() } ghost requires cs != nil preserves cs.inv() func ClosureSpec(ghost cs Calls) (res int) requires fn implements ClosureSpec{cs} requires cs != nil && cs.inv() ensures cs.inv() func Invoke(fn func () (int), ghost cs Calls) int { return fn() as ClosureSpec{cs} }
The text was updated successfully, but these errors were encountered:
Merge pull request #698 from viperproject/issue-697
a2915f9
Fixes #697
ArquintL
Successfully merging a pull request may close this issue.
The following code results in a violation within the desugarer:
main.gobra
:pkg/pkg.gobra
:The text was updated successfully, but these errors were encountered: