Skip to content

Commit 6e150f0

Browse files
committed
Change order of solvers to avoid smt-z3-opt being recognized as a custom z3 executable
1 parent 8a2beb5 commit 6e150f0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/scala/inox/solvers/SolverFactory.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,19 @@ object SolverFactory {
191191
}
192192
})
193193

194-
case _ if finalName.startsWith("smt-z3") => create(p)(finalName, {
194+
case "smt-z3-opt" => create(p)(finalName, {
195195
val chooseEnc = ChooseEncoder(p)(enc)
196196
val fullEnc = enc andThen chooseEnc
197197
val theoryEnc = theories.Z3(fullEnc.targetProgram)
198198
val progEnc = fullEnc andThen theoryEnc
199199
val targetProg = progEnc.targetProgram
200200
val targetSem = targetProg.getSemantics
201-
val executableName = if (finalName == "smt-z3") "z3" else finalName.drop(7)
202201

203202
() => new {
204203
val program: p.type = p
205204
val context = ctx
206205
val encoder: enc.type = enc
207-
} with UnrollingSolver with TimeoutSolver with tip.TipDebugger {
206+
} with UnrollingOptimizer with TimeoutSolver {
208207
override protected val semantics = sem
209208
override protected val chooses: chooseEnc.type = chooseEnc
210209
override protected val theories: theoryEnc.type = theoryEnc
@@ -216,26 +215,26 @@ object SolverFactory {
216215
protected val underlying = new {
217216
val program: progEnc.targetProgram.type = progEnc.targetProgram
218217
val context = ctx
219-
} with smtlib.Z3Solver {
218+
} with smtlib.optimization.Z3Optimizer {
220219
val semantics: program.Semantics = targetSem
221-
override def targetName = executableName
222220
}
223221
}
224222
})
225223

226-
case "smt-z3-opt" => create(p)(finalName, {
224+
case _ if finalName.startsWith("smt-z3") => create(p)(finalName, {
227225
val chooseEnc = ChooseEncoder(p)(enc)
228226
val fullEnc = enc andThen chooseEnc
229227
val theoryEnc = theories.Z3(fullEnc.targetProgram)
230228
val progEnc = fullEnc andThen theoryEnc
231229
val targetProg = progEnc.targetProgram
232230
val targetSem = targetProg.getSemantics
231+
val executableName = if (finalName == "smt-z3") "z3" else finalName.drop(7)
233232

234233
() => new {
235234
val program: p.type = p
236235
val context = ctx
237236
val encoder: enc.type = enc
238-
} with UnrollingOptimizer with TimeoutSolver {
237+
} with UnrollingSolver with TimeoutSolver with tip.TipDebugger {
239238
override protected val semantics = sem
240239
override protected val chooses: chooseEnc.type = chooseEnc
241240
override protected val theories: theoryEnc.type = theoryEnc
@@ -247,8 +246,9 @@ object SolverFactory {
247246
protected val underlying = new {
248247
val program: progEnc.targetProgram.type = progEnc.targetProgram
249248
val context = ctx
250-
} with smtlib.optimization.Z3Optimizer {
249+
} with smtlib.Z3Solver {
251250
val semantics: program.Semantics = targetSem
251+
override def targetName = executableName
252252
}
253253
}
254254
})

0 commit comments

Comments
 (0)