Skip to content
Snippets Groups Projects
Commit 64179f79 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Revert changes I no longer need

parent 6522fc50
Branches
Tags
No related merge requests found
...@@ -98,11 +98,6 @@ object ArrayTransformation extends Pass { ...@@ -98,11 +98,6 @@ object ArrayTransformation extends Pass {
IfExpr(rc, rt, re).setType(rt.getType) IfExpr(rc, rt, re).setType(rt.getType)
} }
case c @ Choose(args, body) =>
val body2 = transform(body)
Choose(args, body2).setType(c.getType).setPosInfo(c)
case m @ MatchExpr(scrut, cses) => { case m @ MatchExpr(scrut, cses) => {
val scrutRec = transform(scrut) val scrutRec = transform(scrut)
val csesRec = cses.map{ val csesRec = cses.map{
......
...@@ -257,9 +257,9 @@ object ImperativeCodeElimination extends Pass { ...@@ -257,9 +257,9 @@ object ImperativeCodeElimination extends Pass {
val (argVal, argScope, argFun) = toFunction(a) val (argVal, argScope, argFun) = toFunction(a)
(recons(argVal).setType(u.getType), argScope, argFun) (recons(argVal).setType(u.getType), argScope, argFun)
} }
case (t: Terminal) => (t, (body: Expr) => body, Map()) case (t: Terminal) => (t, (body: Expr) => body, Map())
case _ => sys.error("not supported: " + expr) case _ => sys.error("not supported: " + expr)
} }
//val codeRepresentation = res._2(Block(res._3.map{ case (id1, id2) => Assignment(id1, id2.toVariable)}.toSeq, res._1)) //val codeRepresentation = res._2(Block(res._3.map{ case (id1, id2) => Assignment(id1, id2.toVariable)}.toSeq, res._1))
......
...@@ -4,9 +4,6 @@ import scala.tools.nsc.{Global,Settings=>NSCSettings,SubComponent,CompilerComman ...@@ -4,9 +4,6 @@ import scala.tools.nsc.{Global,Settings=>NSCSettings,SubComponent,CompilerComman
import purescala.Definitions.Program import purescala.Definitions.Program
import synthesis.Synthesizer
import purescala.ScalaPrinter
object Main { object Main {
import leon.{Reporter,DefaultReporter,Analysis} import leon.{Reporter,DefaultReporter,Analysis}
...@@ -35,10 +32,11 @@ object Main { ...@@ -35,10 +32,11 @@ object Main {
private def defaultAction(program: Program, reporter: Reporter) : Unit = { private def defaultAction(program: Program, reporter: Reporter) : Unit = {
Logger.debug("Default action on program: " + program, 3, "main") Logger.debug("Default action on program: " + program, 3, "main")
//val passManager = new PassManager(Seq(ArrayTransformation, EpsilonElimination, ImperativeCodeElimination, /*UnitElimination,*/ FunctionClosure, /*FunctionHoisting,*/ Simplificator)) val passManager = new PassManager(Seq(ArrayTransformation, EpsilonElimination, ImperativeCodeElimination, /*UnitElimination,*/ FunctionClosure, /*FunctionHoisting,*/ Simplificator))
//val program2 = passManager.run(program) val program2 = passManager.run(program)
assert(program.isPure) assert(program2.isPure)
val program2 = new Synthesizer().synthesizeAll(program) val analysis = new Analysis(program2, reporter)
analysis.analyse
} }
private def runWithSettings(args : Array[String], settings : NSCSettings, printerFunction : String=>Unit, actionOnProgram : Option[Program=>Unit] = None) : Unit = { private def runWithSettings(args : Array[String], settings : NSCSettings, printerFunction : String=>Unit, actionOnProgram : Option[Program=>Unit] = None) : Unit = {
......
...@@ -60,7 +60,7 @@ class Synthesizer(rules: List[Rule]) { ...@@ -60,7 +60,7 @@ class Synthesizer(rules: List[Rule]) {
solution solution
} }
def test1 = { def test() {
import purescala.Common._ import purescala.Common._
import purescala.Trees._ import purescala.Trees._
import purescala.TypeTrees._ import purescala.TypeTrees._
...@@ -73,7 +73,6 @@ class Synthesizer(rules: List[Rule]) { ...@@ -73,7 +73,6 @@ class Synthesizer(rules: List[Rule]) {
} }
def synthesizeAll(p: Program): Program = { def synthesizeAll(p: Program): Program = {
test1
p p
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment