Skip to content
Snippets Groups Projects
Commit 8e90ce68 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Some list benchmarks with tests as spec

parent 06b11bd6
No related branches found
No related tags found
No related merge requests found
import leon.lang._
import leon.collection._
import leon.lang.synthesis._
object Lists {
def safetail(l: List[Int]): List[Int] = choose { (res : List[Int]) =>
passes(l, res)(Map(
Cons(1, Cons(2, Cons(3, Cons(4, Nil())))) -> Cons(2, Cons(3, Cons(4, Nil()))),
Cons(2, Cons(3, Cons(4, Nil()))) -> Cons(3, Cons(4, Nil())),
Nil() -> Nil()
))
}
def uniq(l: List[Int]): List[Int] = choose { (res : List[Int]) =>
passes(l, res)(Map(
Cons(1, Cons(1, Cons(1, Cons(2, Nil())))) -> Cons(1, Cons(2, Nil())),
Cons(3, Cons(3, Cons(4, Nil()))) -> Cons(3, Cons(4, Nil())),
Nil() -> Nil()
))
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment