The following program fails to verify:
field f: Int
method m(g: Ref, i: Int)
requires acc(g.f, i * wildcard)
{
assert acc(g.f, i * wildcard)
}
I first stumbled upon this where i
was a more complex expression (specifically, an abstract function). When you turn i into a constant, it verifies. Carbon reports the error reported in https://github.com/viperproject/carbon/issues/376. I might've reported the root cause of this error once before, but I wasn't sure, so I thought I'd file an issue. Is there a chance this is a bug, or is it an (expected) incompleteness?
Adding "i > 0" as a requires clause causes the example to verify, which I don't really understand. I would either expect a well-formedness error if i needed to be bigger than 0, or a pass without the "i > 0" clause...?