Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADT plugin contains cannot prove lack of value #596

Open
Aurel300 opened this issue Jul 18, 2022 · 0 comments
Open

ADT plugin contains cannot prove lack of value #596

Aurel300 opened this issue Jul 18, 2022 · 0 comments

Comments

@Aurel300
Copy link
Member

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.

@Aurel300 Aurel300 changed the title ADT plugin "contains" cannot prove lack of value ADT plugin contains cannot prove lack of value Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant