From b5717ddb7a835b9c11e568d0446b60f19b47c535 Mon Sep 17 00:00:00 2001
From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch>
Date: Wed, 1 Jul 2015 12:10:18 +0200
Subject: [PATCH] Update repair bench.

---
 .../leon/synthesis/rules/CEGISLike.scala      |   4 +-
 testcases/repair/Compiler/Compiler.scala      |  18 +-
 testcases/repair/Compiler/Compiler1.scala     |  60 +++-
 testcases/repair/Compiler/Compiler2.scala     |  59 ++-
 testcases/repair/Compiler/Compiler3.scala     |  55 ++-
 testcases/repair/Compiler/Compiler4.scala     |  54 ++-
 testcases/repair/Compiler/Compiler5.scala     |  22 +-
 testcases/repair/Compiler/Compiler6.scala     |  20 +-
 testcases/repair/Compiler/Compiler7.scala     |  24 +-
 testcases/repair/Heap/Heap.scala              |  18 +-
 testcases/repair/Heap/Heap1.scala             |  20 +-
 testcases/repair/Heap/Heap10.scala            |  20 +-
 testcases/repair/Heap/Heap2.scala             |  25 +-
 testcases/repair/Heap/Heap3.scala             |  18 +-
 testcases/repair/Heap/Heap4.scala             |  20 +-
 testcases/repair/Heap/Heap5.scala             |  20 +-
 testcases/repair/Heap/Heap6.scala             |  26 +-
 testcases/repair/Heap/Heap7.scala             |  20 +-
 testcases/repair/Heap/Heap8.scala             |  20 +-
 testcases/repair/Heap/Heap9.scala             |  20 +-
 testcases/repair/List/List.scala              | 324 ++++++++---------
 testcases/repair/List/List1.scala             | 324 ++++++++---------
 testcases/repair/List/List10.scala            | 330 ++++++++---------
 testcases/repair/List/List11.scala            | 337 ++++++++---------
 testcases/repair/List/List12.scala            | 339 +++++++++---------
 testcases/repair/List/List13.scala            | 339 +++++++++---------
 testcases/repair/List/List2.scala             | 333 +++++++++--------
 testcases/repair/List/List3.scala             | 332 +++++++++--------
 testcases/repair/List/List4.scala             | 337 ++++++++---------
 testcases/repair/List/List5.scala             | 331 ++++++++---------
 testcases/repair/List/List6.scala             | 333 ++++++++---------
 testcases/repair/List/List7.scala             | 327 +++++++++--------
 testcases/repair/List/List8.scala             | 327 +++++++++--------
 testcases/repair/List/List9.scala             | 329 +++++++++--------
 testcases/repair/MergeSort/MergeSort.scala    |   8 +-
 testcases/repair/MergeSort/MergeSort1.scala   |  26 +-
 testcases/repair/MergeSort/MergeSort2.scala   |  10 +-
 testcases/repair/MergeSort/MergeSort3.scala   |  10 +-
 testcases/repair/MergeSort/MergeSort4.scala   |  10 +-
 testcases/repair/MergeSort/MergeSort5.scala   |  14 +-
 testcases/repair/MergeSort/repairs.last       |   4 -
 testcases/repair/Numerical/Numerical.scala    |  36 +-
 testcases/repair/Numerical/Numerical1.scala   |  36 +-
 testcases/repair/Numerical/Numerical2.scala   |  36 +-
 testcases/repair/Numerical/Numerical3.scala   |  36 +-
 testcases/repair/PropLogic/PropLogic.scala    |   6 +-
 testcases/repair/PropLogic/PropLogic1.scala   |  19 +-
 testcases/repair/PropLogic/PropLogic2.scala   |  15 +-
 testcases/repair/PropLogic/PropLogic3.scala   |  16 +-
 testcases/repair/PropLogic/PropLogic4.scala   |  16 +-
 testcases/repair/PropLogic/PropLogic5.scala   |  16 +-
 .../RedBlackTree-old/RedBlackTree.scala       | 101 ------
 .../RedBlackTree-old/RedBlackTree1.scala      | 143 --------
 .../RedBlackTree-old/RedBlackTree2.scala      | 143 --------
 .../RedBlackTree-old/RedBlackTree3.scala      | 143 --------
 .../RedBlackTree-old/RedBlackTree4.scala      | 143 --------
 .../RedBlackTree-old/RedBlackTree5.scala      | 144 --------
 .../RedBlackTree-old/RedBlackTree6.scala      | 142 --------
 .../RedBlackTree-old/RedBlackTree7.scala      | 143 --------
 testcases/repair/runTests.sh                  |   2 +-
 60 files changed, 2807 insertions(+), 3796 deletions(-)
 delete mode 100644 testcases/repair/MergeSort/repairs.last
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree1.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree2.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree3.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree4.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree5.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree6.scala
 delete mode 100644 testcases/repair/RedBlackTree-old/RedBlackTree7.scala

diff --git a/src/main/scala/leon/synthesis/rules/CEGISLike.scala b/src/main/scala/leon/synthesis/rules/CEGISLike.scala
index 884c18254..c2eac3128 100644
--- a/src/main/scala/leon/synthesis/rules/CEGISLike.scala
+++ b/src/main/scala/leon/synthesis/rules/CEGISLike.scala
@@ -420,11 +420,11 @@ abstract class CEGISLike[T <% Typed](name: String) extends Rule(name) {
             res == BooleanLiteral(true)
 
           case EvaluationResults.RuntimeError(err) =>
-            sctx.reporter.warning("RE testing CE: "+err)
+            sctx.reporter.debug("RE testing CE: "+err)
             false
 
           case EvaluationResults.EvaluatorError(err) =>
-            sctx.reporter.error("Error testing CE: "+err)
+            sctx.reporter.debug("Error testing CE: "+err)
             false
         }
       }
diff --git a/testcases/repair/Compiler/Compiler.scala b/testcases/repair/Compiler/Compiler.scala
index 697f333e0..f0d0ed1f0 100644
--- a/testcases/repair/Compiler/Compiler.scala
+++ b/testcases/repair/Compiler/Compiler.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -160,7 +160,7 @@ object Desugar {
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -174,10 +174,10 @@ object Desugar {
 object Evaluator {
   import Trees._
 
-  def bToi(b: Boolean) = if (b) 1 else 0
-  def iTob(i: Int)     = i == 1
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
 
-  def eval(e: Expr): Int = {
+  def eval(e: Expr): BigInt = {
     e match {
       case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
       case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
diff --git a/testcases/repair/Compiler/Compiler1.scala b/testcases/repair/Compiler/Compiler1.scala
index 2971855c7..f3e840442 100644
--- a/testcases/repair/Compiler/Compiler1.scala
+++ b/testcases/repair/Compiler/Compiler1.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,11 +141,11 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
-    case Trees.Plus (lhs, rhs) => Neg(desugar(lhs)) // FIXME: Complete nonsense. Leon can't disprove it, uses example...
+    case Trees.Plus (lhs, rhs) => Neg(desugar(lhs)) // FIXME
     case Trees.Minus(lhs, rhs) => Plus(desugar(lhs), Neg(desugar(rhs)))
     case Trees.LessThan(lhs, rhs) => LessThan(desugar(lhs), desugar(rhs))
     case Trees.And  (lhs, rhs) => Ite(desugar(lhs), desugar(rhs), Literal(0)) 
@@ -156,15 +156,11 @@ object Desugar {
     case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(thn), desugar(els))
     case Trees.IntLiteral(v)  => Literal(v)
     case Trees.BoolLiteral(b) => Literal(b2i(b))
-  }} ensuring { res =>
-    ((e, res) passes {
-      case Trees.Plus(Trees.IntLiteral(i), Trees.Minus(Trees.IntLiteral(j), Trees.IntLiteral(42))) =>
-        Plus(Literal(i), Plus(Literal(j), Neg(Literal(42))))
-    }) &&
+  }} ensuring { res => 
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -174,3 +170,43 @@ object Desugar {
   }
 
 }
+
+object Evaluator {
+  import Trees._
+
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
+
+  def eval(e: Expr): BigInt = {
+    e match {
+      case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
+      case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
+      case LessThan(lhs, rhs)  => bToi(eval(lhs) < eval(rhs))
+      case And(lhs, rhs)       => bToi(iTob(eval(lhs)) && iTob(eval(rhs)))
+      case Or(lhs, rhs)        => bToi(iTob(eval(lhs)) || iTob(eval(rhs)))
+      case Not(e)              => bToi(!iTob(eval(e)))
+      case Eq(lhs, rhs)        => bToi(eval(lhs) == eval(rhs))
+      case Ite(cond, thn, els) => if (iTob(eval(cond))) eval(thn) else eval(els)
+      case IntLiteral(v)       => v
+      case BoolLiteral(b)      => bToi(b)
+    }
+  }
+}
+
+object Simplifier {
+  import Trees._
+  import Evaluator._
+
+  @induct
+  def simplify(e: Expr): Expr = {
+    e match {
+      case And(BoolLiteral(false), _)           => BoolLiteral(false)
+      case Or(BoolLiteral(true), _)             => BoolLiteral(true)
+      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a+b)
+      case Not(Not(Not(a)))                     => Not(a)
+      case e => e
+    }
+  } ensuring {
+    res => eval(res) == eval(e)
+  }
+}
diff --git a/testcases/repair/Compiler/Compiler2.scala b/testcases/repair/Compiler/Compiler2.scala
index a068dadcb..6703cf715 100644
--- a/testcases/repair/Compiler/Compiler2.scala
+++ b/testcases/repair/Compiler/Compiler2.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,12 +141,12 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
     case Trees.Plus (lhs, rhs) => Plus(desugar(lhs), desugar(rhs))
-    case Trees.Minus(lhs, rhs) => Literal(0)//Plus(desugar(lhs), desugar(rhs)) // FIXME forgot Neg
+    case Trees.Minus(lhs, rhs) => Literal(0)// FIXME: Plus(desugar(lhs), Neg(desugar(rhs)))
     case Trees.LessThan(lhs, rhs) => LessThan(desugar(lhs), desugar(rhs))
     case Trees.And  (lhs, rhs) => Ite(desugar(lhs), desugar(rhs), Literal(0)) 
     case Trees.Or   (lhs, rhs) => Ite(desugar(lhs), Literal(1), desugar(rhs))
@@ -157,13 +157,10 @@ object Desugar {
     case Trees.IntLiteral(v)  => Literal(v)
     case Trees.BoolLiteral(b) => Literal(b2i(b))
   }} ensuring { res => 
-    sem(res) == Semantics.semUntyped(e) && ((e,res) passes {
-      case Trees.Minus(Trees.IntLiteral(42), Trees.IntLiteral(i)) => 
-        Plus(Literal(42), Neg(Literal(i)))
-    })
+    sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -173,3 +170,43 @@ object Desugar {
   }
 
 }
+
+object Evaluator {
+  import Trees._
+
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
+
+  def eval(e: Expr): BigInt = {
+    e match {
+      case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
+      case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
+      case LessThan(lhs, rhs)  => bToi(eval(lhs) < eval(rhs))
+      case And(lhs, rhs)       => bToi(iTob(eval(lhs)) && iTob(eval(rhs)))
+      case Or(lhs, rhs)        => bToi(iTob(eval(lhs)) || iTob(eval(rhs)))
+      case Not(e)              => bToi(!iTob(eval(e)))
+      case Eq(lhs, rhs)        => bToi(eval(lhs) == eval(rhs))
+      case Ite(cond, thn, els) => if (iTob(eval(cond))) eval(thn) else eval(els)
+      case IntLiteral(v)       => v
+      case BoolLiteral(b)      => bToi(b)
+    }
+  }
+}
+
+object Simplifier {
+  import Trees._
+  import Evaluator._
+
+  @induct
+  def simplify(e: Expr): Expr = {
+    e match {
+      case And(BoolLiteral(false), _)           => BoolLiteral(false)
+      case Or(BoolLiteral(true), _)             => BoolLiteral(true)
+      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a+b)
+      case Not(Not(Not(a)))                     => Not(a)
+      case e => e
+    }
+  } ensuring {
+    res => eval(res) == eval(e)
+  }
+}
diff --git a/testcases/repair/Compiler/Compiler3.scala b/testcases/repair/Compiler/Compiler3.scala
index ec61a78a5..24937f81a 100644
--- a/testcases/repair/Compiler/Compiler3.scala
+++ b/testcases/repair/Compiler/Compiler3.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -153,15 +153,14 @@ object Desugar {
     case Trees.Not(e) => Ite(desugar(e), Literal(0), Literal(1))
     case Trees.Eq(lhs, rhs) =>
       Eq(desugar(lhs), desugar(rhs))
-    // FIXME switched the branches
-    case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(els), desugar(thn)) 
+    case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(els), desugar(thn)) // FIXME
     case Trees.IntLiteral(v)  => Literal(v)
     case Trees.BoolLiteral(b) => Literal(b2i(b))
   }} ensuring { res => 
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -171,3 +170,43 @@ object Desugar {
   }
 
 }
