Skip to content

NLA in subscript leads to insufficient permission #518

@pieter-bos

Description

@pieter-bos

Here is a reduced case I encountered:

field f: Int

method test(i: Int, u: Seq[Ref], select: Int)
requires 0 < i && i < |u|
requires acc(u[0].f, write)
requires acc(u[i].f, write)
requires select == 0 || select == 1
{
  assert perm(u[select*i].f) == write // ok
  u[select*i].f := 0 // fails
}

It seems to me that proving the permission value is the same as the condition of the assignment. If the root cause really is just non-linear arithmetic, why is there a difference between the assertion and assignment? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions