We are able to prove false in the function lenght below. This should not be possible.
adt List[T] {
Nil()
Cons(value : T, tail : List[T])
}
function lenght(xs : List[Int]) : Int
ensures lenght(xs) >= 0
ensures xs.isNil ==> lenght(xs) == 0
ensures (xs.isCons ==> lenght(xs) == lenght(xs.tail) + 2)
ensures false
{
(xs.isNil ? 0 : (1 + lenght(xs.tail)))
}
We are able to prove false in the function lenght below. This should not be possible.