+
+object Evaluator {
+  import Trees._
+
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
+
+  def eval(e: Expr): BigInt = {
+    e match {
+      case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
+      case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
+      case LessThan(lhs, rhs)  => bToi(eval(lhs) < eval(rhs))
+      case And(lhs, rhs)       => bToi(iTob(eval(lhs)) && iTob(eval(rhs)))
+      case Or(lhs, rhs)        => bToi(iTob(eval(lhs)) || iTob(eval(rhs)))
+      case Not(e)              => bToi(!iTob(eval(e)))
+      case Eq(lhs, rhs)        => bToi(eval(lhs) == eval(rhs))
+      case Ite(cond, thn, els) => if (iTob(eval(cond))) eval(thn) else eval(els)
+      case IntLiteral(v)       => v
+      case BoolLiteral(b)      => bToi(b)
+    }
+  }
+}
+
+object Simplifier {
+  import Trees._
+  import Evaluator._
+
+  @induct
+  def simplify(e: Expr): Expr = {
+    e match {
+      case And(BoolLiteral(false), _)           => BoolLiteral(false)
+      case Or(BoolLiteral(true), _)             => BoolLiteral(true)
+      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a+b)
+      case Not(Not(Not(a)))                     => Not(a)
+      case e => e
+    }
+  } ensuring {
+    res => eval(res) == eval(e)
+  }
+}
diff --git a/testcases/repair/Compiler/Compiler4.scala b/testcases/repair/Compiler/Compiler4.scala
index 9f6ac963a..33f24376e 100644
--- a/testcases/repair/Compiler/Compiler4.scala
+++ b/testcases/repair/Compiler/Compiler4.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -150,7 +150,7 @@ object Desugar {
     case Trees.LessThan(lhs, rhs) => LessThan(desugar(lhs), desugar(rhs))
     case Trees.And  (lhs, rhs) => Ite(desugar(lhs), desugar(rhs), Literal(0)) 
     case Trees.Or   (lhs, rhs) => Ite(desugar(lhs), Literal(1), desugar(rhs))
-    case Trees.Not(e) => Ite(desugar(e), Literal(1), Literal(1)) // FIXME else should be 0
+    case Trees.Not(e) => Ite(desugar(e), Literal(1), Literal(1)) // FIMXE should be 0
     case Trees.Eq(lhs, rhs) =>
       Eq(desugar(lhs), desugar(rhs))
     case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(thn), desugar(els))
@@ -160,7 +160,7 @@ object Desugar {
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -170,3 +170,43 @@ object Desugar {
   }
 
 }
