silicon icon indicating copy to clipboard operation
silicon copied to clipboard

Non-aliasing assumptions from unfolding predicates

Open viper-admin opened this issue 11 years ago • 5 comments

Created by @mschwerhoff on 2013-07-31 08:48 Last updated on 2019-11-16 14:58

Additional non-aliasing assumptions could be generated when unfolding permissions, as illustrated by the following program:

field next: Ref

predicate valid(this: Ref) {
  acc(this.next, wildcard) &&
  (((this.next) != (null)) ==> acc(valid(this.next), wildcard))
}

method testNestingUnfold(this: Ref)
  requires acc(valid(this), wildcard)
{
  unfold acc(valid(this), wildcard)
  assert ((this) != (this.next))

  if (((this.next) != (null))) {
    unfold acc(valid(this.next), wildcard)
    assert ((this.next) != (this.next.next))
    assert ((this) != (this.next.next))
  }
}

This is currently not done in Silicon.

viper-admin avatar Jul 31 '13 08:07 viper-admin

@alexanderjsummers on 2019-08-28 09:34:

  • edited the description

viper-admin avatar Aug 28 '19 09:08 viper-admin

@alexanderjsummers commented on 2019-08-28 09:35

The issue was fixed, but the code wasn't valid Viper code

viper-admin avatar Aug 28 '19 09:08 viper-admin

@alexanderjsummers on 2019-08-28 09:35:

  • changed state from new to resolved

viper-admin avatar Aug 28 '19 09:08 viper-admin

@mschwerhoff commented on 2019-11-16 14:58

This issue wasn't actually resolved, as can be seen when replacing each wildcard by 1/2 or write. It is merely a coincidence that the program as-is now verifies.

viper-admin avatar Nov 16 '19 14:11 viper-admin

@mschwerhoff on 2019-11-16 14:58:

  • changed state from resolved to open

viper-admin avatar Nov 16 '19 14:11 viper-admin