Skip to content
Snippets Groups Projects
Commit a98b4f03 authored by Philippe Suter's avatar Philippe Suter
Browse files

improvement of benchmarks

parent 0534bfe9
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ object Implicit { ...@@ -23,7 +23,7 @@ object Implicit {
require(isInt(u)) require(isInt(u))
u match { u match {
case UInt(i) => i case UInt(i) => i
case _ => 0 //case _ => 0
} }
} }
...@@ -36,11 +36,12 @@ object Implicit { ...@@ -36,11 +36,12 @@ object Implicit {
require(isIntSet(u)) require(isIntSet(u))
u match { u match {
case UIntSet(s) => s case UIntSet(s) => s
case _ => Set.empty[Int] //case _ => Set.empty[Int]
} }
} }
def sum(u1 : U, u2 : U) : U = { def sum(u1 : U, u2 : U) : U = {
require(isInt(u1) && isInt(u2))
(u1 : Int) + u2 (u1 : Int) + u2
} }
......
...@@ -6,7 +6,7 @@ object BVs { ...@@ -6,7 +6,7 @@ object BVs {
def size(l : List) : Int = { def size(l : List) : Int = {
l match { l match {
case Nil() => 0 case Nil() => 0
case Cons(_, xs) => 1 + size(xs) case Cons(_, xs) => 1 + /* for "small" counter examples: */ 2 * size(xs)
} }
} ensuring(_ >= 0) // smallest counter-example is a list of size Integer.MAX_VALUE, could take a while to find it :) } ensuring(_ >= 0) // smallest counter-example is a list of size Integer.MAX_VALUE, could take a while to find it :)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment