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

If statement triggers #420

Open
dewert99 opened this issue Jun 20, 2022 · 0 comments
Open

If statement triggers #420

dewert99 opened this issue Jun 20, 2022 · 0 comments
Labels

Comments

@dewert99
Copy link
Contributor

I did notice that Viper removes if's with empty bodies causing some strange behaviour with triggers eg:

domain MyInt {
  function succ(n: MyInt): MyInt
  function pred(n: MyInt): MyInt

  axiom ps{
    forall n:MyInt :: 
      { pred(succ(n)) }
        pred(succ(n)) == n
  }
}

method test(n: MyInt, m: MyInt)
requires succ(n) == succ(m) 
ensures n == m {
  if (pred(succ(n)) != n) {
    assume true // Removing this line will cause an error 
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant