From d8328f4f9ac9234fe946e65e206d4de00722255c Mon Sep 17 00:00:00 2001 From: Levente Bajczi Date: Mon, 13 Nov 2023 13:18:38 +0100 Subject: [PATCH] Only using portfolio, if portfolio file is given --- .../src/main/java/hu/bme/mit/theta/xcfa/cli/XcfaCli.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subprojects/xcfa/xcfa-cli/src/main/java/hu/bme/mit/theta/xcfa/cli/XcfaCli.kt b/subprojects/xcfa/xcfa-cli/src/main/java/hu/bme/mit/theta/xcfa/cli/XcfaCli.kt index b1012680e3..6ae1ec6815 100644 --- a/subprojects/xcfa/xcfa-cli/src/main/java/hu/bme/mit/theta/xcfa/cli/XcfaCli.kt +++ b/subprojects/xcfa/xcfa-cli/src/main/java/hu/bme/mit/theta/xcfa/cli/XcfaCli.kt @@ -100,11 +100,11 @@ class XcfaCli(private val args: Array) { var backend: Backend = Backend.CEGAR @Parameter(names = ["--strategy"], description = "Execution strategy") - var strategy: Strategy = Strategy.PORTFOLIO + var strategy: Strategy = Strategy.DIRECT @Parameter(names = ["--portfolio"], description = "Portfolio type (only valid with --strategy PORTFOLIO)") - var portfolio: String = "COMPLEX" + var portfolio: String? = null @Parameter(names = ["--smt-home"], description = "The path of the solver registry") var solverHome: String = SmtLibSolverManager.HOME.toAbsolutePath().toString() @@ -191,6 +191,7 @@ class XcfaCli(private val args: Array) { val logger = ConsoleLogger(logLevel) val uniqueWarningLogger = UniqueWarningLogger(logLevel) val explicitProperty: ErrorDetection = getExplicitProperty(uniqueWarningLogger) + portfolio?.run { strategy = Strategy.PORTFOLIO } // propagating input variables LbePass.level = lbeLevel @@ -274,7 +275,7 @@ class XcfaCli(private val args: Array) { logger: ConsoleLogger, parseContext: ParseContext, debug: Boolean = false): SafetyResult<*, *> { return try { val portfolioResult = if (File(portfolio).exists()) { - val portfolioDescriptor = portfolio.lowercase() + ".kts" + val portfolioDescriptor = portfolio!!.lowercase() + ".kts" val kotlinEngine: ScriptEngine = ScriptEngineManager().getEngineByExtension("kts") val bindings: Bindings = kotlinEngine.createBindings() bindings["xcfa"] = xcfa