viperproject / viperproject/silver

Trigger computation algorithm has unexpected effect on negative integer literals

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

Nobody has claimed this yet.

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

Description

Created by @mschwerhoff on 2014-08-31 18:52

Consider the following Silver snippet:

#!text

function fun(i: Int): Int
  requires i >= 0
{ i }

method test() {
  assert forall i: Int :: (i in Seq(-2,2,4,6,8)) ==> (fun(i*i) > i)
}

The version of the quantifier returned by the trigger computation algorithm (autoTrigger) is:

#!text
forall i: Int, fresh__1: Int ::
  { (i in Seq(fresh__1, 2, 4, 6, 8)) }
  i in Seq(-2, 2, 4, 6, 8) ==> fun(i * i) > i

In my opinion, the negative integer literal -2 should not have been replaced by a fresh, quantified variable.

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

Reproduce the Silver snippet in the issue and inspect the autoTrigger implementation that transforms the quantified expression. Check how negative integer literals are handled when constructing trigger terms. Done means the generated trigger preserves -2 rather than replacing it with a fresh quantified variable, while the example still verifies correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.