From 2593e1b2d8cdefbf979ea5992fb6eb874757a4a6 Mon Sep 17 00:00:00 2001
From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch>
Date: Wed, 17 Jun 2015 19:20:02 +0200
Subject: [PATCH] Revive some dead code

---
 .../leon/purescala/FunctionClosure.scala      | 28 +++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/main/scala/leon/purescala/FunctionClosure.scala b/src/main/scala/leon/purescala/FunctionClosure.scala
index 61e6af5c5..8f77e8812 100644
--- a/src/main/scala/leon/purescala/FunctionClosure.scala
+++ b/src/main/scala/leon/purescala/FunctionClosure.scala
@@ -122,19 +122,6 @@ object FunctionClosure extends TransformationPhase {
                            args.map(arg => functionClosure(arg, bindedVars, id2freshId, fd2FreshFd)) ++ 
                            extraArgs.map(v => replace(id2freshId.map(p => (p._1.toVariable, p._2.toVariable)), v))).copiedFrom(fi)
     }
-    case n @ NAryOperator(args, recons) => {
-      val rargs = args.map(a => functionClosure(a, bindedVars, id2freshId, fd2FreshFd))
-      recons(rargs).copiedFrom(n)
-    }
-    case b @ BinaryOperator(t1,t2,recons) => {
-      val r1 = functionClosure(t1, bindedVars, id2freshId, fd2FreshFd)
-      val r2 = functionClosure(t2, bindedVars, id2freshId, fd2FreshFd)
-      recons(r1,r2).copiedFrom(b)
-    }
-    case u @ UnaryOperator(t,recons) => {
-      val r = functionClosure(t, bindedVars, id2freshId, fd2FreshFd)
-      recons(r).copiedFrom(u)
-    }
     case m @ MatchExpr(scrut,cses) => {
       val scrutRec = functionClosure(scrut, bindedVars, id2freshId, fd2FreshFd)
       val csesRec = cses.map{ cse =>
@@ -153,7 +140,20 @@ object FunctionClosure extends TransformationPhase {
       case None => v
       case Some(nid) => Variable(nid)
     }
-    case t if t.isInstanceOf[Terminal] => t
+    case n @ NAryOperator(args, recons) => {
+      val rargs = args.map(a => functionClosure(a, bindedVars, id2freshId, fd2FreshFd))
+      recons(rargs).copiedFrom(n)
+    }
+    case b @ BinaryOperator(t1,t2,recons) => {
+      val r1 = functionClosure(t1, bindedVars, id2freshId, fd2FreshFd)
+      val r2 = functionClosure(t2, bindedVars, id2freshId, fd2FreshFd)
+      recons(r1,r2).copiedFrom(b)
+    }
+    case u @ UnaryOperator(t,recons) => {
+      val r = functionClosure(t, bindedVars, id2freshId, fd2FreshFd)
+      recons(r).copiedFrom(u)
+    }
+    case t : Terminal => t
     case unhandled => scala.sys.error("Non-terminal case should be handled in FunctionClosure: " + unhandled)
   }
 
-- 
GitLab