Skip to content

Commit

Permalink
disable NLIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Dspil committed Dec 1, 2023
1 parent 1eeff3a commit 5a57ea0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/viper/gobra/backend/ViperBackends.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object ViperBackends {
if (config.z3APIMode) {
options = options ++ Vector(s"--prover=${Z3ProverAPI.name}")
}
if (config.disableNLRI) {
if (config.disableNLIR) {
options = options ++ Vector(s"--disableNLRI")
}
val mceSiliconOpt = config.mceMode match {
Expand Down
19 changes: 12 additions & 7 deletions src/main/scala/viper/gobra/frontend/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ object ConfigDefaults {
lazy val DefaultParallelizeBranches: Boolean = false
lazy val DefaultConditionalizePermissions: Boolean = false
lazy val DefaultZ3APIMode: Boolean = false
lazy val DefaultDisableNLIR: Boolean = false
lazy val DefaultMCEMode: MCE.Mode = MCE.Enabled
lazy val DefaultEnableLazyImports: Boolean = false
lazy val DefaultNoVerify: Boolean = false
Expand Down Expand Up @@ -130,6 +131,7 @@ case class Config(
parallelizeBranches: Boolean = ConfigDefaults.DefaultParallelizeBranches,
conditionalizePermissions: Boolean = ConfigDefaults.DefaultConditionalizePermissions,
z3APIMode: Boolean = ConfigDefaults.DefaultZ3APIMode,
disableNLIR: Boolean = ConfigDefaults.DefaultDisableNLIR,
mceMode: MCE.Mode = ConfigDefaults.DefaultMCEMode,
enableLazyImports: Boolean = ConfigDefaults.DefaultEnableLazyImports,
noVerify: Boolean = ConfigDefaults.DefaultNoVerify,
Expand Down Expand Up @@ -180,6 +182,7 @@ case class Config(
parallelizeBranches = parallelizeBranches,
conditionalizePermissions = conditionalizePermissions,
z3APIMode = z3APIMode || other.z3APIMode,
disableNLIR = disableNLIR || other.disableNLIR,
mceMode = mceMode,
enableLazyImports = enableLazyImports || other.enableLazyImports,
noVerify = noVerify || other.noVerify,
Expand Down Expand Up @@ -233,6 +236,7 @@ case class BaseConfig(gobraDirectory: Path = ConfigDefaults.DefaultGobraDirector
parallelizeBranches: Boolean = ConfigDefaults.DefaultParallelizeBranches,
conditionalizePermissions: Boolean = ConfigDefaults.DefaultConditionalizePermissions,
z3APIMode: Boolean = ConfigDefaults.DefaultZ3APIMode,
disableNLIR: Boolean = ConfigDefaults.DefaultDisableNLIR,
mceMode: MCE.Mode = ConfigDefaults.DefaultMCEMode,
enableLazyImports: Boolean = ConfigDefaults.DefaultEnableLazyImports,
noVerify: Boolean = ConfigDefaults.DefaultNoVerify,
Expand Down Expand Up @@ -290,6 +294,7 @@ trait RawConfig {
parallelizeBranches = baseConfig.parallelizeBranches,
conditionalizePermissions = baseConfig.conditionalizePermissions,
z3APIMode = baseConfig.z3APIMode,
disableNLIR = baseConfig.disableNLIR,
mceMode = baseConfig.mceMode,
enableLazyImports = baseConfig.enableLazyImports,
noVerify = baseConfig.noVerify,
Expand Down Expand Up @@ -562,13 +567,6 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals
noshort = true
)

val disableNLIR: ScallopOption[Boolean] = opt[Boolean](
name = "disableNLIR",
descr = "Disable non-linear integer arithmetics. Non compatible using Z3 via API or Carbon",
noshort = true,
default = Some(false)
)

lazy val packageTimeoutDuration: Duration = packageTimeout.toOption match {
case Some(d) => Duration(d)
case _ => Duration.Inf
Expand Down Expand Up @@ -654,6 +652,13 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals
noshort = true,
)

val disableNLIR: ScallopOption[Boolean] = opt[Boolean](
name = "disableNLIR",
descr = "Disable non-linear integer arithmetics. Non compatible using Z3 via API or Carbon",
default = Some(ConfigDefaults.DefaultDisableNLIR),
noshort = true,
)

val mceMode: ScallopOption[MCE.Mode] = {
val on = "on"
val off = "off"
Expand Down

0 comments on commit 5a57ea0

Please sign in to comment.