Skip to content
Snippets Groups Projects
Commit 04f248da authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Search can be passed problem once - make it public

parent e180d028
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,9 @@ import scala.annotation.tailrec
import leon.utils.Interruptible
import java.util.concurrent.atomic.AtomicBoolean
class Search(val ctx: LeonContext, ci: SourceInfo, p: Problem, val strat: Strategy) extends Interruptible {
class Search(val ctx: LeonContext, ci: SourceInfo, val strat: Strategy) extends Interruptible {
val p: Problem = ci.problem
val g = new Graph(p)
val interrupted = new AtomicBoolean(false)
......
......@@ -20,8 +20,6 @@ class Synthesizer(val context : LeonContext,
val ci: SourceInfo,
val settings: SynthesisSettings) {
val problem = ci.problem
val reporter = context.reporter
lazy val sctx = new SynthesisContext(context, settings, ci.fd, program)
......@@ -44,14 +42,14 @@ class Synthesizer(val context : LeonContext,
strat1
}
new Search(context, ci, problem, strat2)
new Search(context, ci, strat2)
}
private var lastTime: Long = 0
def synthesize(): (Search, Stream[Solution]) = {
reporter.ifDebug { printer =>
printer(problem.eb.asString("Tests available for synthesis")(context))
printer(ci.problem.eb.asString("Tests available for synthesis")(context))
}
val s = getSearch
......
......@@ -85,7 +85,7 @@ class StringRenderSuite extends LeonTestSuiteWithProgram with Matchers with Scal
def applyStringRenderOn(functionName: String): (FunDef, Program) = {
val ci = synthesisInfos(functionName)
val search = new Search(ctx, ci, ci.problem, new CostBasedStrategy(ctx, CostModels.default))
val search = new Search(ctx, ci, new CostBasedStrategy(ctx, CostModels.default))
val synth = new Synthesizer(ctx, program, ci, SynthesisSettings(rules = Seq(StringRender)))
val orNode = search.g.root
if (!orNode.isExpanded) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment