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

In case !--inplace, report results nicely as well

parent ed392f86
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package synthesis
import purescala.TreeOps.simplifyLets
import purescala.Trees.Expr
import purescala.ScalaPrinter
import purescala.Definitions.Program
object SynthesisPhase extends LeonPhase[Program, Program] {
......@@ -46,6 +47,12 @@ object SynthesisPhase extends LeonPhase[Program, Program] {
for (file <- ctx.files) {
new FileInterface(ctx.reporter, file).updateFile(chooseToExprs)
}
} else {
for ((chs, ex) <- chooseToExprs) {
ctx.reporter.info("-"*80)
ctx.reporter.info("For: "+chs)
ctx.reporter.info("Synthesized Code:\n"+ScalaPrinter(ex))
}
}
p
......
......@@ -110,18 +110,10 @@ class Synthesizer(val r: Reporter, val solvers: List[Solver], generateDerivation
val as = (variablesOf(pred)--xs).toList
val phi = pred
info("")
info("")
info("In Function "+f.id+":")
info("-"*80)
val sol = synthesize(Problem(as, phi, xs), rules)
solutions += ch -> sol
info("Scala code:")
info(ScalaPrinter(simplifyLets(sol.toExpr)))
a
case _ =>
a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment