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

Inject the synthesized function only once, instead of once per compilation unit.

parent 322a0d22
Branches
Tags
No related merge requests found
...@@ -74,7 +74,7 @@ class Synthesizer(val context : LeonContext, ...@@ -74,7 +74,7 @@ class Synthesizer(val context : LeonContext,
val solverf = SolverFactory.default(context, npr).withTimeout(timeout) val solverf = SolverFactory.default(context, npr).withTimeout(timeout)
try { try {
val vctx = VerificationContext(context, npr, solverf, context.reporter) val vctx = VerificationContext(context, npr, solverf, context.reporter)
val vcs = generateVCs(vctx, Some(fds.map(_.id.name))) val vcs = generateVCs(vctx, Some(fds.map(_.id.name)))
val vcreport = checkVCs(vctx, vcs) val vcreport = checkVCs(vctx, vcs)
...@@ -113,9 +113,10 @@ class Synthesizer(val context : LeonContext, ...@@ -113,9 +113,10 @@ class Synthesizer(val context : LeonContext,
val newDefs = fd +: sol.defs.toList val newDefs = fd +: sol.defs.toList
val npr = program.copy(units = program.units map { u => val newModule = ModuleDef(FreshIdentifier("synthesis"), newDefs.toSeq, false)
u.copy(modules = ModuleDef(FreshIdentifier("synthesis"), newDefs.toSeq, false) +: u.modules ) val newUnit = UnitDef(FreshIdentifier("synthesis"), Seq(newModule), Nil, Seq(), true)
})
val npr = program.copy(units = newUnit :: program.units)
(npr, newDefs) (npr, newDefs)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment