Skip to content
Snippets Groups Projects
Commit 4f050d7a authored by Régis Blanc's avatar Régis Blanc
Browse files

add regression test for array

parent 45f42fc3
Branches
Tags
No related merge requests found
object Array1 {
def foo(): Int = {
val a = Array.fill(5)(0)
a(2) = 3
a(2)
} ensuring(_ == 0)
}
object Array2 {
def foo(): Int = {
val a = Array.fill(5)(0)
a(2) = 3
a.length
} ensuring(_ == 4)
}
import leon.Utils._
object Array3 {
def foo(): Int = {
val a = Array.fill(5)(3)
var i = 0
var sum = 0
(while(i <= a.length) {
sum = sum + a(i)
i = i + 1
}) invariant(i >= 0)
sum
} ensuring(_ == 15)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment