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

Simplify a bit

parent 8348f51d
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ object Main { ...@@ -117,7 +117,7 @@ object Main {
LeonContext(settings = settings, reporter = reporter, files = files, options = leonOptions) LeonContext(settings = settings, reporter = reporter, files = files, options = leonOptions)
} }
def computePipeline(settings: Settings): Pipeline[List[String], Unit] = { def computePipeline(settings: Settings): Pipeline[List[String], Any] = {
import purescala.Definitions.Program import purescala.Definitions.Program
val pipeBegin : Pipeline[List[String],Program] = plugin.ExtractionPhase val pipeBegin : Pipeline[List[String],Program] = plugin.ExtractionPhase
...@@ -129,28 +129,27 @@ object Main { ...@@ -129,28 +129,27 @@ object Main {
ImperativeCodeElimination andThen ImperativeCodeElimination andThen
FunctionClosure FunctionClosure
} else { } else {
NoopPhase[Program]() NoopPhase()
} }
val pipeSynthesis: Pipeline[Program, Program]= val pipeSynthesis: Pipeline[Program, Program]=
if (settings.synthesis) { if (settings.synthesis) {
synthesis.SynthesisPhase synthesis.SynthesisPhase
} else { } else {
NoopPhase[Program]() NoopPhase()
} }
val pipeVerify: Pipeline[Program, Any] = val pipeVerify: Pipeline[Program, Any] =
if (settings.verify) { if (settings.verify) {
verification.AnalysisPhase verification.AnalysisPhase
} else { } else {
NoopPhase[Program]() NoopPhase()
} }
pipeBegin andThen pipeBegin andThen
pipeTransforms andThen pipeTransforms andThen
pipeSynthesis andThen pipeSynthesis andThen
pipeVerify andThen pipeVerify
ExitPhase()
} }
def main(args : Array[String]) { def main(args : Array[String]) {
......
package leon package leon
abstract class Pipeline[-F, +T] { abstract class Pipeline[-F, +T] {
self => self =>
def andThen[G](then: Pipeline[T, G]): Pipeline[F, G] = new Pipeline[F,G] { def andThen[G](then: Pipeline[T, G]): Pipeline[F, G] = new Pipeline[F,G] {
def run(ctx : LeonContext)(v : F) : G = then.run(ctx)(self.run(ctx)(v)) def run(ctx : LeonContext)(v : F) : G = then.run(ctx)(self.run(ctx)(v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment