diff --git a/testcases/web/demos/001_Tutorial-Max.scala b/testcases/web/demos/001_Tutorial-Max.scala index 75ac1a0b6b8fa29a77b1a0b5ca62360cbe71b764..ba1aaca110227613b4a4e8a792f666e61119f440 100644 --- a/testcases/web/demos/001_Tutorial-Max.scala +++ b/testcases/web/demos/001_Tutorial-Max.scala @@ -1,4 +1,3 @@ -import leon.lang._ import leon.lang.synthesis._ import leon.annotation._ object Max { @@ -42,7 +41,8 @@ object Max { max(x,y) == max(y,x) && max(x,max(y,z)) == max(max(x,y), z) && max(x,y) + z == max(x + z, y + z) - } holds + } ensuring(_ == true) + // holds */ /* @@ -54,4 +54,10 @@ object Max { } ensuring (res => x <= res && y <= res && (res == x || res == y)) */ + +/* + def max(x: BigInt, y: BigInt): BigInt = { + ???[BigInt] + } ensuring(res => (res == x || res == y) && x <= res && y <= res) +*/ } diff --git a/testcases/web/demos/003_Tutorial-Sort.scala b/testcases/web/demos/003_Tutorial-Sort.scala index f665aecc5df5f2fccfd61b6823d639d9bf4c6280..aa5629f9b676f63c968972fb0a0b61b0696df1fa 100644 --- a/testcases/web/demos/003_Tutorial-Sort.scala +++ b/testcases/web/demos/003_Tutorial-Sort.scala @@ -1,18 +1,10 @@ -import leon.lang._ +import leon.lang.Set import leon.lang.synthesis._ -import leon.annotation._ object Sort { sealed abstract class List case object Nil extends List case class Cons(head: BigInt, tail: List) extends List - def size(l: List): BigInt = (l match { - case Nil => 0 - case Cons(x, rest) => x + size(rest) - }) ensuring(res => res > 0) - - def s1 = size(Cons(10, Cons(1000, Nil))) - def content(l: List): Set[BigInt] = l match { case Nil => Set() case Cons(i, t) => Set(i) ++ content(t) @@ -53,7 +45,6 @@ object Sort { } } ensuring {(res:List) => isSorted(res) && content(res) == content(l) ++ Set(x)} - // size(res) == size(l) + 1 */ // We can also synthesize the body of sInsert interactively