Skip to content
New issue

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

Verification errors resulting from global constants defined in terms of mutable global state #113

Open
marcoeilers opened this issue Apr 15, 2018 · 0 comments
Assignees

Comments

@marcoeilers
Copy link
Owner

If we have stateless global constants that are defined in terms of something stateful, Nagini generates Viper functions whose verification fails because of insufficient permissions. Additionally, because this is not expected, the attempt to generate an error message leads to a stack trace in this case.

Example:

from nagini_contracts.contracts import *
from typing import List, Tuple

a = [1,2]
b = a[1]

leads to the generation of

function b(): Ref
  ensures issubtype(typeof(result), int())
  ensures result == list___getitem__(a(), __prim__int___box__(1)) 
{
  list___getitem__(a(), __prim__int___box__(1))
}

which doesn't verify.

@marcoeilers marcoeilers self-assigned this Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant