From 13937ce4c43d259b507c2265745b95833c3250bc Mon Sep 17 00:00:00 2001
From: Marco Antognini <antognini.marco@gmail.com>
Date: Fri, 20 Nov 2015 12:34:58 +0100
Subject: [PATCH] Explicitly ignore main function in verification tests

And remove some extra whitespace
---
 .../termination/valid/QuickSort.scala         |  4 +-
 .../termination/valid/SimpInterpret.scala     |  9 +--
 .../newsolvers/valid/InsertionSort.scala      |  9 +--
 .../purescala/valid/InsertionSort.scala       |  9 +--
 .../repair/DaysToYears/DaysToYears.scala      | 14 ++--
 .../repair/DaysToYears/DaysToYears1.scala     | 14 ++--
 .../repair/DaysToYears/DaysToYears2.scala     | 16 +++--
 testcases/runtime/SquareRoot.scala            |  2 +
 .../BatchedQueue/BatchedQueue.scala           |  4 +-
 .../verification/case-studies/Robot3po.scala  |  3 +-
 .../compilation/Interpreter.scala             |  8 ++-
 .../compilation/SimpInterpret.scala           |  3 +-
 testcases/verification/graph/MST/MSTMap.scala | 43 ++++++------
 .../graph/dijkstras/DijkstrasSortedList.scala | 65 ++++++++++---------
 .../list-algorithms/InsertionSort.scala       | 13 ++--
 .../list-algorithms/MergeSort.scala           |  2 +
 .../list-algorithms/QuickSort.scala           |  5 +-
 testcases/verification/math/Prime.scala       |  3 +
 .../verification/xlang/InsertionSort.scala    | 13 ++--
 testcases/web/demos/008_Tutorial-Robot.scala  |  3 +-
 .../web/verification/03_Insertion_Sort.scala  | 13 ++--
 21 files changed, 143 insertions(+), 112 deletions(-)

diff --git a/src/test/resources/regression/termination/valid/QuickSort.scala b/src/test/resources/regression/termination/valid/QuickSort.scala
index e356bdc2a..d4fb11ea6 100644
--- a/src/test/resources/regression/termination/valid/QuickSort.scala
+++ b/src/test/resources/regression/termination/valid/QuickSort.scala
@@ -1,5 +1,6 @@
 /* Copyright 2009-2015 EPFL, Lausanne */
 
+import leon.annotation._
 import leon.lang._
 
 object QuickSort {
@@ -29,7 +30,7 @@ object QuickSort {
     case Nil() => bList
     case _ => rev_append(reverse(aList),bList)
   }
-  
+
   def greater(n:Int,list:List) : List = list match {
     case Nil() => Nil()
     case Cons(x,xs) => if (n < x) Cons(x,greater(n,xs)) else greater(n,xs)
@@ -51,6 +52,7 @@ object QuickSort {
     case Cons(x,xs) => append(append(quickSort(smaller(x,xs)),Cons(x,equals(x,xs))),quickSort(greater(x,xs)))
   }) ensuring(res => contents(res) == contents(list)) // && is_sorted(res))
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/src/test/resources/regression/termination/valid/SimpInterpret.scala b/src/test/resources/regression/termination/valid/SimpInterpret.scala
index 76fcd4145..c5255506d 100644
--- a/src/test/resources/regression/termination/valid/SimpInterpret.scala
+++ b/src/test/resources/regression/termination/valid/SimpInterpret.scala
@@ -1,15 +1,15 @@
 /* Copyright 2009-2015 EPFL, Lausanne */
 
-//import leon.annotation._
+import leon.annotation._
 import leon.lang._
 
 object Interpret {
-  abstract class BoolTree 
+  abstract class BoolTree
   case class Eq(t1 : IntTree, t2 : IntTree) extends BoolTree
   case class And(t1 : BoolTree, t2 : BoolTree) extends BoolTree
   case class Not(t : BoolTree) extends BoolTree
 
-  abstract class IntTree 
+  abstract class IntTree
   case class Const(c:Int) extends IntTree
   case class Var() extends IntTree
   case class Plus(t1 : IntTree, t2 : IntTree) extends IntTree
@@ -22,7 +22,7 @@ object Interpret {
   }
 
   def beval(t:BoolTree, x0 : Int) : Boolean = {
-    t match {   
+    t match {
       case Less(t1, t2) => ieval(t1,x0) < ieval(t2,x0)
       case Eq(t1, t2) => ieval(t1,x0) == ieval(t2,x0)
       case And(t1, t2) => beval(t1,x0) && beval(t2,x0)
@@ -62,6 +62,7 @@ object Interpret {
     !treeBad(If(Less(Const(0),Var()), Var(), Minus(Const(0),Var())))
   }.holds
 
+  @ignore
   def main(args : Array[String]) {
     thereIsGoodTree()
   }
diff --git a/src/test/resources/regression/verification/newsolvers/valid/InsertionSort.scala b/src/test/resources/regression/verification/newsolvers/valid/InsertionSort.scala
index 05889fcb7..3252c9acf 100644
--- a/src/test/resources/regression/verification/newsolvers/valid/InsertionSort.scala
+++ b/src/test/resources/regression/verification/newsolvers/valid/InsertionSort.scala
@@ -34,7 +34,7 @@ object InsertionSort {
     case Nil() => true
     case Cons(x, Nil()) => true
     case Cons(x, Cons(y, ys)) => x <= y && isSorted(Cons(y, ys))
-  }   
+  }
 
   /* Inserting element 'e' into a sorted list 'l' produces a sorted list with
    * the expected content and size */
@@ -43,8 +43,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,sortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -54,11 +54,12 @@ object InsertionSort {
   def sort(l: List): List = (l match {
     case Nil() => Nil()
     case Cons(x,xs) => sortedIns(x, sort(xs))
-  }) ensuring(res => contents(res) == contents(l) 
+  }) ensuring(res => contents(res) == contents(l)
                      && isSorted(res)
                      && size(res) == size(l)
              )
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/src/test/resources/regression/verification/purescala/valid/InsertionSort.scala b/src/test/resources/regression/verification/purescala/valid/InsertionSort.scala
index 7c89f3646..0ec78ff0d 100644
--- a/src/test/resources/regression/verification/purescala/valid/InsertionSort.scala
+++ b/src/test/resources/regression/verification/purescala/valid/InsertionSort.scala
@@ -34,7 +34,7 @@ object InsertionSort {
     case Nil() => true
     case Cons(x, Nil()) => true
     case Cons(x, Cons(y, ys)) => x <= y && isSorted(Cons(y, ys))
-  }   
+  }
 
   /* Inserting element 'e' into a sorted list 'l' produces a sorted list with
    * the expected content and size */
@@ -43,8 +43,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,sortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -54,11 +54,12 @@ object InsertionSort {
   def sort(l: List): List = (l match {
     case Nil() => Nil()
     case Cons(x,xs) => sortedIns(x, sort(xs))
-  }) ensuring(res => contents(res) == contents(l) 
+  }) ensuring(res => contents(res) == contents(l)
                      && isSorted(res)
                      && size(res) == size(l)
              )
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/testcases/repair/DaysToYears/DaysToYears.scala b/testcases/repair/DaysToYears/DaysToYears.scala
index bb6c518b3..3a71a4960 100644
--- a/testcases/repair/DaysToYears/DaysToYears.scala
+++ b/testcases/repair/DaysToYears/DaysToYears.scala
@@ -1,10 +1,11 @@
+import leon.annotation._
 import leon.lang._
 
 object DaysToYears {
   val base : Int = 1980
-  
+
   def isLeapYear(y : Int): Boolean = y % 4 == 0
-  
+
   def daysToYears(days : Int): Int = {
     require(days > 0)
     daysToYears1(base, days)._1
@@ -17,16 +18,17 @@ object DaysToYears {
     else if (days > 365 && !isLeapYear(year))
       daysToYears1(year + 1, days - 365)
     else (year, days)
-  } ensuring { res => 
+  } ensuring { res =>
     res._2 <= 366 &&
-    res._2 >  0   && 
+    res._2 >  0   &&
     res._1 >= base &&
-    (((year,days), res) passes { 
+    (((year,days), res) passes {
       case (1980, 366 ) => (1980, 366)
       case (1980, 1000) => (1982, 269)
     })
-  } 
+  }
 
+  @ignore
   def main(args : Array[String]) = {
     println(daysToYears1(base, 10593 ))
     println(daysToYears1(base, 366 ))
diff --git a/testcases/repair/DaysToYears/DaysToYears1.scala b/testcases/repair/DaysToYears/DaysToYears1.scala
index 13eec09ae..1ef2d3379 100644
--- a/testcases/repair/DaysToYears/DaysToYears1.scala
+++ b/testcases/repair/DaysToYears/DaysToYears1.scala
@@ -1,10 +1,11 @@
+import leon.annotation._
 import leon.lang._
 
 object DaysToYears {
   val base : Int = 1980
-  
+
   def isLeapYear(y : Int): Boolean = y % 4 == 0
-  
+
   def daysToYears(days : Int): Int = {
     require(days > 0)
     daysToYears1(base, days)._1
@@ -17,17 +18,18 @@ object DaysToYears {
     else if (days > 365 && !isLeapYear(year))
       daysToYears1(year, days - 365) // FIXME forgot +1
     else (year, days)
-  } ensuring { res => 
+  } ensuring { res =>
     res._2 <= 366 &&
-    res._2 >  0   && 
+    res._2 >  0   &&
     res._1 >= base &&
-    (((year,days), res) passes { 
+    (((year,days), res) passes {
       case (1999, 14 )  => (1999, 14)
       case (1980, 366)  => (1980, 366)
       case (1981, 366)  => (1982, 1)
     })
-  } 
+  }
 
+  @ignore
   def main(args : Array[String]) = {
     println(daysToYears1(base, 10593 ))
     println(daysToYears1(base, 366 ))
diff --git a/testcases/repair/DaysToYears/DaysToYears2.scala b/testcases/repair/DaysToYears/DaysToYears2.scala
index de0d31a70..40396f05c 100644
--- a/testcases/repair/DaysToYears/DaysToYears2.scala
+++ b/testcases/repair/DaysToYears/DaysToYears2.scala
@@ -1,10 +1,11 @@
+import leon.annotation._
 import leon.lang._
 
 object DaysToYears {
   val base : Int = 1980
-  
+
   def isLeapYear(y : Int): Boolean = y % 4 == 0
-  
+
   def daysToYears(days : Int): Int = {
     require(days > 0)
     daysToYears1(base, days)._1
@@ -16,17 +17,18 @@ object DaysToYears {
       daysToYears1(year + 1, days - 366) // TODO this branch cannot be solved although it is correct because it depends on the erroneous branch
     else if (days > 365 && !isLeapYear(year))
       daysToYears1(year + 1, days - 365)
-    else (year + 1, days) // FIXME +1 
-  } ensuring { res => 
+    else (year + 1, days) // FIXME +1
+  } ensuring { res =>
     res._2 <= 366 &&
-    res._2 >  0   && 
+    res._2 >  0   &&
     res._1 >= base &&
-    (((year,days), res) passes { 
+    (((year,days), res) passes {
       case (1980, 366 ) => (1980, 366)
       case (1980, 1000) => (1982, 269)
     })
-  } 
+  }
 
+  @ignore
   def main(args : Array[String]) = {
     println(daysToYears1(base, 10593 ))
     println(daysToYears1(base, 366 ))
diff --git a/testcases/runtime/SquareRoot.scala b/testcases/runtime/SquareRoot.scala
index 87b3e985a..95bdf52f6 100644
--- a/testcases/runtime/SquareRoot.scala
+++ b/testcases/runtime/SquareRoot.scala
@@ -1,3 +1,4 @@
+import leon.annotation._
 import leon.lang._
 import leon.lang.synthesis._
 
@@ -23,6 +24,7 @@ object SquareRoot {
     }
   }
 
+  @ignore
   def main(a: Array[String]) {
     isqrt2(42)
   }
diff --git a/testcases/synthesis/condabd/benchmarks/BatchedQueue/BatchedQueue.scala b/testcases/synthesis/condabd/benchmarks/BatchedQueue/BatchedQueue.scala
index 64a8ae73d..3cf66229c 100644
--- a/testcases/synthesis/condabd/benchmarks/BatchedQueue/BatchedQueue.scala
+++ b/testcases/synthesis/condabd/benchmarks/BatchedQueue/BatchedQueue.scala
@@ -1,3 +1,4 @@
+import leon.annotation._
 import leon.lang._
 import leon.collection._
 
@@ -50,7 +51,7 @@ object BatchedQueue {
       case Cons(_, xs) => checkf(xs, p.r)
     }
   }
-  //	  
+  //
   //	  def last(p: Queue): Int = {
   //	    require(!isEmpty(p))
   //	    p.r match {
@@ -66,6 +67,7 @@ object BatchedQueue {
           (if (isEmpty(p)) true
           else content(tail(res)) ++ Set(x) == content(tail(res))))
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val pair = Queue(Cons(4, Nil), Cons(3, Nil))
 
diff --git a/testcases/verification/case-studies/Robot3po.scala b/testcases/verification/case-studies/Robot3po.scala
index 56709fc55..b189db5e9 100644
--- a/testcases/verification/case-studies/Robot3po.scala
+++ b/testcases/verification/case-studies/Robot3po.scala
@@ -365,7 +365,7 @@ object Robot {
   }
 
   def validState(rs: RobotState)(implicit w: World): Boolean = {
-    
+
     // 6) Sensors have consistent data
     val recentData = rs.ns.validData && rs.hs.validData
 
@@ -509,6 +509,7 @@ object Robot {
   }
 
 
+  @ignore
   def main(a: Array[String]): Unit = {
     val map0 = """|XXXXXXXXX
                   |XR FF   X
diff --git a/testcases/verification/compilation/Interpreter.scala b/testcases/verification/compilation/Interpreter.scala
index 40dcab73c..1c8e3bbde 100644
--- a/testcases/verification/compilation/Interpreter.scala
+++ b/testcases/verification/compilation/Interpreter.scala
@@ -1,12 +1,13 @@
+import leon.annotation._
 import leon.lang._
 
 object Interpret {
-  abstract class BoolTree 
+  abstract class BoolTree
   case class Eq(t1 : IntTree, t2 : IntTree) extends BoolTree
   case class And(t1 : BoolTree, t2 : BoolTree) extends BoolTree
   case class Not(t : BoolTree) extends BoolTree
 
-  abstract class IntTree 
+  abstract class IntTree
   case class Const(c:Int) extends IntTree
   case class Var(index:Int) extends IntTree
   case class Plus(t1 : IntTree, t2 : IntTree) extends IntTree
@@ -19,7 +20,7 @@ object Interpret {
   }
 
   def beval(t:BoolTree, x0 : Int) : Boolean = {
-    t match {   
+    t match {
       case Less(t1, t2) => ieval(t1,x0) < ieval(t2,x0)
       case Eq(t1, t2) => ieval(t1,x0) == ieval(t2,x0)
       case And(t1, t2) => beval(t1,x0) && beval(t2,x0)
@@ -56,6 +57,7 @@ object Interpret {
     !treeBad(If(Less(Const(0),Var(0)), Var(0), Minus(Const(0),Var(0))))
   } holds
 
+  @ignore
   def main(args : Array[String]) {
     thereIsGoodTree()
   }
diff --git a/testcases/verification/compilation/SimpInterpret.scala b/testcases/verification/compilation/SimpInterpret.scala
index fab503589..6c61bad49 100644
--- a/testcases/verification/compilation/SimpInterpret.scala
+++ b/testcases/verification/compilation/SimpInterpret.scala
@@ -1,5 +1,5 @@
 //import scala.collection.immutable.Set
-//import leon.annotation._
+import leon.annotation._
 import leon.lang._
 
 object Interpret {
@@ -61,6 +61,7 @@ object Interpret {
     !treeBad(If(Less(Const(0),Var()), Var(), Minus(Const(0),Var())))
   } holds
 
+  @ignore
   def main(args : Array[String]) {
     thereIsGoodTree()
   }
diff --git a/testcases/verification/graph/MST/MSTMap.scala b/testcases/verification/graph/MST/MSTMap.scala
index 1ef72da32..e718256b6 100644
--- a/testcases/verification/graph/MST/MSTMap.scala
+++ b/testcases/verification/graph/MST/MSTMap.scala
@@ -15,16 +15,16 @@ object MSTMap {
   def mst(g : Graph) : Map[(Int,Int), Int] = {
     require(invariant(g) && isUndirected(g) && isConnected(g) &&
   g.nVertices <= 3)
-    
+
     var uf_map = Map.empty[Int, Int] //map to represent parent
     //relationship to model union find
 
     var spanningTree = Map.empty[(Int,Int), Int]
     var alreadyTested = Map.empty[(Int, Int), Int]
-    
+
     (while(!isConnected(spanningTree, g.nVertices)) {
       val next_edge = getSmallestEdge(g.nVertices, g.edges, alreadyTested)
-      
+
       val p1 = uFind(next_edge._1, uf_map)
       val p2 = uFind(next_edge._2, uf_map)
       if(p1  != p2) {
@@ -45,18 +45,18 @@ object MSTMap {
   // We only verify that the edge set returned corresponds to some
   // spanning tree, but not that it is of minimal weight.
 
-  
+
   // Here, we always take the smallest edge regardless whether it
   // creates a cycle or not,
   // Leon loops
   def mstBogus(g : Graph) : Map[(Int,Int), Int] = {
     require(invariant(g) && isUndirected(g) && isConnected(g) &&
   g.nVertices <= 4)
-    
+
     var edges = g.edges
     var spanningTree = Map.empty[(Int,Int), Int]
     var alreadyTested = Map.empty[(Int, Int), Int]
-    
+
     (while(!isConnected(spanningTree, g.nVertices)) {
       val next_edge = getSmallestEdge(g.nVertices, edges, alreadyTested)
 
@@ -73,13 +73,13 @@ object MSTMap {
     spanningTree
   } ensuring(x => isAcyclic(x, g.nVertices) && isConnected(x, g.nVertices))
 
-  
+
   /*
    -----------------------------------------------------------------------------
    GRAPH FUNCTIONS
    -----------------------------------------------------------------------------
    */
-  
+
 
   def invariant(g : Graph) = {
     def noSelfLoops(i : Int) : Boolean = {
@@ -89,10 +89,10 @@ object MSTMap {
       else
 	noSelfLoops(i+1)
     }
-    
+
     g.nVertices >= 0 && noSelfLoops(0)
   }
-  
+
   /**
    Tests, if g is undirected, that is if for every edge (i,j) there is
    also and edge (j,i)
@@ -108,11 +108,11 @@ object MSTMap {
       var j = 0
       while(j < g.nVertices && res) {
 	res = !edgeSet.isDefinedAt(i,j) || edgeSet.isDefinedAt(j,i)
-	
+
 	 //If weights should considered
 	 if(res && edgeSet.isDefinedAt(i,j))
 	   res = edgeSet(i,j) == edgeSet(j,i)
-	   
+
 	j += 1
       }
       i += 1
@@ -136,11 +136,11 @@ object MSTMap {
      it this function would always return a valid edge, however, this
      property is not easily expressible in Leon.
      */
-    
+
     var i = 0
     val big = 100000000
     var res = (-1,-1,big)
-      
+
       while(i < nVertices) {
 	var j = 0
 	while(j < nVertices) {
@@ -171,7 +171,7 @@ object MSTMap {
      require(g.nVertices >= 0 && isUndirected(g))
      isConnected(g.edges, g.nVertices)
    }
-  
+
   def isConnected(edges : Map[(Int,Int), Int], nVertices : Int) :  Boolean = {
     require(nVertices >= 0)
     val uf = calculateUF(edges, nVertices)._1
@@ -204,7 +204,7 @@ object MSTMap {
   def calculateUF(edgeSet : Map[(Int,Int), Int], nVertices : Int) :
   (Map[Int, Int], Boolean)= {
     require(nVertices >= 0)
-    
+
     var i = 0
     var uf = Map.empty[Int, Int]
     var cycle = false
@@ -223,7 +223,7 @@ object MSTMap {
 
 	    //"remove" twin edge
 	    edges = edges.updated((j,i), -1)
-	  }	   
+	  }
 	}
 	j += 1
       }
@@ -232,7 +232,7 @@ object MSTMap {
 
     (uf, cycle)
   }
-  
+
   /* *************************************
    Union find
    *************************************** */
@@ -246,7 +246,7 @@ object MSTMap {
     // naive union
     val p1 = uFind(e1,s)
     val p2 = uFind(e2, s)
-    
+
     if(p1 != p2)
       //naive union
       s.updated(p1, p2) //only union if theiy are really in different trees
@@ -257,7 +257,8 @@ object MSTMap {
 
   // fsc -d classes -classpath
   // ../../leon-2.0/target/scala-2.9.1-1/classes MST.scala
-  //   scala -classpath classes MST  
+  //   scala -classpath classes MST
+  @ignore
   def main(args: Array[String]) {
     val edges = Map((1,0) -> 10, (0,1) -> 10, (1,2) -> 12, (2,1) ->
   12, (0,2) -> 18, (2,0) -> 18, (3,1) -> 20, (1,3) -> 20)
@@ -267,5 +268,5 @@ object MSTMap {
     println(mst(g)); //works
     println(mstBogus(g)); // crashes because postcondition doensn't hold
   }
-  
+
 }
diff --git a/testcases/verification/graph/dijkstras/DijkstrasSortedList.scala b/testcases/verification/graph/dijkstras/DijkstrasSortedList.scala
index 4ac5d863e..b79751c69 100644
--- a/testcases/verification/graph/dijkstras/DijkstrasSortedList.scala
+++ b/testcases/verification/graph/dijkstras/DijkstrasSortedList.scala
@@ -11,14 +11,14 @@ object DijkstrasSortedList {
    * Graph representation and algorithms
    **************************************************************************/
   case class Graph(nVertices : Int, edges : Map[(Int,Int), Int])
-  
+
   // Disallow self edges? Not actually important since they can be ignored.
   def invariant(g : Graph) = g.nVertices >= 0
-  
+
   // true if x & y have same number of nodes and y has all x's edges
   def isSubGraph(x : Graph, y : Graph) : Boolean = {
     require(invariant(x) && invariant(y))
-    
+
     var ret : Boolean = (x.nVertices == y.nVertices)
     if (ret){
       var i = 0
@@ -34,11 +34,11 @@ object DijkstrasSortedList {
     }
     ret
   }
-  
+
   // true if every edge has a weight of at least 0
   def nonnegativeWeights(g : Graph) : Boolean = {
     require(invariant(g))
-    
+
     var ret : Boolean = true
     var i = 0
     while(i<g.nVertices) {
@@ -54,20 +54,20 @@ object DijkstrasSortedList {
     }
     ret
   }
-  
+
   // true if b is reachable from a
   def isReachable(g : Graph, a : Int, b : Int) : Boolean = {
     require(invariant(g) && a >= 0 && a < g.nVertices && b >= 0 && b < g.nVertices)
-    
+
     //TODO
     false
   }
-  
-  
+
+
   /***************************************************************************
    * Sorted list representation and algorithims
    **************************************************************************/
-   
+
   /** A list containing node, dist pairs.
    *
    * Sorted by distance, nearest first. Distance must be non-negative. Node
@@ -76,7 +76,7 @@ object DijkstrasSortedList {
   abstract class SortedNDList
   case class ListNode(node : Int, dist : Int, next : SortedNDList) extends SortedNDList
   case class ListEnd() extends SortedNDList
-  
+
   /** List invariant (see description above) */
   @induct
   def sndInvariant(list : SortedNDList) : Boolean = {
@@ -91,18 +91,18 @@ object DijkstrasSortedList {
             false
         case ListEnd() => true //len <= 3
       }
-    
+
     invRec(list/*, Set.empty, 0, 0*/)
   }
-  
+
   /** Look for node in list and remove, if it exists. */
   @induct
   def removeFromList(list : SortedNDList, node : Int) : SortedNDList ={
     // something about this times out
     require(sndInvariant(list))
-    
+
     //println("removeFromList: "+list)
-    
+
     list match  {
       case ListNode(n,d,next) =>
         if (n == node)
@@ -113,7 +113,7 @@ object DijkstrasSortedList {
       case ListEnd() => list
     }
   } ensuring(sndInvariant(_))   // something about this generates an error: is the precondition not checked for _all_ elements or something?
-  
+
   /** Return true if list contains node */
   @induct
   def listContains(list : SortedNDList, node : Int) : Boolean ={
@@ -126,14 +126,14 @@ object DijkstrasSortedList {
       case ListEnd() => false
     }
   }
-  
+
   /** Add a new node to the list, such that list remains sorted by distance.
    * Assume node is not already in list. */
   @induct
   def addSorted(list : SortedNDList, node : Int, dist : Int) : SortedNDList = {
     // something to do with this times out
     require(sndInvariant(list) && !listContains(list, node) && node >= 0 && dist >= 0)
-    
+
     list match {
       case ListNode(n,d,next) =>
         if (d > dist)        // insert here
@@ -144,37 +144,37 @@ object DijkstrasSortedList {
         ListNode(node, dist, list)
     }
   } ensuring (sndInvariant(_))  // something to do with this times out
-  
+
   /** Update node with distance minimum of dist and current value. Add if not
    * in list, and maintain sorted order. */
   @induct
   def updateDistInList(list : SortedNDList, node : Int, dist : Int) : SortedNDList = {
     require(sndInvariant(list) && node >= 0 && dist >= 0)
-    
+
     val listRemoved = removeFromList(list, node)
     addSorted(listRemoved, node, dist)
   } ensuring(sndInvariant(_))
-  
-   
+
+
   /***************************************************************************
    * Dijkstra's algorithm
    **************************************************************************/
-  
+
   def isNodeNotB(list : SortedNDList, b : Int) : Boolean =
     list match {
       case ListNode(n, _, _) => n!=b
       case ListEnd() => false
     }
-  
+
   // common precondition: g is a valid graph and a and b are valid nodes
   def bounds(g : Graph, a : Int, b : Int) : Boolean =
     invariant(g) && 0 <= a && a < g.nVertices && 0 <= b && b < g.nVertices
-  
+
   // find the shortest path from a to b in g, and return its distance
   // return -1 if the two aren't connected
   def shortestPath(g : Graph, a : Int, b : Int) : Int = {
     require(bounds(g,a,b) && nonnegativeWeights(g))
-    
+
     // We should always have at least some node if we haven't reached b (so
     // long as b is in the graph and connected to a).
     @induct
@@ -184,20 +184,20 @@ object DijkstrasSortedList {
        * We should check same invariant at function exit. But there's no point:
        * it's too much for Leon to reason about at once!
        */
-      
+
       list match {
         case ListNode(node, dist, next) if (node==b) =>
           list
         case ListNode(node, dist, next) =>
           var n = 0
           var tail : SortedNDList = next
-          
+
           (while (n < g.nVertices){
             if (n != node && !visited.contains(n) && g.edges.isDefinedAt((node,n)))
               tail = updateDistInList(tail, n, dist+g.edges((node,n)))
             n = n + 1
           }) invariant(sndInvariant(list) && n >= 0 && n <= g.nVertices)
-          
+
           spVisit (tail, visited ++ Set(node))
         case ListEnd() =>
           list
@@ -206,7 +206,7 @@ object DijkstrasSortedList {
       case ListEnd() => !isReachable(g,a,b)
       case ListNode(node,_,_) => node==b
     })
-    
+
     // We start from a, which has distance 0. All other nodes implicitly have
     // infinite distance.
     val startingList : SortedNDList = ListNode(a, 0, ListEnd())
@@ -221,12 +221,13 @@ object DijkstrasSortedList {
         -1
     }
   } ensuring (res => res >= -1 /*(if (isReachable(g,a,b)) res>=0 else res== -1)*/)
-  
+
+  @ignore
   def main(args: Array[String]) {
     val spanningTreeE = Map((0,1) -> 1, (0,2) -> 2, (2,3) -> 5, (0,3) -> 10, (3,2) -> 0)
     val spanningTree = Graph(4, spanningTreeE)
     val singleGraph = Graph(1, Map.empty)
-    
+
     println(spanningTree)
     println("from 0 to 3 (should be 7): "+shortestPath(spanningTree,0,3))
     println("from 3 to 1 (no path): "+shortestPath(spanningTree,3,1))
diff --git a/testcases/verification/list-algorithms/InsertionSort.scala b/testcases/verification/list-algorithms/InsertionSort.scala
index 35062e263..980927204 100644
--- a/testcases/verification/list-algorithms/InsertionSort.scala
+++ b/testcases/verification/list-algorithms/InsertionSort.scala
@@ -51,7 +51,7 @@ object InsertionSort {
     case Nil() => true
     case Cons(x, Nil()) => true
     case Cons(x, Cons(y, ys)) => x <= y && isSorted(Cons(y, ys))
-  }   
+  }
 
   /* Inserting element 'e' into a sorted list 'l' produces a sorted list with
    * the expected content and size */
@@ -60,8 +60,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,sortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -73,8 +73,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,buggySortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -84,11 +84,12 @@ object InsertionSort {
   def sort(l: List): List = (l match {
     case Nil() => Nil()
     case Cons(x,xs) => sortedIns(x, sort(xs))
-  }) ensuring(res => contents(res) == contents(l) 
+  }) ensuring(res => contents(res) == contents(l)
                      && isSorted(res)
                      && size(res) == size(l)
              )
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/testcases/verification/list-algorithms/MergeSort.scala b/testcases/verification/list-algorithms/MergeSort.scala
index 1bbd7f607..5fc80d117 100644
--- a/testcases/verification/list-algorithms/MergeSort.scala
+++ b/testcases/verification/list-algorithms/MergeSort.scala
@@ -1,4 +1,5 @@
 import leon.lang._
+import leon.annotation._
 
 object MergeSort {
   sealed abstract class List
@@ -57,6 +58,7 @@ object MergeSort {
   }) ensuring(res => contents(res) == contents(list) && is_sorted(res))
 
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
     println(ls)
diff --git a/testcases/verification/list-algorithms/QuickSort.scala b/testcases/verification/list-algorithms/QuickSort.scala
index 30b362143..1afbc3a2b 100644
--- a/testcases/verification/list-algorithms/QuickSort.scala
+++ b/testcases/verification/list-algorithms/QuickSort.scala
@@ -53,7 +53,7 @@ object QuickSort {
     case Nil() => bList
     case _ => rev_append(reverse(aList),bList)
   }) ensuring(content(_) == content(aList) ++ content(bList))
-  
+
   def greater(n:Int,list:List) : List = list match {
     case Nil() => Nil()
     case Cons(x,xs) => if (n < x) Cons(x,greater(n,xs)) else greater(n,xs)
@@ -69,7 +69,7 @@ object QuickSort {
     case Nil() => Nil()
     case Cons(x,xs) => if (n>x) Cons(x,smaller(n,xs)) else smaller(n,xs)
   }
-    
+
   @induct
   def smallerProp(n: Int, list: List): Boolean = (max(smaller(n, list)) match {
     case Some(m) => n > m
@@ -117,6 +117,7 @@ object QuickSort {
     case Cons(x,xs) => append(append(quickSort(smaller(x,xs)),Cons(x,equals(x,xs))),quickSort(greater(x,xs)))
   }) ensuring(res => content(res) == content(list)) // && isSorted(res))
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/testcases/verification/math/Prime.scala b/testcases/verification/math/Prime.scala
index d8de43f86..1e928dcff 100644
--- a/testcases/verification/math/Prime.scala
+++ b/testcases/verification/math/Prime.scala
@@ -1,3 +1,5 @@
+import leon.annotation._
+
 object Prime {
   // an attempt at defining isPrime in PureScala...
 
@@ -36,6 +38,7 @@ object Prime {
   } ensuring(res => !res)
 
   // Just for testing.
+  @ignore
   def main(args : Array[String]) : Unit = {
     def test(n : BigInt) : Unit = {
       println("Is " + n + " prime ? -> " + isPrime(n))
diff --git a/testcases/verification/xlang/InsertionSort.scala b/testcases/verification/xlang/InsertionSort.scala
index 0a53cb55f..71dab126c 100644
--- a/testcases/verification/xlang/InsertionSort.scala
+++ b/testcases/verification/xlang/InsertionSort.scala
@@ -32,7 +32,7 @@ object InsertionSort {
     case Nil() => true
     case Cons(x, Nil()) => true
     case Cons(x, Cons(y, ys)) => x <= y && isSorted(Cons(y, ys))
-  }   
+  }
   def isReversedSorted(l: List): Boolean = l match {
     case Nil() => true
     case Cons(x, Nil()) => true
@@ -66,8 +66,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,sortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -79,8 +79,8 @@ object InsertionSort {
     l match {
       case Nil() => Cons(e,Nil())
       case Cons(x,xs) => if (x <= e) Cons(x,buggySortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -90,11 +90,12 @@ object InsertionSort {
   def sort(l: List): List = (l match {
     case Nil() => Nil()
     case Cons(x,xs) => sortedIns(x, sort(xs))
-  }) ensuring(res => contents(res) == contents(l) 
+  }) ensuring(res => contents(res) == contents(l)
                      && isSorted(res)
                      && size(res) == size(l)
              )
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil()))))))
 
diff --git a/testcases/web/demos/008_Tutorial-Robot.scala b/testcases/web/demos/008_Tutorial-Robot.scala
index c78dc15f2..bca1f367a 100644
--- a/testcases/web/demos/008_Tutorial-Robot.scala
+++ b/testcases/web/demos/008_Tutorial-Robot.scala
@@ -365,7 +365,7 @@ object Robot {
   }
 
   def validState(rs: RobotState)(implicit w: World): Boolean = {
-    
+
     // 6) Sensors have consistent data
     val recentData = rs.ns.validData && rs.hs.validData
 
@@ -509,6 +509,7 @@ object Robot {
   }
 
 
+  @ignore
   def main(a: Array[String]): Unit = {
     val map0 = """|XXXXXXXXX
                   |XR FF   X
diff --git a/testcases/web/verification/03_Insertion_Sort.scala b/testcases/web/verification/03_Insertion_Sort.scala
index e53b89b17..4b1c8ef7c 100644
--- a/testcases/web/verification/03_Insertion_Sort.scala
+++ b/testcases/web/verification/03_Insertion_Sort.scala
@@ -24,7 +24,7 @@ object InsertionSort {
     case Nil => true
     case Cons(x, Nil) => true
     case Cons(x, Cons(y, ys)) => x <= y && isSorted(Cons(y, ys))
-  }   
+  }
 
   /* Inserting element 'e' into a sorted list 'l' produces a sorted list with
    * the expected content and size */
@@ -33,8 +33,8 @@ object InsertionSort {
     l match {
       case Nil => Cons(e,Nil)
       case Cons(x,xs) => if (x <= e) Cons(x,sortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -44,8 +44,8 @@ object InsertionSort {
     l match {
       case Nil => Cons(e,Nil)
       case Cons(x,xs) => if (x <= e) Cons(x,buggySortedIns(e, xs)) else Cons(e, l)
-    } 
-  } ensuring(res => contents(res) == contents(l) ++ Set(e) 
+    }
+  } ensuring(res => contents(res) == contents(l) ++ Set(e)
                     && isSorted(res)
                     && size(res) == size(l) + 1
             )
@@ -55,7 +55,7 @@ object InsertionSort {
   def sort(l: List): List = (l match {
     case Nil => Nil
     case Cons(x,xs) => sortedIns(x, sort(xs))
-  }) ensuring(res => contents(res) == contents(l) 
+  }) ensuring(res => contents(res) == contents(l)
                      && isSorted(res)
                      && size(res) == size(l)
              )
@@ -69,6 +69,7 @@ object InsertionSort {
     }
   } ensuring(res => contents(res) == contents(l1) ++ contents(l2) && isSorted(res))
 
+  @ignore
   def main(args: Array[String]): Unit = {
     val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil))))))
 
-- 
GitLab