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

Some plugin interactions seem to be broken in ViperServer #184

Closed
marcoeilers opened this issue Dec 13, 2023 · 1 comment
Closed

Some plugin interactions seem to be broken in ViperServer #184

marcoeilers opened this issue Dec 13, 2023 · 1 comment

Comments

@marcoeilers
Copy link
Contributor

The following program verifies with standard Silicon and Carbon, but does not verify in VSCode (with an up to date version of Viper):

adt List[T] {
    Nil()
    Cons(elem: T, next: List[T])
}

adt Pair[S,T] {
    MkPair(fst: S, snd: T)
}

domain ListDomain[T] {
    function length(List[T]): Int

    axiom {
        length((Nil(): List[T])) == 0
    }

    axiom {
        forall l: List[T], e: T :: length(Cons(e, l)) == 1 + length(l)
    }
}

method zip(l1: List[Int], l2: List[Int]) returns (res: List[Pair[Int, Int]])
    decreases l1
    ensures length(l1) == length(l2) ==> length(res) == length(l1)
{

    if(l1 == Nil() || l2 == Nil()) {
        res := Nil()
    } else {
        var rest: List[Pair[Int, Int]] := zip(l1.next, l2.next)
        res := Cons(MkPair(l1.elem, l2.elem), rest)
    }
}

I'm reasonably sure that the problem is that the ADT plugin does not generate the well-foundedness axioms for the List type, and that may be because it does not get a config object that says that the termination plugin is active. So this seems potentially related to #165.

@marcoeilers
Copy link
Contributor Author

Fixed in #186

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