+
+object Evaluator {
+  import Trees._
+
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
+
+  def eval(e: Expr): BigInt = {
+    e match {
+      case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
+      case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
+      case LessThan(lhs, rhs)  => bToi(eval(lhs) < eval(rhs))
+      case And(lhs, rhs)       => bToi(iTob(eval(lhs)) && iTob(eval(rhs)))
+      case Or(lhs, rhs)        => bToi(iTob(eval(lhs)) || iTob(eval(rhs)))
+      case Not(e)              => bToi(!iTob(eval(e)))
+      case Eq(lhs, rhs)        => bToi(eval(lhs) == eval(rhs))
+      case Ite(cond, thn, els) => if (iTob(eval(cond))) eval(thn) else eval(els)
+      case IntLiteral(v)       => v
+      case BoolLiteral(b)      => bToi(b)
+    }
+  }
+}
+
+object Simplifier {
+  import Trees._
+  import Evaluator._
+
+  @induct
+  def simplify(e: Expr): Expr = {
+    e match {
+      case And(BoolLiteral(false), _)           => BoolLiteral(false)
+      case Or(BoolLiteral(true), _)             => BoolLiteral(true)
+      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a+b)
+      case Not(Not(Not(a)))                     => Not(a)
+      case e => e
+    }
+  } ensuring {
+    res => eval(res) == eval(e)
+  }
+}
diff --git a/testcases/repair/Compiler/Compiler5.scala b/testcases/repair/Compiler/Compiler5.scala
index 3a605de3d..5ce706212 100644
--- a/testcases/repair/Compiler/Compiler5.scala
+++ b/testcases/repair/Compiler/Compiler5.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -150,17 +150,17 @@ object Desugar {
     case Trees.LessThan(lhs, rhs) => LessThan(desugar(lhs), desugar(rhs))
     case Trees.And  (lhs, rhs) => Ite(desugar(lhs), desugar(rhs), Literal(0)) 
     case Trees.Or   (lhs, rhs) => Ite(desugar(lhs), Literal(1), desugar(rhs))
-    case Trees.Not(e) => Ite(desugar(e), Literal(1), Literal(1)) //FIXME
+    case Trees.Not(e) => Ite(desugar(e), Literal(1), Literal(1)) // FIMXE
     case Trees.Eq(lhs, rhs) =>
       Eq(desugar(lhs), desugar(rhs))
-    case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(els), desugar(thn))//FIXME
+    case Trees.Ite(cond, thn, els) => Ite(desugar(cond), desugar(els), desugar(thn)) // FIXME
     case Trees.IntLiteral(v)  => Literal(v)
     case Trees.BoolLiteral(b) => Literal(b2i(b))
   }} ensuring { res => 
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -174,10 +174,10 @@ object Desugar {
 object Evaluator {
   import Trees._
 
-  def bToi(b: Boolean) = if (b) 1 else 0
-  def iTob(i: Int)     = i == 1
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
 
-  def eval(e: Expr): Int = {
+  def eval(e: Expr): BigInt = {
     e match {
       case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
       case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
diff --git a/testcases/repair/Compiler/Compiler6.scala b/testcases/repair/Compiler/Compiler6.scala
index 95003d1af..0848603a1 100644
--- a/testcases/repair/Compiler/Compiler6.scala
+++ b/testcases/repair/Compiler/Compiler6.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -160,7 +160,7 @@ object Desugar {
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -174,10 +174,10 @@ object Desugar {
 object Evaluator {
   import Trees._
 
-  def bToi(b: Boolean) = if (b) 1 else 0
-  def iTob(i: Int)     = i == 1
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
 
-  def eval(e: Expr): Int = {
+  def eval(e: Expr): BigInt = {
     e match {
       case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
       case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
@@ -202,7 +202,7 @@ object Simplifier {
     e match {
       case And(BoolLiteral(false), _)           => BoolLiteral(false)
       case Or(BoolLiteral(true), _)             => BoolLiteral(true)
-      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a-b)
+      case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a-b) // FIXME
       case Not(Not(Not(a)))                     => Not(a)
       case e => e
     }
diff --git a/testcases/repair/Compiler/Compiler7.scala b/testcases/repair/Compiler/Compiler7.scala
index 0e6364fc5..890f42f6e 100644
--- a/testcases/repair/Compiler/Compiler7.scala
+++ b/testcases/repair/Compiler/Compiler7.scala
@@ -13,7 +13,7 @@ object Trees {
   case class Not(e : Expr) extends Expr
   case class Eq(lhs: Expr, rhs: Expr) extends Expr
   case class Ite(cond: Expr, thn: Expr, els: Expr) extends Expr
-  case class IntLiteral(v: Int) extends Expr
+  case class IntLiteral(v: BigInt) extends Expr
   case class BoolLiteral(b : Boolean) extends Expr
 }
 
@@ -74,7 +74,7 @@ object Semantics {
   import Types._
   import TypeChecker._
   
-  def semI(t : Expr) : Int = {
+  def semI(t : Expr) : BigInt = {
     require( typeOf(t) == ( Some(IntType) : Option[Type] ))
     t match {
       case Plus(lhs , rhs) => semI(lhs) + semI(rhs)
@@ -102,10 +102,10 @@ object Semantics {
     }
   }
  
-  def b2i(b : Boolean) = if (b) 1 else 0
+  def b2i(b : Boolean): BigInt = if (b) 1 else 0
 
   @induct
-  def semUntyped( t : Expr) : Int = { t match {
+  def semUntyped( t : Expr) : BigInt = { t match {
     case Plus (lhs, rhs) => semUntyped(lhs) + semUntyped(rhs)
     case Minus(lhs, rhs) => semUntyped(lhs) - semUntyped(rhs)
     case And  (lhs, rhs) => if (semUntyped(lhs)!=0) semUntyped(rhs) else 0
@@ -141,7 +141,7 @@ object Desugar {
   case class Ite(cond : SimpleE, thn : SimpleE, els : SimpleE) extends SimpleE
   case class Eq(lhs : SimpleE, rhs : SimpleE) extends SimpleE
   case class LessThan(lhs : SimpleE, rhs : SimpleE) extends SimpleE
-  case class Literal(i : Int) extends SimpleE
+  case class Literal(i : BigInt) extends SimpleE
 
   @induct
   def desugar(e : Trees.Expr) : SimpleE = { e match {
@@ -160,7 +160,7 @@ object Desugar {
     sem(res) == Semantics.semUntyped(e)
   }
 
-  def sem(e : SimpleE) : Int = e match {
+  def sem(e : SimpleE) : BigInt = e match {
     case Plus (lhs, rhs) => sem(lhs) + sem(rhs)
     case Ite(cond, thn, els) => if (sem(cond) != 0) sem(thn) else sem(els)
     case Neg(arg) => -sem(arg) 
@@ -174,10 +174,10 @@ object Desugar {
 object Evaluator {
   import Trees._
 
-  def bToi(b: Boolean) = if (b) 1 else 0
-  def iTob(i: Int)     = i == 1
+  def bToi(b: Boolean): BigInt = if (b) 1 else 0
+  def iTob(i: BigInt) = i == 1
 
-  def eval(e: Expr): Int = {
+  def eval(e: Expr): BigInt = {
     e match {
       case Plus(lhs, rhs)      => eval(lhs) + eval(rhs)
       case Minus(lhs, rhs)     => eval(lhs) + eval(rhs)
@@ -201,14 +201,12 @@ object Simplifier {
   def simplify(e: Expr): Expr = {
     e match {
       case And(BoolLiteral(false), _)           => BoolLiteral(false)
-      case Or(BoolLiteral(true), _)             => BoolLiteral(false)
+      case Or(BoolLiteral(true), _)             => BoolLiteral(false) // FIMXE
       case Plus(IntLiteral(a), IntLiteral(b))   => IntLiteral(a+b)
       case Not(Not(Not(a)))                     => Not(a)
       case e => e
     }
   } ensuring {
-    res => eval(res) == eval(e) && ((e, res) passes {
-      case Or(BoolLiteral(true), e) => BoolLiteral(true)
-    })
+    res => eval(res) == eval(e)
   }
 }
diff --git a/testcases/repair/Heap/Heap.scala b/testcases/repair/Heap/Heap.scala
index 547a11456..c7df65b60 100644
--- a/testcases/repair/Heap/Heap.scala
+++ b/testcases/repair/Heap/Heap.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigBigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigBigInt] = this match {
+      case Leaf() => Set[BigBigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigBigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigBigInt, i2 : BigBigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigBigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigBigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigBigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigBigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap1.scala b/testcases/repair/Heap/Heap1.scala
index 39c1ee204..bb6294030 100644
--- a/testcases/repair/Heap/Heap1.scala
+++ b/testcases/repair/Heap/Heap1.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -60,7 +60,7 @@ object Heaps {
       case (Leaf(), _) => h2
       case (_, Leaf()) => h1
       case (Node(v1, l1, r1), Node(v2, l2, r2)) =>
-        //if(v1 >= v2) FIXME forgot this condition
+        //if(v1 >= v2) // FIXME
           makeN(v1, l1, merge(r1, h2))
         //else
         //  makeN(v2, l2, merge(h1, r2))
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap10.scala b/testcases/repair/Heap/Heap10.scala
index 25e966e41..bba2389a3 100644
--- a/testcases/repair/Heap/Heap10.scala
+++ b/testcases/repair/Heap/Heap10.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -57,7 +57,7 @@ object Heaps {
       hasHeapProperty(h1) && hasHeapProperty(h2)
     )
     (h1,h2) match {
-      case (Leaf(), _) => h1 // FIXME: swapped h1 and h2 between the cases
+      case (Leaf(), _) => h1 // FIXME: swapped these cases
       case (_, Leaf()) => h2 // FIXME
       case (Node(v1, l1, r1), Node(v2, l2, r2)) =>
         if(v1 >= v2)
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap2.scala b/testcases/repair/Heap/Heap2.scala
index c97a9dd52..75f53a963 100644
--- a/testcases/repair/Heap/Heap2.scala
+++ b/testcases/repair/Heap/Heap2.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -61,9 +61,9 @@ object Heaps {
       case (_, Leaf()) => h1
       case (Node(v1, l1, r1), Node(v2, l2, r2)) =>
         if(v1 >= v2)
-          Node(v1, l1, merge(r1, h2)) // FIXME forgot to use makeN
+          Node(v1, l1, merge(r1, h2)) // FIXME should use makeN
         else
-          makeN(v2, l2, merge(h1, r2)) // The same
+          Node(v2, l2, merge(h1, r2)) // FIXME here also
     }
   } ensuring { res => 
     hasLeftistProperty(res) && hasHeapProperty(res) &&
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -79,9 +79,10 @@ object Heaps {
       Node(value, left, right)
     else
       Node(value, right, left)
-  } ensuring { hasLeftistProperty(_) }
+  } ensuring { res =>
+    hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -92,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap3.scala b/testcases/repair/Heap/Heap3.scala
index 71445ba97..b24024ea7 100644
--- a/testcases/repair/Heap/Heap3.scala
+++ b/testcases/repair/Heap/Heap3.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap4.scala b/testcases/repair/Heap/Heap4.scala
index 51cdb228b..d277fde61 100644
--- a/testcases/repair/Heap/Heap4.scala
+++ b/testcases/repair/Heap/Heap4.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -58,7 +58,7 @@ object Heaps {
     )
     (h1,h2) match {
       case (Leaf(), _) => h2
-      case (_, Leaf()) => h2 // FIXME h2 instead of h1
+      case (_, Leaf()) => h2 // FIXME should be h1
       case (Node(v1, l1, r1), Node(v2, l2, r2)) =>
         if(v1 >= v2)
           makeN(v1, l1, merge(r1, h2))
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap5.scala b/testcases/repair/Heap/Heap5.scala
index bc1f16780..fcddb9e08 100644
--- a/testcases/repair/Heap/Heap5.scala
+++ b/testcases/repair/Heap/Heap5.scala
@@ -8,22 +8,22 @@ import leon.lang._
 import leon.collection._
 
 object Heaps {
-   
+ 
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap6.scala b/testcases/repair/Heap/Heap6.scala
index 2fe845f16..aa9eb7230 100644
--- a/testcases/repair/Heap/Heap6.scala
+++ b/testcases/repair/Heap/Heap6.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,14 +46,14 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
 
   private def merge(h1: Heap, h2: Heap) : Heap = {
     require(
-      hasLeftistProperty(h1) && hasLeftistProperty(h2) &&
+      hasLeftistProperty(h1) && hasLeftistProperty(h2) && 
       hasHeapProperty(h1) && hasHeapProperty(h2)
     )
     (h1,h2) match {
@@ -63,15 +63,15 @@ object Heaps {
         if(v1 >= v2)
           makeN(v1, l1, merge(r1, h2))
         else
-          makeN(v2, l1, merge(h1, r2)) // Fixme: l1 instead of l2
+          makeN(v2, l1, merge(h1, r2)) // FIXME: l1 instead of l2
     }
-  } ensuring { res =>
+  } ensuring { res => 
     hasLeftistProperty(res) && hasHeapProperty(res) &&
     heapSize(h1) + heapSize(h2) == heapSize(res) &&
-    h1.content ++ h2.content == res.content
+    h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap7.scala b/testcases/repair/Heap/Heap7.scala
index 3fdc90608..91baf66c4 100644
--- a/testcases/repair/Heap/Heap7.scala
+++ b/testcases/repair/Heap/Heap7.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -60,7 +60,7 @@ object Heaps {
       case (Leaf(), _) => h2
       case (_, Leaf()) => h1
       case (Node(v1, l1, r1), Node(v2, l2, r2)) =>
-        if(v1 + v2 > 0) // FIXME: Nonsense, should be v1 >= v2
+        if(v1 + v2 > 0) // FIXME Totally wrong
           makeN(v1, l1, merge(r1, h2))
         else
           makeN(v2, l2, merge(h1, r2))
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,7 +82,7 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap8.scala b/testcases/repair/Heap/Heap8.scala
index 4816b219f..0d21fc368 100644
--- a/testcases/repair/Heap/Heap8.scala
+++ b/testcases/repair/Heap/Heap8.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -71,7 +71,7 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
@@ -82,10 +82,10 @@ object Heaps {
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
-    merge(Node(element + 1, Leaf(), Leaf()), heap) // FIXME lol.
+    merge(Node(element + 1, Leaf(), Leaf()), heap) // FIXME: unneeded +1
 
   } ensuring { res =>
     hasLeftistProperty(res) && hasHeapProperty(res) &&
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/Heap/Heap9.scala b/testcases/repair/Heap/Heap9.scala
index 649f67a3f..0a9197a34 100644
--- a/testcases/repair/Heap/Heap9.scala
+++ b/testcases/repair/Heap/Heap9.scala
@@ -10,20 +10,20 @@ import leon.collection._
 object Heaps {
  
   sealed abstract class Heap {
-    val rank : Int = this match {
+    val rank : BigInt = this match {
       case Leaf() => 0
       case Node(_, l, r) => 
         1 + max(l.rank, r.rank)
     }
-    def content : Set[Int] = this match {
-      case Leaf() => Set[Int]()
+    def content : Set[BigInt] = this match {
+      case Leaf() => Set[BigInt]()
       case Node(v,l,r) => l.content ++ Set(v) ++ r.content
     }
   }
   case class Leaf() extends Heap
-  case class Node(value:Int, left: Heap, right: Heap) extends Heap
+  case class Node(value:BigInt, left: Heap, right: Heap) extends Heap
 
-  def max(i1 : Int, i2 : Int) = if (i1 >= i2) i1 else i2
+  def max(i1 : BigInt, i2 : BigInt) = if (i1 >= i2) i1 else i2
 
   def hasHeapProperty(h : Heap) : Boolean = h match {
     case Leaf() => true
@@ -46,7 +46,7 @@ object Heaps {
       l.rank >= r.rank 
   }
 
-  def heapSize(t: Heap): Int = { t match {
+  def heapSize(t: Heap): BigInt = { t match {
     case Leaf() => 0
     case Node(v, l, r) => heapSize(l) + 1 + heapSize(r)
   }} ensuring(_ >= 0)
@@ -71,18 +71,18 @@ object Heaps {
     h1.content ++ h2.content == res.content 
   }
 
-  private def makeN(value: Int, left: Heap, right: Heap) : Heap = {
+  private def makeN(value: BigInt, left: Heap, right: Heap) : Heap = {
     require(
       hasLeftistProperty(left) && hasLeftistProperty(right)
     )
-    if(left.rank >= right.rank + 42) // FIXME delete +42
+    if(left.rank >= right.rank + 42) // FIXME unneeded constant
       Node(value, left, right)
     else
       Node(value, right, left)
   } ensuring { res =>
     hasLeftistProperty(res)  }
 
-  def insert(element: Int, heap: Heap) : Heap = {
+  def insert(element: BigInt, heap: Heap) : Heap = {
     require(hasLeftistProperty(heap) && hasHeapProperty(heap))
 
     merge(Node(element, Leaf(), Leaf()), heap)
@@ -93,7 +93,7 @@ object Heaps {
     res.content == heap.content ++ Set(element)
   }
 
-  def findMax(h: Heap) : Option[Int] = {
+  def findMax(h: Heap) : Option[BigInt] = {
     h match {
       case Node(m,_,_) => Some(m)
       case Leaf() => None()
diff --git a/testcases/repair/List/List.scala b/testcases/repair/List/List.scala
index caa4aa0d3..3f1e65814 100644
--- a/testcases/repair/List/List.scala
+++ b/testcases/repair/List/List.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,96 +191,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -290,127 +290,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List1.scala b/testcases/repair/List/List1.scala
index 9f600f728..ffa4f480e 100644
--- a/testcases/repair/List/List1.scala
+++ b/testcases/repair/List/List1.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s-1, e)) // FIXME should be s
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s-1, e)) // FIXME should be s
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,96 +191,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -290,127 +290,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List10.scala b/testcases/repair/List/List10.scala
index 1c4b0016a..edef652eb 100644
--- a/testcases/repair/List/List10.scala
+++ b/testcases/repair/List/List10.scala
@@ -7,46 +7,46 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 3 + t.size // FIXME 1+t.size
-  }) ensuring {(this, _) passes {
-    case Cons0(_, Nil0()) => 1
-    case Nil0() => 0
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 3 + t.size //FIXME
+  }) ensuring { (this, _) passes {
+    case Cons(_, Nil()) => 1
+    case Nil() => 0
   }}
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -55,135 +55,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -194,96 +194,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -293,127 +293,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List11.scala b/testcases/repair/List/List11.scala
index 7fe816b46..12eb4c6a1 100644
--- a/testcases/repair/List/List11.scala
+++ b/testcases/repair/List/List11.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,96 +191,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -290,135 +290,136 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 
-  def sum(l : List0[Int]) : Int = { l match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + sum(t) // FIXME h + sum(t)
-  }} ensuring { (l, _) passes { 
-    case Cons0(a, Nil0()) => a
-    case Cons0(a, Cons0(b, Nil0())) => a + b
+  def sum(l: List[BigInt]): BigInt = { l match {
+    case Nil() => 0
+    case Cons(x, xs) => 1 + sum(xs) // FIXME 
+  }} ensuring { (l, _) passes {
+    case Cons(a, Nil()) => a
+    case Cons(a, Cons(b, Nil())) => a + b
   }}
+
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List12.scala b/testcases/repair/List/List12.scala
index 19f2d779e..1774d1efd 100644
--- a/testcases/repair/List/List12.scala
+++ b/testcases/repair/List/List12.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,139 +52,136 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = {
-    this match {
-      case Cons0(h, t) =>
-        if (e == h) {
-          t // FIXME
-        } else {
-          Cons0(h, t - e)
-        }
-      case Nil0() =>
-        Nil0()
-    }
-  } ensuring {
-    res => res.content == this.content -- Set(e)
-  }
+  def -(e: T): List[T] = { this match {
+    case Cons(h, t) =>
+      if (e == h) {
+        t // FIXME missing rec. call
+      } else {
+        Cons(h, t - e)
+      }
+    case Nil() =>
+      Nil()
+  }} ensuring { _.content == this.content -- Set(e) }
+    
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -195,96 +192,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -294,127 +291,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List13.scala b/testcases/repair/List/List13.scala
index b585f3ef1..96dc9abcc 100644
--- a/testcases/repair/List/List13.scala
+++ b/testcases/repair/List/List13.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,138 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = { (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), 0) =>
-      t // FIXME should be this
-    case (Cons0(_, t), i) =>
-      t.drop(i) //FIXME should be i-1
-  }} ensuring { res => ((this, i), res) passes { 
-    case (Cons0(_, Nil0()), 42) => Nil0()
-    case (l@Cons0(_, _), 0) => l
-    case (Cons0(a, Cons0(b, Nil0())), 1) => Cons0(b, Nil0())
-    case (Cons0(a, Cons0(b, Cons0(c, Nil0()))), 2) => Cons0(c, Nil0())
-  }}
-
-  def slice(from: Int, to: Int): List0[T] = {
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
+      if (i == 0) {
+        Cons(h, t)
+      } else {
+        t.drop(i) // FIXME Should be -1
+      }
+  }
+
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -194,96 +191,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -293,127 +290,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List2.scala b/testcases/repair/List/List2.scala
index f83d1d222..e5c850130 100644
--- a/testcases/repair/List/List2.scala
+++ b/testcases/repair/List/List2.scala
@@ -7,49 +7,46 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => xs ++ that // FIXME did not Cons 
-  }) ensuring { res =>
-    res.content == this.content ++ that.content && 
-    res.size == this.size + that.size/* &&
-    (((this, that), res) passes {
-      case ( x@Cons0(x1, Cons0(x2, Nil0())), y) => x
-    })*/
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => xs ++ that // FIXME forgot x
+  }) ensuring { res => 
+    (res.content == this.content ++ that.content) &&
+    (res.size == this.size + that.size)
   }
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -58,135 +55,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -197,96 +194,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -296,127 +293,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List3.scala b/testcases/repair/List/List3.scala
index 1ad7ef0fd..8fc99b7d2 100644
--- a/testcases/repair/List/List3.scala
+++ b/testcases/repair/List/List3.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,138 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def ap(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Nil0() // FIXME did not add element
-      case Cons0(x, xs) => Cons0(x, xs ap (t))
+      case Nil() => this // FIXME forgot t
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-
-  def :+(t:T) = this ap t
-
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -194,101 +191,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    //case Cons0(h, t) =>
-    //  Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => 
-    ((r.size < this.size) || (this.size == 0)) &&
-    ((this, r) passes {
-      case Cons0(a, Cons0(b, Cons0(c, Nil0()))) => Cons0(a, Cons0(b, Nil0()))
-    })
-  )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -298,127 +290,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List4.scala b/testcases/repair/List/List4.scala
index 0b641cd80..d48256fe0 100644
--- a/testcases/repair/List/List4.scala
+++ b/testcases/repair/List/List4.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,140 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = { (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
-      t.drop(i-1) //FIXME missing if-split
-  }} ensuring { res => ((this, i), res) passes { 
-    case (Cons0(_, Nil0()), 42) => Nil0()
-    case (l@Cons0(_, _), 0) => l
-    case (Cons0(a, Cons0(b, Nil0())), 1) => Cons0(b, Nil0())
+  def drop(i: BigInt): List[T] = { (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
+      // FIXME
+      //if (i == 0) {
+      //  Cons(h, t)
+      //} else {
+        t.drop(i-1)
+      //}
+  }} ensuring { ((this, i), _) passes { 
+    case (Cons(_, Nil()), BigInt(42)) => Nil()
+    case (l@Cons(_, _), BigInt(0)) => l
+    case (Cons(a, Cons(b, Nil())), BigInt(1)) => Cons(b, Nil())
   }}
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,96 +196,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -290,127 +295,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List5.scala b/testcases/repair/List/List5.scala
index 34ae1877d..471bff800 100644
--- a/testcases/repair/List/List5.scala
+++ b/testcases/repair/List/List5.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,138 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = { this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = { this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
-      Cons0(h, r) // FIXME
+      //if (h == from) { FIXME
+      //  Cons(to, r)
+      //} else {
+        Cons(h, r)
+      //}
   }} ensuring { res => 
-    (((this.content -- Set(from)) ++ 
-     (if (this.content contains from) Set(to) else Set[T]())) == res.content) &&
-    res.size == this.size 
+    (((this.content -- Set(from)) ++ (if (this.content contains from) Set(to) else Set[T]())) == res.content) &&
+    res.size == this.size
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,96 +194,96 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -290,127 +293,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List6.scala b/testcases/repair/List/List6.scala
index 2e1297cb4..f7881ff1e 100644
--- a/testcases/repair/List/List6.scala
+++ b/testcases/repair/List/List6.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,135 +52,135 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
@@ -191,99 +191,100 @@ sealed abstract class List0[T] {
       }
   }
 
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = { this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = { this match {
+    case Cons(h, t) =>
       if (h == e) {
-        t.count(e) // FIXME +1
+        t.count(e) // FIXME missing +1
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }} ensuring {((this, e), _) passes {
-    case (Cons0(a, Cons0(b, Cons0(a1, Cons0(b2, Nil0())))), a2) if a == a1 && a == a2 && b != a2 && b2 != a2 => 2
-    case (Cons0(a, Cons0(b, Nil0())), c) if a != c && b != c => 0
-  }}
+     case (Cons(a, Cons(b, Cons(a1, Cons(b2, Nil())))), a2) if a == a1 && a == a2 && b != a2 && b2 != a2 => 2
+     case (Cons(a, Cons(b, Nil())), c) if a != c && b != c => 0
+   }}
 
-  def evenSplit: (List0[T], List0[T]) = {
+
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -293,127 +294,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List7.scala b/testcases/repair/List/List7.scala
index 069dd35d2..a67f7e5c4 100644
--- a/testcases/repair/List/List7.scala
+++ b/testcases/repair/List/List7.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,141 +52,141 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = { this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = { this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
         t.find(e) match {
           case None()  => None()
-          case Some(i) => Some(i) // FIXME should be i+1
+          case Some(i) => Some(i) // FIXME forgot +1
         }
       }
   }} ensuring { res =>
@@ -197,97 +197,96 @@ sealed abstract class List0[T] {
     }
   }
 
-
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -297,127 +296,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List8.scala b/testcases/repair/List/List8.scala
index bf99c2e75..0204d4f52 100644
--- a/testcases/repair/List/List8.scala
+++ b/testcases/repair/List/List8.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,141 +52,141 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = { this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
+  def find(e: T): Option[BigInt] = { this match {
+    case Nil() => None()
+    case Cons(h, t) =>
       if (h == e) {
         Some(0)
       } else {
         t.find(e) match {
           case None()  => None()
-          case Some(i) => Some(i+2) // FIXME should be i+1
+          case Some(i) => Some(i+2) // FIXME +1
         }
       }
   }} ensuring { res =>
@@ -197,97 +197,96 @@ sealed abstract class List0[T] {
     }
   }
 
-
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -297,127 +296,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/List/List9.scala b/testcases/repair/List/List9.scala
index 59d05b6c5..176cb595f 100644
--- a/testcases/repair/List/List9.scala
+++ b/testcases/repair/List/List9.scala
@@ -7,43 +7,43 @@ import leon.lang._
 import leon.collection._
 import leon.annotation._
 
-sealed abstract class List0[T] {
-  def size: Int = (this match {
-    case Nil0() => 0
-    case Cons0(h, t) => 1 + t.size
+sealed abstract class List[T] {
+  def size: BigInt = (this match {
+    case Nil() => 0
+    case Cons(h, t) => 1 + t.size
   }) ensuring (_ >= 0)
 
   def content: Set[T] = this match {
-    case Nil0() => Set()
-    case Cons0(h, t) => Set(h) ++ t.content
+    case Nil() => Set()
+    case Cons(h, t) => Set(h) ++ t.content
   }
 
   def contains(v: T): Boolean = (this match {
-    case Cons0(h, t) if h == v => true
-    case Cons0(_, t) => t.contains(v)
-    case Nil0() => false
+    case Cons(h, t) if h == v => true
+    case Cons(_, t) => t.contains(v)
+    case Nil() => false
   }) ensuring { res => res == (content contains v) }
 
-  def ++(that: List0[T]): List0[T] = (this match {
-    case Nil0() => that
-    case Cons0(x, xs) => Cons0(x, xs ++ that)
+  def ++(that: List[T]): List[T] = (this match {
+    case Nil() => that
+    case Cons(x, xs) => Cons(x, xs ++ that)
   }) ensuring { res => (res.content == this.content ++ that.content) && (res.size == this.size + that.size)}
 
   def head: T = {
-    require(this != Nil0[T]())
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => h
+      case Cons(h, t) => h
     }
   }
 
-  def tail: List0[T] = {
-    require(this != Nil0[T]())
+  def tail: List[T] = {
+    require(this != Nil[T]())
     this match {
-      case Cons0(h, t) => t
+      case Cons(h, t) => t
     }
   }
 
-  def apply(index: Int): T = {
+  def apply(index: BigInt): T = {
     require(0 <= index && index < size)
     if (index == 0) {
       head
@@ -52,141 +52,141 @@ sealed abstract class List0[T] {
     }
   }
 
-  def ::(t:T): List0[T] = Cons0(t, this)
+  def ::(t:T): List[T] = Cons(t, this)
 
-  def :+(t:T): List0[T] = {
+  def :+(t:T): List[T] = {
     this match {
-      case Nil0() => Cons0(t, this)
-      case Cons0(x, xs) => Cons0(x, xs :+ (t))
+      case Nil() => Cons(t, this)
+      case Cons(x, xs) => Cons(x, xs :+ (t))
     }
   } ensuring(res => (res.size == size + 1) && (res.content == content ++ Set(t)))
 
-  def reverse: List0[T] = {
+  def reverse: List[T] = {
     this match {
-      case Nil0() => this
-      case Cons0(x,xs) => xs.reverse :+ x
+      case Nil() => this
+      case Cons(x,xs) => xs.reverse :+ x
     }
   } ensuring (res => (res.size == size) && (res.content == content))
 
-  def take(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def take(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Nil0()
+        Nil()
       } else {
-        Cons0(h, t.take(i-1))
+        Cons(h, t.take(i-1))
       }
   }
 
-  def drop(i: Int): List0[T] = (this, i) match {
-    case (Nil0(), _) => Nil0()
-    case (Cons0(h, t), i) =>
+  def drop(i: BigInt): List[T] = (this, i) match {
+    case (Nil(), _) => Nil()
+    case (Cons(h, t), i) =>
       if (i == 0) {
-        Cons0(h, t)
+        Cons(h, t)
       } else {
         t.drop(i-1)
       }
   }
 
-  def slice(from: Int, to: Int): List0[T] = {
+  def slice(from: BigInt, to: BigInt): List[T] = {
     require(from < to && to < size && from >= 0)
     drop(from).take(to-from)
   }
 
-  def replace(from: T, to: T): List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
+  def replace(from: T, to: T): List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
       val r = t.replace(from, to)
       if (h == from) {
-        Cons0(to, r)
+        Cons(to, r)
       } else {
-        Cons0(h, r)
+        Cons(h, r)
       }
   }
 
-  private def chunk0(s: Int, l: List0[T], acc: List0[T], res: List0[List0[T]], s0: Int): List0[List0[T]] = l match {
-    case Nil0() =>
+  private def chunk0(s: BigInt, l: List[T], acc: List[T], res: List[List[T]], s0: BigInt): List[List[T]] = l match {
+    case Nil() =>
       if (acc.size > 0) {
         res :+ acc
       } else {
         res
       }
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       if (s0 == 0) {
-        chunk0(s, l, Nil0(), res :+ acc, s)
+        chunk0(s, l, Nil(), res :+ acc, s)
       } else {
         chunk0(s, t, acc :+ h, res, s0-1)
       }
   }
 
-  def chunks(s: Int): List0[List0[T]] = {
+  def chunks(s: BigInt): List[List[T]] = {
     require(s > 0)
 
-    chunk0(s, this, Nil0(), Nil0(), s)
+    chunk0(s, this, Nil(), Nil(), s)
   }
 
-  def zip[B](that: List0[B]): List0[(T, B)] = (this, that) match {
-    case (Cons0(h1, t1), Cons0(h2, t2)) =>
-      Cons0((h1, h2), t1.zip(t2))
+  def zip[B](that: List[B]): List[(T, B)] = (this, that) match {
+    case (Cons(h1, t1), Cons(h2, t2)) =>
+      Cons((h1, h2), t1.zip(t2))
     case (_) =>
-      Nil0()
+      Nil()
   }
 
-  def -(e: T): List0[T] = this match {
-    case Cons0(h, t) =>
+  def -(e: T): List[T] = this match {
+    case Cons(h, t) =>
       if (e == h) {
         t - e
       } else {
-        Cons0(h, t - e)
+        Cons(h, t - e)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def --(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def --(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
         t -- that
       } else {
-        Cons0(h, t -- that)
+        Cons(h, t -- that)
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def &(that: List0[T]): List0[T] = this match {
-    case Cons0(h, t) =>
+  def &(that: List[T]): List[T] = this match {
+    case Cons(h, t) =>
       if (that.contains(h)) {
-        Cons0(h, t & that)
+        Cons(h, t & that)
       } else {
         t & that
       }
-    case Nil0() =>
-      Nil0()
+    case Nil() =>
+      Nil()
   }
 
-  def pad(s: Int, e: T): List0[T] = { (this, s) match {
+  def pad(s: BigInt, e: T): List[T] = { (this, s) match {
     case (_, s) if s <= 0 =>
       this
-    case (Nil0(), s) =>
-      Cons0(e, Nil0().pad(s-1, e))
-    case (Cons0(h, t), s) =>
-      Cons0(h, t.pad(s, e))
+    case (Nil(), s) =>
+      Cons(e, Nil().pad(s-1, e))
+    case (Cons(h, t), s) =>
+      Cons(h, t.pad(s, e))
   }} ensuring { res =>
     ((this,s,e), res) passes {
-      case (Cons0(a,Nil0()), 2, x) => Cons0(a, Cons0(x, Cons0(x, Nil0())))
+      case (Cons(a,Nil()), BigInt(2), x) => Cons(a, Cons(x, Cons(x, Nil())))
     }
   }
 
-  def find(e: T): Option[Int] = { this match {
-    case Nil0() => None()
-    case Cons0(h, t) =>
-      if (h != e) { // FIXME should be ==
+  def find(e: T): Option[BigInt] = { this match {
+    case Nil() => None()
+    case Cons(h, t) =>
+      if (h != e) { // FIXME
         Some(0)
       } else {
         t.find(e) match {
           case None()  => None()
-          case Some(i) => Some(i+1)
+          case Some(i) => Some(i + 1)
         }
       }
   }} ensuring { res =>
@@ -197,97 +197,96 @@ sealed abstract class List0[T] {
     }
   }
 
-
-  def init: List0[T] = (this match {
-    case Cons0(h, Nil0()) =>
-      Nil0[T]()
-    case Cons0(h, t) =>
-      Cons0[T](h, t.init)
-    case Nil0() =>
-      Nil0[T]()
-  }) ensuring ( (r: List0[T]) => ((r.size < this.size) || (this.size == 0)) )
+  def init: List[T] = (this match {
+    case Cons(h, Nil()) =>
+      Nil[T]()
+    case Cons(h, t) =>
+      Cons[T](h, t.init)
+    case Nil() =>
+      Nil[T]()
+  }) ensuring ( (r: List[T]) => ((r.size < this.size) || (this.size == 0)) )
 
   def lastOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       t.lastOption.orElse(Some(h))
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
   def firstOption: Option[T] = this match {
-    case Cons0(h, t) =>
+    case Cons(h, t) =>
       Some(h)
-    case Nil0() =>
+    case Nil() =>
       None()
   }
 
-  def unique: List0[T] = this match {
-    case Nil0() => Nil0()
-    case Cons0(h, t) =>
-      Cons0(h, t.unique - h)
+  def unique: List[T] = this match {
+    case Nil() => Nil()
+    case Cons(h, t) =>
+      Cons(h, t.unique - h)
   }
 
-  def splitAt(e: T): List0[List0[T]] =  split(Cons0(e, Nil0()))
+  def splitAt(e: T): List[List[T]] =  split(Cons(e, Nil()))
 
-  def split(seps: List0[T]): List0[List0[T]] = this match {
-    case Cons0(h, t) =>
+  def split(seps: List[T]): List[List[T]] = this match {
+    case Cons(h, t) =>
       if (seps.contains(h)) {
-        Cons0(Nil0(), t.split(seps))
+        Cons(Nil(), t.split(seps))
       } else {
         val r = t.split(seps)
-        Cons0(Cons0(h, r.head), r.tail)
+        Cons(Cons(h, r.head), r.tail)
       }
-    case Nil0() =>
-      Cons0(Nil0(), Nil0())
+    case Nil() =>
+      Cons(Nil(), Nil())
   }
 
-  def count(e: T): Int = this match {
-    case Cons0(h, t) =>
+  def count(e: T): BigInt = this match {
+    case Cons(h, t) =>
       if (h == e) {
         1 + t.count(e)
       } else {
         t.count(e)
       }
-    case Nil0() =>
+    case Nil() =>
       0
   }
 
-  def evenSplit: (List0[T], List0[T]) = {
+  def evenSplit: (List[T], List[T]) = {
     val c = size/2
     (take(c), drop(c))
   }
 
-  def insertAt(pos: Int, l: List0[T]): List0[T] = {
+  def insertAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       insertAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.insertAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.insertAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def replaceAt(pos: Int, l: List0[T]): List0[T] = {
+  def replaceAt(pos: BigInt, l: List[T]): List[T] = {
     if(pos < 0) {
       replaceAt(size + pos, l)
     } else if(pos == 0) {
       l ++ this.drop(l.size)
     } else {
       this match {
-        case Cons0(h, t) =>
-          Cons0(h, t.replaceAt(pos-1, l))
-        case Nil0() =>
+        case Cons(h, t) =>
+          Cons(h, t.replaceAt(pos-1, l))
+        case Nil() =>
           l
       }
     }
   }
 
-  def rotate(s: Int): List0[T] = {
+  def rotate(s: BigInt): List[T] = {
     if (s < 0) {
       rotate(size+s)
     } else {
@@ -297,127 +296,127 @@ sealed abstract class List0[T] {
   }
 
   def isEmpty = this match { 
-    case Nil0() => true
+    case Nil() => true
     case _ => false 
   }
 
 }
 
 @ignore
-object List0 {
-  def apply[T](elems: T*): List0[T] = ???
+object List {
+  def apply[T](elems: T*): List[T] = ???
 }
 
 @library
-object List0Ops {
-  def flatten[T](ls: List0[List0[T]]): List0[T] = ls match {
-    case Cons0(h, t) => h ++ flatten(t)
-    case Nil0() => Nil0()
+object ListOps {
+  def flatten[T](ls: List[List[T]]): List[T] = ls match {
+    case Cons(h, t) => h ++ flatten(t)
+    case Nil() => Nil()
   }
 
-  def isSorted(ls: List0[Int]): Boolean = ls match {
-    case Nil0() => true
-    case Cons0(_, Nil0()) => true
-    case Cons0(h1, Cons0(h2, _)) if(h1 > h2) => false
-    case Cons0(_, t) => isSorted(t)
+  def isSorted(ls: List[BigInt]): Boolean = ls match {
+    case Nil() => true
+    case Cons(_, Nil()) => true
+    case Cons(h1, Cons(h2, _)) if(h1 > h2) => false
+    case Cons(_, t) => isSorted(t)
   }
 
-  def sorted(ls: List0[Int]): List0[Int] = ls match {
-    case Cons0(h, t) => insSort(sorted(t), h)
-    case Nil0() => Nil0()
+  def sorted(ls: List[BigInt]): List[BigInt] = ls match {
+    case Cons(h, t) => insSort(sorted(t), h)
+    case Nil() => Nil()
   }
 
-  def insSort(ls: List0[Int], v: Int): List0[Int] = ls match {
-    case Nil0() => Cons0(v, Nil0())
-    case Cons0(h, t) =>
+  def insSort(ls: List[BigInt], v: BigInt): List[BigInt] = ls match {
+    case Nil() => Cons(v, Nil())
+    case Cons(h, t) =>
       if (v <= h) {
-        Cons0(v, t)
+        Cons(v, t)
       } else {
-        Cons0(h, insSort(t, v))
+        Cons(h, insSort(t, v))
       }
   }
 }
 
 
-case class Cons0[T](h: T, t: List0[T]) extends List0[T]
-case class Nil0[T]() extends List0[T]
+case class Cons[T](h: T, t: List[T]) extends List[T]
+case class Nil[T]() extends List[T]
 
 @library
-object List0Specs {
-  def snocIndex[T](l : List0[T], t : T, i : Int) : Boolean = {
+object ListSpecs {
+  def snocIndex[T](l : List[T], t : T, i : BigInt) : Boolean = {
     require(0 <= i && i < l.size + 1)
     // proof:
     (l match {
-      case Nil0() => true
-      case Cons0(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
+      case Nil() => true
+      case Cons(x, xs) => if (i > 0) snocIndex[T](xs, t, i-1) else true
     }) &&
     // claim:
     ((l :+ t).apply(i) == (if (i < l.size) l(i) else t))
   }.holds
 
-  def reverseIndex[T](l : List0[T], i : Int) : Boolean = {
+  def reverseIndex[T](l : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l.size)
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
+      case Nil() => true
+      case Cons(x,xs) => snocIndex(l, x, i) && reverseIndex[T](l,i)
     }) &&
     (l.reverse.apply(i) == l.apply(l.size - 1 - i))
   }.holds
 
-  def appendIndex[T](l1 : List0[T], l2 : List0[T], i : Int) : Boolean = {
+  def appendIndex[T](l1 : List[T], l2 : List[T], i : BigInt) : Boolean = {
     require(0 <= i && i < l1.size + l2.size)
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
+      case Nil() => true
+      case Cons(x,xs) => if (i==0) true else appendIndex[T](xs,l2,i-1)
     }) &&
     ((l1 ++ l2).apply(i) == (if (i < l1.size) l1(i) else l2(i - l1.size)))
   }.holds
 
-  def appendAssoc[T](l1 : List0[T], l2 : List0[T], l3 : List0[T]) : Boolean = {
+  def appendAssoc[T](l1 : List[T], l2 : List[T], l3 : List[T]) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) => appendAssoc(xs,l2,l3)
+      case Nil() => true
+      case Cons(x,xs) => appendAssoc(xs,l2,l3)
     }) &&
     (((l1 ++ l2) ++ l3) == (l1 ++ (l2 ++ l3)))
   }.holds
 
-  def snocIsAppend[T](l : List0[T], t : T) : Boolean = {
+  def snocIsAppend[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocIsAppend(xs,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocIsAppend(xs,t)
     }) &&
-    ((l :+ t) == l ++ Cons0[T](t, Nil0()))
+    ((l :+ t) == l ++ Cons[T](t, Nil()))
   }.holds
 
-  def snocAfterAppend[T](l1 : List0[T], l2 : List0[T], t : T) : Boolean = {
+  def snocAfterAppend[T](l1 : List[T], l2 : List[T], t : T) : Boolean = {
     (l1 match {
-      case Nil0() => true
-      case Cons0(x,xs) =>  snocAfterAppend(xs,l2,t)
+      case Nil() => true
+      case Cons(x,xs) =>  snocAfterAppend(xs,l2,t)
     }) &&
     ((l1 ++ l2) :+ t == (l1 ++ (l2 :+ t)))
   }.holds
 
-  def snocReverse[T](l : List0[T], t : T) : Boolean = {
+  def snocReverse[T](l : List[T], t : T) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => snocReverse(xs,t)
+      case Nil() => true
+      case Cons(x,xs) => snocReverse(xs,t)
     }) &&
-    ((l :+ t).reverse == Cons0(t, l.reverse))
+    ((l :+ t).reverse == Cons(t, l.reverse))
   }.holds
 
-  def reverseReverse[T](l : List0[T]) : Boolean = {
+  def reverseReverse[T](l : List[T]) : Boolean = {
     (l match {
-      case Nil0() => true
-      case Cons0(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
+      case Nil() => true
+      case Cons(x,xs) => reverseReverse[T](xs) && snocReverse[T](xs.reverse, x)
     }) &&
     (l.reverse.reverse == l)
   }.holds
 
   //// my hand calculation shows this should work, but it does not seem to be found
-  //def reverseAppend[T](l1 : List0[T], l2 : List0[T]) : Boolean = {
+  //def reverseAppend[T](l1 : List[T], l2 : List[T]) : Boolean = {
   //  (l1 match {
-  //    case Nil0() => true
-  //    case Cons0(x,xs) => {
+  //    case Nil() => true
+  //    case Cons(x,xs) => {
   //      reverseAppend(xs,l2) &&
   //      snocAfterAppend[T](l2.reverse, xs.reverse, x) &&
   //      l1.reverse == (xs.reverse :+ x)
diff --git a/testcases/repair/MergeSort/MergeSort.scala b/testcases/repair/MergeSort/MergeSort.scala
index d4a0f89e9..aac638b9a 100644
--- a/testcases/repair/MergeSort/MergeSort.scala
+++ b/testcases/repair/MergeSort/MergeSort.scala
@@ -2,7 +2,7 @@ import leon.collection._
 
 object MergeSort {
 
-  def split(l : List[Int]) : (List[Int],List[Int]) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
       (Cons(a, rec1), Cons(b, rec2))
@@ -15,12 +15,12 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List[Int]) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List[Int], l2 : List[Int]) : List[Int] = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
       case (Cons(h1, t1), Cons(h2,t2)) => 
@@ -37,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List[Int]) : List[Int] = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/MergeSort1.scala b/testcases/repair/MergeSort/MergeSort1.scala
index 901d4c6a2..bef7f2391 100644
--- a/testcases/repair/MergeSort/MergeSort1.scala
+++ b/testcases/repair/MergeSort/MergeSort1.scala
@@ -1,25 +1,11 @@
-import leon.lang._
+import leon.collection._
 
 object MergeSort {
 
-  abstract class List {
-    def size : Int = this match {
-      case Nil() => 0
-      case Cons(_, tl) => 1 + tl.size
-    }
-    def content : Set[Int] = this match {
-      case Nil() => Set.empty[Int]
-      case Cons(hd, tl) => tl.content ++ Set(hd)
-    }
-  }
-
-  case class Nil() extends List
-  case class Cons(hd : Int, tl : List) extends List
-
-  def split(l : List) : (List,List) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
-      (rec1, rec2) //FIXME forgot a and b
+      (rec1, rec2) // FIXME: Forgot a,b
     case other => (other, Nil())
   }} ensuring { res =>
     val (l1, l2) = res
@@ -29,12 +15,12 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List, l2 : List) : List = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
       case (Cons(h1, t1), Cons(h2,t2)) => 
@@ -51,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List) : List = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/MergeSort2.scala b/testcases/repair/MergeSort/MergeSort2.scala
index d9966ecdc..11c3a1cdb 100644
--- a/testcases/repair/MergeSort/MergeSort2.scala
+++ b/testcases/repair/MergeSort/MergeSort2.scala
@@ -2,7 +2,7 @@ import leon.collection._
 
 object MergeSort {
 
-  def split(l : List[Int]) : (List[Int],List[Int]) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
       (Cons(a, rec1), Cons(b, rec2))
@@ -15,19 +15,19 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List[Int]) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List[Int], l2 : List[Int]) : List[Int] = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
       case (Cons(h1, t1), Cons(h2,t2)) => 
         if (h1 <= h2) 
           Cons(h1, merge(t1, l2))
         else 
-          Cons(h1, merge(l1, t2)) // FIXME h1 instead of h2
+          Cons(h1, merge(l1, t2)) // FIXME: h1 -> h2
       case (Nil(), _) => l2
       case (_, Nil()) => l1
     }
@@ -37,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List[Int]) : List[Int] = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/MergeSort3.scala b/testcases/repair/MergeSort/MergeSort3.scala
index 7da332e56..3d9c8192a 100644
--- a/testcases/repair/MergeSort/MergeSort3.scala
+++ b/testcases/repair/MergeSort/MergeSort3.scala
@@ -2,7 +2,7 @@ import leon.collection._
 
 object MergeSort {
 
-  def split(l : List[Int]) : (List[Int],List[Int]) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
       (Cons(a, rec1), Cons(b, rec2))
@@ -15,16 +15,16 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List[Int]) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List[Int], l2 : List[Int]) : List[Int] = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
       case (Cons(h1, t1), Cons(h2,t2)) => 
-        if (h1 >= h2) // FIXME: should be <=
+        if (h1 >= h2) // FIXME Condition inverted
           Cons(h1, merge(t1, l2))
         else 
           Cons(h2, merge(l1, t2))
@@ -37,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List[Int]) : List[Int] = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/MergeSort4.scala b/testcases/repair/MergeSort/MergeSort4.scala
index 93872082d..4422402b1 100644
--- a/testcases/repair/MergeSort/MergeSort4.scala
+++ b/testcases/repair/MergeSort/MergeSort4.scala
@@ -2,7 +2,7 @@ import leon.collection._
 
 object MergeSort {
 
-  def split(l : List[Int]) : (List[Int],List[Int]) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
       (Cons(a, rec1), Cons(b, rec2))
@@ -15,19 +15,19 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List[Int]) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List[Int], l2 : List[Int]) : List[Int] = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
       case (Cons(h1, t1), Cons(h2,t2)) => 
         if (h1 <= h2) 
           Cons(h1, merge(t1, l2))
         else 
-          merge(l1, t2) // FIXME missing Cons(h2
+          merge(l1, t2) // FIXME: missing h2
       case (Nil(), _) => l2
       case (_, Nil()) => l1
     }
@@ -37,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List[Int]) : List[Int] = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/MergeSort5.scala b/testcases/repair/MergeSort/MergeSort5.scala
index a04a0f491..1bf9d50ce 100644
--- a/testcases/repair/MergeSort/MergeSort5.scala
+++ b/testcases/repair/MergeSort/MergeSort5.scala
@@ -2,7 +2,7 @@ import leon.collection._
 
 object MergeSort {
 
-  def split(l : List[Int]) : (List[Int],List[Int]) = { l match {
+  def split(l : List[BigInt]) : (List[BigInt],List[BigInt]) = { l match {
     case Cons(a, Cons(b, t)) => 
       val (rec1, rec2) = split(t)
       (Cons(a, rec1), Cons(b, rec2))
@@ -15,21 +15,21 @@ object MergeSort {
     l1.content ++ l2.content == l.content
   }
 
-  def isSorted(l : List[Int]) : Boolean = l match {
+  def isSorted(l : List[BigInt]) : Boolean = l match {
     case Cons(x, t@Cons(y, _)) => x <= y && isSorted(t)
     case _ => true
   }
 
-  def merge(l1 : List[Int], l2 : List[Int]) : List[Int] = {
+  def merge(l1 : List[BigInt], l2 : List[BigInt]) : List[BigInt] = {
     require(isSorted(l1) && isSorted(l2))
     (l1, l2) match {
-      case (Nil(), _) => l1 // FIXME should be l2
-      case (_, Nil()) => l1
       case (Cons(h1, t1), Cons(h2,t2)) => 
         if (h1 <= h2) 
           Cons(h1, merge(t1, l2))
         else 
-          Cons(h1, merge(l1, t2)) // FIXME should be h2
+          Cons(h2, merge(l1, t2))
+      case (Nil(), _) => l1 // FIXME should be l2
+      case (_, Nil()) => l1
     }
   } ensuring { res =>
     isSorted(res) &&
@@ -37,7 +37,7 @@ object MergeSort {
     res.content == l1.content ++ l2.content
   }
 
-  def mergeSort(l : List[Int]) : List[Int] = { l match {
+  def mergeSort(l : List[BigInt]) : List[BigInt] = { l match {
     case Nil() => l
     case Cons(_, Nil()) => l
     case other =>
diff --git a/testcases/repair/MergeSort/repairs.last b/testcases/repair/MergeSort/repairs.last
deleted file mode 100644
index cbb39c41a..000000000
--- a/testcases/repair/MergeSort/repairs.last
+++ /dev/null
@@ -1,4 +0,0 @@
-           MergeSort,     MergeSort1.scala,                merge, 705,  20,   5,  1081,  1324, 37526,      
-           MergeSort,     MergeSort3.scala,                merge, 705,  20,  14,   941,  1299, 47637,      
-           MergeSort,     MergeSort4.scala,            mergeSort, 704,  21,   4,   965,  4481, 37402,      
-           MergeSort,     MergeSort5.scala,                split, 169,  21,   3,   975,  1445,  6971,      
diff --git a/testcases/repair/Numerical/Numerical.scala b/testcases/repair/Numerical/Numerical.scala
index 1175da9ce..06d0516ab 100644
--- a/testcases/repair/Numerical/Numerical.scala
+++ b/testcases/repair/Numerical/Numerical.scala
@@ -5,26 +5,26 @@ import leon.lang._
 import leon.annotation._
 
 object Numerical {
-  def power(base: Int, p: Int): Int = {
-    require(p >= 0)
-    if (p == 0) {
-      1
-    } else if (p%2 == 0) {
-      power(base*base, p/2)
+  def power(base: BigInt, p: BigInt): BigInt = {
+    require(p >= BigInt(0))
+    if (p == BigInt(0)) {
+      BigInt(1)
+    } else if (p%BigInt(2) == BigInt(0)) {
+      power(base*base, p/BigInt(2))
     } else {
-      base*power(base, p-1)
+      base*power(base, p-BigInt(1))
     }
   } ensuring {
     res => ((base, p), res) passes {
-      case (_, 0) => 1
-      case (b, 1) => b
-      case (2, 7) => 128
-      case (2, 10) => 1024
+      case (_, BigInt(0)) => BigInt(1)
+      case (b, BigInt(1)) => b
+      case (BigInt(2), BigInt(7)) => BigInt(128)
+      case (BigInt(2), BigInt(10)) => BigInt(1024)
     }
   }
 
-  def gcd(a: Int, b: Int): Int = {
-    require(a > 0 && b > 0);
+  def gcd(a: BigInt, b: BigInt): BigInt = {
+    require(a > BigInt(0) && b > BigInt(0));
 
     if (a == b) {
       a
@@ -34,15 +34,15 @@ object Numerical {
       gcd(a, b-a)
     }
   } ensuring {
-    res => (a%res == 0) && (b%res == 0) && (((a,b), res) passes {
-      case (468, 24) => 12
+    res => (a%res == BigInt(0)) && (b%res == BigInt(0)) && (((a,b), res) passes {
+      case (BigInt(468), BigInt(24)) => BigInt(12)
     })
   }
 
-  def moddiv(a: Int, b: Int): (Int, Int) = {
-    require(a >= 0 && b > 0);
+  def moddiv(a: BigInt, b: BigInt): (BigInt, BigInt) = {
+    require(a >= BigInt(0) && b > BigInt(0));
     if (b > a) {
-      (a, 0)
+      (a, BigInt(0))
     } else {
       val (r1, r2) = moddiv(a-b, b)
       (r1, r2+1)
diff --git a/testcases/repair/Numerical/Numerical1.scala b/testcases/repair/Numerical/Numerical1.scala
index 4f1a32f8b..0818b0156 100644
--- a/testcases/repair/Numerical/Numerical1.scala
+++ b/testcases/repair/Numerical/Numerical1.scala
@@ -5,26 +5,26 @@ import leon.lang._
 import leon.annotation._
 
 object Numerical {
-  def power(base: Int, p: Int): Int = {
-    require(p >= 0)
-    if (p == 0) {
-      1
-    } else if (p%2 == 0) {
-      power(base*base, p/2)
+  def power(base: BigInt, p: BigInt): BigInt = {
+    require(p >= BigInt(0))
+    if (p == BigInt(0)) {
+      BigInt(1)
+    } else if (p%BigInt(2) == BigInt(0)) {
+      power(base*base, p/BigInt(2))
     } else {
-      power(base, p-1) // fixme: Missing base*
+      power(base, p-BigInt(1)) // fixme: Missing base*
     }
   } ensuring {
     res => ((base, p), res) passes {
-      case (_, 0) => 1
-      case (b, 1) => b
-      case (2, 7) => 128
-      case (2, 10) => 1024
+      case (_, BigInt(0)) => BigInt(1)
+      case (b, BigInt(1)) => b
+      case (BigInt(2), BigInt(7)) => BigInt(128)
+      case (BigInt(2), BigInt(10)) => BigInt(1024)
     }
   }
 
-  def gcd(a: Int, b: Int): Int = {
-    require(a > 0 && b > 0);
+  def gcd(a: BigInt, b: BigInt): BigInt = {
+    require(a > BigInt(0) && b > BigInt(0));
 
     if (a == b) {
       a
@@ -34,15 +34,15 @@ object Numerical {
       gcd(a, b-a)
     }
   } ensuring {
-    res => (a%res == 0) && (b%res == 0) && (((a,b), res) passes {
-      case (468, 24) => 12
+    res => (a%res == BigInt(0)) && (b%res == BigInt(0)) && (((a,b), res) passes {
+      case (BigInt(468), BigInt(24)) => BigInt(12)
     })
   }
 
-  def moddiv(a: Int, b: Int): (Int, Int) = {
-    require(a >= 0 && b > 0);
+  def moddiv(a: BigInt, b: BigInt): (BigInt, BigInt) = {
+    require(a >= BigInt(0) && b > BigInt(0));
     if (b > a) {
-      (a, 0)
+      (a, BigInt(0))
     } else {
       val (r1, r2) = moddiv(a-b, b)
       (r1, r2+1)
diff --git a/testcases/repair/Numerical/Numerical2.scala b/testcases/repair/Numerical/Numerical2.scala
index ec191f681..a5eb3595f 100644
--- a/testcases/repair/Numerical/Numerical2.scala
+++ b/testcases/repair/Numerical/Numerical2.scala
@@ -5,39 +5,39 @@ import leon.lang._
 import leon.annotation._
 
 object Numerical {
-  def power(base: Int, p: Int): Int = {
-    require(p >= 0)
-    if (p == 0) {
-      1
-    } else if (p%2 == 0) {
-      power(base*base, p/2)
+  def power(base: BigInt, p: BigInt): BigInt = {
+    require(p >= BigInt(0))
+    if (p == BigInt(0)) {
+      BigInt(1)
+    } else if (p%BigInt(2) == BigInt(0)) {
+      power(base*base, p/BigInt(2))
     } else {
-      base*power(base, p-1)
+      base*power(base, p-BigInt(1))
     }
   } ensuring {
     res => ((base, p), res) passes {
-      case (_, 0) => 1
-      case (b, 1) => b
-      case (2, 7) => 128
-      case (2, 10) => 1024
+      case (_, BigInt(0)) => BigInt(1)
+      case (b, BigInt(1)) => b
+      case (BigInt(2), BigInt(7)) => BigInt(128)
+      case (BigInt(2), BigInt(10)) => BigInt(1024)
     }
   }
 
-  def gcd(a: Int, b: Int): Int = {
-    require(a > 0 && b > 0);
+  def gcd(a: BigInt, b: BigInt): BigInt = {
+    require(a > BigInt(0) && b > BigInt(0));
 
     if (a == b) {
-      1 // fixme: should be a
+      BigInt(1) // fixme: should be a
     } else if (a > b) {
       gcd(a-b, b)
     } else {
       gcd(a, b-a)
     }
   } ensuring {
-    res => (a%res == 0) && (b%res == 0) && (((a,b), res) passes {
-      case (120, 24) => 12
-      case (5, 7)    => 1
-      case (5, 5)    => 5
+    res => (a%res == BigInt(0)) && (b%res == BigInt(0)) && (((a,b), res) passes {
+      case (BigInt(120), BigInt(24)) => BigInt(12)
+      case (BigInt(5), BigInt(7))    => BigInt(1)
+      case (BigInt(5), BigInt(5))    => BigInt(5)
     })
   }
 }
diff --git a/testcases/repair/Numerical/Numerical3.scala b/testcases/repair/Numerical/Numerical3.scala
index 4f782cab3..5e0dbee59 100644
--- a/testcases/repair/Numerical/Numerical3.scala
+++ b/testcases/repair/Numerical/Numerical3.scala
@@ -5,26 +5,26 @@ import leon.lang._
 import leon.annotation._
 
 object Numerical {
-  def power(base: Int, p: Int): Int = {
-    require(p >= 0)
-    if (p == 0) {
-      1
-    } else if (p%2 == 0) {
-      power(base*base, p/2)
+  def power(base: BigInt, p: BigInt): BigInt = {
+    require(p >= BigInt(0))
+    if (p == BigInt(0)) {
+      BigInt(1)
+    } else if (p%BigInt(2) == BigInt(0)) {
+      power(base*base, p/BigInt(2))
     } else {
-      base*power(base, p-1)
+      base*power(base, p-BigInt(1))
     }
   } ensuring {
     res => ((base, p), res) passes {
-      case (_, 0) => 1
-      case (b, 1) => b
-      case (2, 7) => 128
-      case (2, 10) => 1024
+      case (_, BigInt(0)) => BigInt(1)
+      case (b, BigInt(1)) => b
+      case (BigInt(2), BigInt(7)) => BigInt(128)
+      case (BigInt(2), BigInt(10)) => BigInt(1024)
     }
   }
 
-  def gcd(a: Int, b: Int): Int = {
-    require(a > 0 && b > 0);
+  def gcd(a: BigInt, b: BigInt): BigInt = {
+    require(a > BigInt(0) && b > BigInt(0));
 
     if (a == b) {
       a
@@ -34,15 +34,15 @@ object Numerical {
       gcd(a, b-a)
     }
   } ensuring {
-    res => (a%res == 0) && (b%res == 0) && (((a,b), res) passes {
-      case (468, 24) => 12
+    res => (a%res == BigInt(0)) && (b%res == BigInt(0)) && (((a,b), res) passes {
+      case (BigInt(468), BigInt(24)) => BigInt(12)
     })
   }
 
-  def moddiv(a: Int, b: Int): (Int, Int) = {
-    require(a >= 0 && b > 0);
+  def moddiv(a: BigInt, b: BigInt): (BigInt, BigInt) = {
+    require(a >= BigInt(0) && b > BigInt(0));
     if (b > a) {
-      (1, 0) // fixme: should be (a, 0)
+      (BigInt(1), BigInt(0)) // fixme: should be (a, BigInt(0))
     } else {
       val (r1, r2) = moddiv(a-b, b)
       (r1, r2+1)
diff --git a/testcases/repair/PropLogic/PropLogic.scala b/testcases/repair/PropLogic/PropLogic.scala
index 718a36e89..b654b8fbc 100644
--- a/testcases/repair/PropLogic/PropLogic.scala
+++ b/testcases/repair/PropLogic/PropLogic.scala
@@ -9,16 +9,16 @@ object SemanticsPreservation {
   case class Or(lhs : Formula, rhs : Formula) extends Formula
   case class Not(f: Formula) extends Formula
   case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
+  case class Literal(id: BigBigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigBigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigBigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
diff --git a/testcases/repair/PropLogic/PropLogic1.scala b/testcases/repair/PropLogic/PropLogic1.scala
index 47752be39..93cd6bfbf 100644
--- a/testcases/repair/PropLogic/PropLogic1.scala
+++ b/testcases/repair/PropLogic/PropLogic1.scala
@@ -5,20 +5,20 @@ import leon.collection._
 object SemanticsPreservation { 
 
   sealed abstract class Formula
-  case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
-  case class Not(f: Formula) extends Formula
   case class And(lhs : Formula, rhs : Formula) extends Formula
   case class Or(lhs : Formula, rhs : Formula) extends Formula
+  case class Not(f: Formula) extends Formula
+  case class Const(v: Boolean) extends Formula
+  case class Literal(id: BigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
@@ -30,17 +30,14 @@ object SemanticsPreservation {
     case Not(And(lhs,rhs)) => Or(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Or(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Const(v)) => Const(!v)
-    case Not(Not(e)) => e // FIXME: should be nnf(e)
+    case Not(Not(e)) => e // FIXME missing nnf
     case And(lhs, rhs) => And(nnf(lhs), nnf(rhs))
     case Or(lhs, rhs)  => Or(nnf(lhs), nnf(rhs))
-    case other => other
+    case other => other 
   }} ensuring { res => 
-    isNNF(res) && ((formula, res) passes {
-      case Not(Not(Not( Const(a) ))) => Const(!a)
-    })
+    isNNF(res)
   }
 
-
   def isNNF(f : Formula) : Boolean = f match {
     case Not(Literal(_)) => true
     case Not(_) => false
diff --git a/testcases/repair/PropLogic/PropLogic2.scala b/testcases/repair/PropLogic/PropLogic2.scala
index 2799b2078..2819234ff 100644
--- a/testcases/repair/PropLogic/PropLogic2.scala
+++ b/testcases/repair/PropLogic/PropLogic2.scala
@@ -9,16 +9,16 @@ object SemanticsPreservation {
   case class Or(lhs : Formula, rhs : Formula) extends Formula
   case class Not(f: Formula) extends Formula
   case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
+  case class Literal(id: BigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
@@ -30,14 +30,12 @@ object SemanticsPreservation {
     case Not(And(lhs,rhs)) => Or(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Or(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Const(v)) => Const(!v)
+    case Not(Not(e)) => nnf(e)
     case And(lhs, rhs) => And(nnf(lhs), nnf(rhs))
     case Or(lhs, rhs)  => Or(nnf(lhs), nnf(rhs))
-    // FIXME: forgot to handle the Not(Not(_)) case 
     case other => other 
   }} ensuring { res => 
-     isNNF(res) && ((formula, res) passes {
-       case Not(Not(Not(Const(a)))) => Const(!a)
-     })
+    isNNF(res)
   }
 
   def isNNF(f : Formula) : Boolean = f match {
@@ -47,5 +45,6 @@ object SemanticsPreservation {
     case Or(lhs, rhs) => isNNF(lhs) && isNNF(rhs)
     case _ => true
   }
-  
+
+    
 }
diff --git a/testcases/repair/PropLogic/PropLogic3.scala b/testcases/repair/PropLogic/PropLogic3.scala
index b65f6e2a2..8f2a62cd8 100644
--- a/testcases/repair/PropLogic/PropLogic3.scala
+++ b/testcases/repair/PropLogic/PropLogic3.scala
@@ -9,16 +9,16 @@ object SemanticsPreservation {
   case class Or(lhs : Formula, rhs : Formula) extends Formula
   case class Not(f: Formula) extends Formula
   case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
+  case class Literal(id: BigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
@@ -29,16 +29,13 @@ object SemanticsPreservation {
   def nnf(formula : Formula) : Formula = { formula match {
     case Not(And(lhs,rhs)) => Or(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Or(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
-    case Not(Const(v)) => Const(v) // FIXME should be !v.
+    case Not(Const(v)) => Const(v) // FIXME
     case Not(Not(e)) => nnf(e)
     case And(lhs, rhs) => And(nnf(lhs), nnf(rhs))
     case Or(lhs, rhs)  => Or(nnf(lhs), nnf(rhs))
     case other => other 
-  }} ensuring { res =>
-    isNNF(res) && ((formula, res) passes {
-      case Not(Const(true)) => Const(false)
-      case Not(Const(false)) => Const(true)
-    })
+  }} ensuring { res => 
+    isNNF(res)
   }
 
   def isNNF(f : Formula) : Boolean = f match {
@@ -49,4 +46,5 @@ object SemanticsPreservation {
     case _ => true
   }
 
+    
 }
diff --git a/testcases/repair/PropLogic/PropLogic4.scala b/testcases/repair/PropLogic/PropLogic4.scala
index 025c0a8b5..40cddee80 100644
--- a/testcases/repair/PropLogic/PropLogic4.scala
+++ b/testcases/repair/PropLogic/PropLogic4.scala
@@ -1,4 +1,3 @@
-// Fails
 import leon.lang._
 import leon.annotation._
 import leon.collection._
@@ -10,16 +9,16 @@ object SemanticsPreservation {
   case class Or(lhs : Formula, rhs : Formula) extends Formula
   case class Not(f: Formula) extends Formula
   case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
+  case class Literal(id: BigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
@@ -28,17 +27,15 @@ object SemanticsPreservation {
   }
 
   def nnf(formula : Formula) : Formula = { formula match {
-    case Not(And(lhs,rhs)) => Or(nnf(Not(lhs)), nnf(Not(rhs)))
+    case Not(And(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Or(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
     case Not(Const(v)) => Const(!v)
     case Not(Not(e)) => nnf(e)
     case And(lhs, rhs) => And(nnf(lhs), nnf(rhs))
-    case Or(lhs, rhs)  => And(nnf(lhs), nnf(rhs)) // FIXME should be Or
+    case Or(lhs, rhs)  => Or(nnf(lhs), nnf(rhs))
     case other => other 
   }} ensuring { res => 
-    isNNF(res) && ((formula, res) passes {
-      case Or(Not(Const(c)), Not(Literal(l))) => Or(Const(!c), Not(Literal(l)))
-    })
+    isNNF(res)
   }
 
   def isNNF(f : Formula) : Boolean = f match {
@@ -49,4 +46,5 @@ object SemanticsPreservation {
     case _ => true
   }
 
+    
 }
diff --git a/testcases/repair/PropLogic/PropLogic5.scala b/testcases/repair/PropLogic/PropLogic5.scala
index 4b411082f..6b24d9926 100644
--- a/testcases/repair/PropLogic/PropLogic5.scala
+++ b/testcases/repair/PropLogic/PropLogic5.scala
@@ -1,4 +1,3 @@
-// Fails
 import leon.lang._
 import leon.annotation._
 import leon.collection._
@@ -10,16 +9,16 @@ object SemanticsPreservation {
   case class Or(lhs : Formula, rhs : Formula) extends Formula
   case class Not(f: Formula) extends Formula
   case class Const(v: Boolean) extends Formula
-  case class Literal(id: Int) extends Formula
+  case class Literal(id: BigInt) extends Formula
 
-  def size(f : Formula) : Int = { f match {
+  def size(f : Formula) : BigInt = { f match {
     case And(l,r) => 1 + size(l) + size(r)
     case Or(l,r) =>  1 + size(l) + size(r)
     case Not(e) => 1 + size(e)
     case _ => 1
   }} ensuring { _ >= 0 }
 
-  def eval(formula: Formula)(implicit trueVars : Set[Int]): Boolean = formula match {
+  def eval(formula: Formula)(implicit trueVars : Set[BigInt]): Boolean = formula match {
     case And(lhs, rhs) => eval(lhs) && eval(rhs)
     case Or(lhs, rhs)  => eval(lhs) || eval(rhs)
     case Not(f) => !eval(f)
@@ -29,16 +28,14 @@ object SemanticsPreservation {
 
   def nnf(formula : Formula) : Formula = { formula match {
     case Not(And(lhs,rhs)) => Or(nnf(Not(lhs)), nnf(Not(rhs)))
-    case Not(Or(lhs,rhs)) => And(nnf(Not(lhs)), nnf(Not(rhs)))
+    case Not(Or(lhs,rhs)) => formula//FIXME And(nnf(Not(lhs)), nnf(Not(rhs))) 
     case Not(Const(v)) => Const(!v)
     case Not(Not(e)) => nnf(e)
     case And(lhs, rhs) => And(nnf(lhs), nnf(rhs))
-    case Or(lhs, rhs)  => formula//And(nnf(lhs), nnf(rhs)) // FIXME should be Or
+    case Or(lhs, rhs)  => Or(nnf(lhs), nnf(rhs))
     case other => other 
   }} ensuring { res => 
-    isNNF(res) && ((formula, res) passes {
-      case Or(Not(Const(c)), Not(Literal(l))) => Or(Const(!c), Not(Literal(l)))
-    })
+    isNNF(res)
   }
 
   def isNNF(f : Formula) : Boolean = f match {
@@ -49,4 +46,5 @@ object SemanticsPreservation {
     case _ => true
   }
 
+    
 }
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree.scala b/testcases/repair/RedBlackTree-old/RedBlackTree.scala
deleted file mode 100644
index 8f88abf28..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree.scala
+++ /dev/null
@@ -1,101 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-
-    (c,a,x,b) match {
-      case (Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case (Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case (Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case (Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case (c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b)))// && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree1.scala b/testcases/repair/RedBlackTree-old/RedBlackTree1.scala
deleted file mode 100644
index 93d5b61e9..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree1.scala
+++ /dev/null
@@ -1,143 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,xV,d))  // FIXME: xV instead of zV in right node
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,xV,d))  // FIXME: xV instead of zV in right node
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b))) //&& redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree2.scala b/testcases/repair/RedBlackTree-old/RedBlackTree2.scala
deleted file mode 100644
index d4675cadb..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree2.scala
+++ /dev/null
@@ -1,143 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  Node(c, ins(x, a), y, b) // FIXME : forgot to balance
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b)) )// && redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree3.scala b/testcases/repair/RedBlackTree-old/RedBlackTree3.scala
deleted file mode 100644
index 4d8e1f39d..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree3.scala
+++ /dev/null
@@ -1,143 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,xV,d))  // FIXME: xV instead of zV in right node
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b))) //&& redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree4.scala b/testcases/repair/RedBlackTree-old/RedBlackTree4.scala
deleted file mode 100644
index cff237c6f..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree4.scala
+++ /dev/null
@@ -1,143 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),xV,Node(Black,c,zV,d))  // FIXME: xV instead of yV in top node
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b))) //&& redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree5.scala b/testcases/repair/RedBlackTree-old/RedBlackTree5.scala
deleted file mode 100644
index 531a5b491..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree5.scala
+++ /dev/null
@@ -1,144 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) && content(res) == content(n) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      // FIXME: forgot this case
-      //case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-      //  Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b)) )// && redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree6.scala b/testcases/repair/RedBlackTree-old/RedBlackTree6.scala
deleted file mode 100644
index 36cfb692b..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree6.scala
+++ /dev/null
@@ -1,142 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r)
-      case _ => n
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) )
-
-  //def add(x: Int, t: Tree): Tree = {
-  //  require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-  //  makeBlack(ins(x, t))
-  //} ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
- 
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    ins(x, t) // FIXME: makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b)) )// && redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/RedBlackTree-old/RedBlackTree7.scala b/testcases/repair/RedBlackTree-old/RedBlackTree7.scala
deleted file mode 100644
index 66b830428..000000000
--- a/testcases/repair/RedBlackTree-old/RedBlackTree7.scala
+++ /dev/null
@@ -1,143 +0,0 @@
-import leon._ 
-import lang._
-import annotation._
-
-object RedBlackTree { 
-  sealed abstract class Color
-  case object Red extends Color
-  case object Black extends Color
- 
-  sealed abstract class Tree
-  case object Empty extends Tree
-  case class Node(color: Color, left: Tree, value: Int, right: Tree) extends Tree
-
-  def content(t: Tree) : Set[Int] = t match {
-    case Empty => Set.empty
-    case Node(_, l, v, r) => content(l) ++ Set(v) ++ content(r)
-  }
-
-  def size(t: Tree) : Int = t match {
-    case Empty => 0
-    case Node(_, l, v, r) => size(l) + 1 + size(r)
-  }
-
-  /* We consider leaves to be black by definition */
-  def isBlack(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black,_,_,_) => true
-    case _ => false
-  }
-
-  def redNodesHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(Black, l, _, r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-    case Node(Red, l, _, r) => isBlack(l) && isBlack(r) && redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def redDescHaveBlackChildren(t: Tree) : Boolean = t match {
-    case Empty => true
-    case Node(_,l,_,r) => redNodesHaveBlackChildren(l) && redNodesHaveBlackChildren(r)
-  }
-
-  def blackBalanced(t : Tree) : Boolean = t match {
-    case Node(_,l,_,r) => blackBalanced(l) && blackBalanced(r) && blackHeight(l) == blackHeight(r)
-    case Empty => true
-  }
-
-  def blackHeight(t : Tree) : Int = t match {
-    case Empty => 1
-    case Node(Black, l, _, _) => blackHeight(l) + 1
-    case Node(Red, l, _, _) => blackHeight(l)
-  }
- 
-    
-  // <<insert element x into the tree t>>
-  def ins(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t))
-    t match {
-      case Empty => Node(Red,Empty,x,Empty)
-      case Node(c,a,y,b) =>
-        if      (x < y)  balance(c, ins(x, a), y, b)
-        else if (x == y) Node(c,a,y,b)
-        else             balance(c,a,y,ins(x, b))
-    }
-  } ensuring (res => 
-    content(res) == content(t) ++ Set(x) && 
-    size(t) <= size(res) && 
-    size(res) <= size(t) + 1 && 
-    redDescHaveBlackChildren(res) && 
-    blackBalanced(res) 
-  )
-
-  def makeBlack(n: Tree): Tree = {
-    require(redDescHaveBlackChildren(n) && blackBalanced(n) )
-    n match {
-      case Node(Red,l,v,r) => Node(Black,l,v,r) 
-      case Node(Black,l,v,r) => Node(Red,l,v,r) // FIXME : Red instead of Black
-    }
-  } ensuring(res => redNodesHaveBlackChildren(res) && blackBalanced(res) && content(res) == content(n) )
-
-  def add(x: Int, t: Tree): Tree = {
-    require(redNodesHaveBlackChildren(t) && blackBalanced(t) )
-    makeBlack(ins(x, t))
-  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res) && blackBalanced(res) )
-  
-//  def buggyAdd(x: Int, t: Tree): Tree = {
-//    require(redNodesHaveBlackChildren(t))
-//    // makeBlack(ins(x, t))
-//    ins(x, t)
-//  } ensuring (res => content(res) == content(t) ++ Set(x) && redNodesHaveBlackChildren(res))
-  
-  def balance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-    // require(
-    //   Node(c,a,x,b) match {
-    //     case Node(Black,Node(Red,Node(Red,a,_,b),_,c),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,Node(Red,a,_,Node(Red,b,_,c)),_,d) =>
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,Node(Red,b,_,c),_,d)) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case Node(Black,a,_,Node(Red,b,_,Node(Red,c,_,d))) => 
-    //       redNodesHaveBlackChildren(a) &&
-    //       redNodesHaveBlackChildren(b) &&
-    //       redNodesHaveBlackChildren(c) &&
-    //       redNodesHaveBlackChildren(d)
-    //     case t => redDescHaveBlackChildren(t)
-    //   }
-    // )
-    Node(c,a,x,b) match {
-      case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-        Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-      case Node(c,a,xV,b) => Node(c,a,xV,b)
-    }
-  } ensuring (res => content(res) == content(Node(c,a,x,b)) )// && redDescHaveBlackChildren(res))
-
-  // def buggyBalance(c: Color, a: Tree, x: Int, b: Tree): Tree = {
-  //   Node(c,a,x,b) match {
-  //     case Node(Black,Node(Red,Node(Red,a,xV,b),yV,c),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,Node(Red,a,xV,Node(Red,b,yV,c)),zV,d) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,Node(Red,b,yV,c),zV,d)) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //     case Node(Black,a,xV,Node(Red,b,yV,Node(Red,c,zV,d))) => 
-  //       Node(Red,Node(Black,a,xV,b),yV,Node(Black,c,zV,d))
-  //   }
-  // } ensuring (res => content(res) == content(Node(c,a,x,b)) ) // && redDescHaveBlackChildren(res))
-
-}
diff --git a/testcases/repair/runTests.sh b/testcases/repair/runTests.sh
index 5a3d49c70..55ca5cdf9 100755
--- a/testcases/repair/runTests.sh
+++ b/testcases/repair/runTests.sh
@@ -40,7 +40,7 @@ echo "#           Category,                 File,             function, p.S, fuS
 
 ./leon --repair --timeout=30 --solvers=fairz3,enum --functions=pad     testcases/repair/List/List1.scala           | tee -a $fullLog
 ./leon --repair --timeout=30 --solvers=fairz3,enum --functions=++      testcases/repair/List/List2.scala           | tee -a $fullLog
-./leon --repair --timeout=30 --solvers=fairz3,enum --functions=ap      testcases/repair/List/List3.scala           | tee -a $fullLog
+./leon --repair --timeout=30 --solvers=fairz3,enum --functions=:+      testcases/repair/List/List3.scala           | tee -a $fullLog
 ./leon --repair --timeout=30                       --functions=drop    testcases/repair/List/List4.scala           | tee -a $fullLog
 ./leon --repair --timeout=30                       --functions=replace testcases/repair/List/List5.scala           | tee -a $fullLog
 ./leon --repair --timeout=30 --solvers=fairz3,enum --functions=count   testcases/repair/List/List6.scala           | tee -a $fullLog
-- 
GitLab