Skip to content
Snippets Groups Projects
Commit e067b90c authored by Regis Blanc's avatar Regis Blanc
Browse files

more tricky test

parent 2ba2fb5f
No related branches found
No related tags found
No related merge requests found
import leon.lang._
object NestedFunState5 {
def deep(n: BigInt): BigInt = {
require(n > 0)
var a = BigInt(0)
def iter(prevA: BigInt): Unit = {
require(prevA == a)
def nestedIter(): Unit = {
a += 1
}
nestedIter()
nestedIter()
} ensuring(_ => a == prevA + 2)
var i = BigInt(0)
(while(i < n) {
i += 1
iter(a)
}) invariant(i >= 0 && i <= n && a >= 2*i)
a
} ensuring(_ >= 2*n)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment