viperproject / viperproject/silver

Unfolding and its effect are limited/scoped to the function body

Open
#495 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
100
Forks
53
Avg merge
8h 10m
Merged PRs (30d)
2

Description

The following program fails to verify in Silicon and Carbon, but by uncommenting the first assert statement everything goes through. The incompleteness is essentially by design, as explained by @mschwerhoff in https://github.com/viperproject/silicon/issues/529#issuecomment-777303780.

predicate P(x: Int) {
    x == 123
}

function property(x: Int): Bool
    requires P(x)
{
    unfolding P(x) in x == 123
}

method check_property(x: Int)
  requires P(x)
{
    // assert unfolding P(x) in true
    assert property(x); // Fails
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproducer in the issue and run it in Silicon and Carbon to confirm the differing behavior. Read the linked Silicon issue comment for the existing rationale and determine the intended unfolding scope. Done should include an agreed behavior and regression coverage for the reproducer.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.