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

Define WeightedBranches as default cost model

Improve error output by specifying which one is the default.
parent 8f620493
Branches
Tags
No related merge requests found
......@@ -25,6 +25,8 @@ abstract class CostModel(val name: String) {
}
object CostModel {
def default: CostModel = WeightedBranchesCostModel
def all: Set[CostModel] = Set(
NaiveCostModel,
WeightedBranchesCostModel
......
......@@ -48,9 +48,12 @@ object SynthesisPhase extends LeonPhase[Program, Program] {
options = options.copy(costModel = model)
case None =>
val errorMsg = "Unknown cost model: " + cm + "\n" +
"Defined cost models: \n" +
(CostModel.all.map(_.name).mkString(" - ", "\n - ", ""))
var errorMsg = "Unknown cost model: " + cm + "\n" +
"Defined cost models: \n"
for (cm <- CostModel.all.toSeq.sortBy(_.name)) {
errorMsg += " - " + cm.name + (if(cm == CostModel.default) " (default)" else "") + "\n"
}
ctx.reporter.fatalError(errorMsg)
}
......
......@@ -7,5 +7,5 @@ case class SynthesizerOptions(
searchWorkers: Int = 1,
firstOnly: Boolean = false,
timeoutMs: Option[Long] = None,
costModel: CostModel = NaiveCostModel
costModel: CostModel = CostModel.default
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment