viperproject / viperproject/silver
ADT plugin `contains` cannot prove lack of value
Open
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 100
- Forks
- 53
- Avg merge
- 8h 10m
- Merged PRs (30d)
- 2
Description
import <adt/derives.vpr>
adt List[T] {
Nil()
Cons(value: T, tail: List[T])
} derives {
contains
}
method client() {
var x: List[Int] := Cons(42, Cons(33, Nil()))
assert contains(42, x) // passes, as expected
assert !contains(0, x) // fails
}
I think the axioms generated for contains are strong enough to prove which values are in the given ADT, but they do not say which values are not.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ADT derives contains plugin and inspect the axioms it generates for the List example. Check why the axioms establish membership but do not establish non-membership, then verify that both contains(42, x) and !contains(0, x) can be proved for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100