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

Old on a local variable affects triggering #603

Closed
vakaras opened this issue Mar 3, 2022 · 2 comments
Closed

Old on a local variable affects triggering #603

vakaras opened this issue Mar 3, 2022 · 2 comments

Comments

@vakaras
Copy link
Contributor

vakaras commented Mar 3, 2022

The following example fails to verify:

domain Snap$Array {
  function read(arr: Snap$Array, idx: Int): Int
}

function snap(self: Ref): Snap$Array
  requires acc(Array(self), write)

predicate Array(self: Ref)

method m_foo()
{
  var array: Ref
  inhale acc(Array(array), write)
  inhale (forall i: Int :: { read(snap(array), i) }
    0 <= i && i < 10 ==> read(snap(array), i) == 42)
  label l8
  exhale acc(Array(array), write)
  inhale acc(Array(array), write)
  assert array == old[l8](array)
  inhale forall i: Int ::
    { read(snap(array), i) } // using *only* this trigger fails verification
    // { read(snap(old[l8](array)), i) } // it's this trigger that makes verification succeed
    0 <= i && i < 10  ==> read(snap(array), i) == old[l8](read(snap(array), i))
  assert (forall i: Int :: { read(snap(array), i) }
    0 <= i && i < 10 ==> read(snap(array), i) == 42)
}

Replacing trigger read(snap(array), i) with read(snap(old[l8](array)), i) makes the example to verify even though Silicon clearly knowns that array == old[l8](array).

@mschwerhoff Any clue what is happening here?

The example was found and reduced by Pointerbender.

@mschwerhoff
Copy link
Contributor

Potentially related issues: #362, #371

@marcoeilers
Copy link
Contributor

Resolved by PR #710.

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

3 participants