Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/scala/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ class Config(args: Seq[String]) extends SilFrontendConfig(args, "Silicon") {
noshort = true
)

val disableNLRI: ScallopOption[Boolean] = opt[Boolean]("disableNLRI",
descr = "Disable non-linear integer arithetics (prover must be Z3)",
Comment thread
Dspil marked this conversation as resolved.
Outdated
default = Some(false),
noshort = true
)

private val rawProverSaturationTimeout = opt[Int]("proverSaturationTimeout",
descr = ( "Timeout (in ms) used for the prover's state saturation calls (default: 100). "
+ "A timeout of 0 disables all saturation checks."
Expand Down Expand Up @@ -813,6 +819,11 @@ class Config(args: Seq[String]) extends SilFrontendConfig(args, "Silicon") {
sys.error(s"Unexpected combination: $other")
}

validateOpt(disableNLRI, prover) {
case (Some(true), n) if n != Some(Z3ProverStdIO.name) => Left(s"Option ${disableNLRI.name} is only supported with prover ${Z3ProverStdIO.name}")
Comment thread
Dspil marked this conversation as resolved.
Outdated
case _ => Right(())
}

validateOpt(counterexample, moreCompleteExhale, exhaleModeOption) {
case (Some(_), Some(false), None) |
(Some(_), Some(_), Some(ExhaleMode.Greedy)) =>
Expand Down
9 changes: 8 additions & 1 deletion src/main/scala/decider/Z3ProverStdIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,12 @@ class Z3ProverStdIO(uniqueId: String,
Paths.get(Verifier.config.z3Exe)
}

override def emitSettings(contents: Iterable[String]): Unit = emit(contents)
override def emitSettings(contents: Iterable[String]): Unit = {
emit(contents)
if(Verifier.config.disableNLRI.getOrElse(false)) {
comment("We disable non-linear integer arithmetics")
Comment thread
Dspil marked this conversation as resolved.
Outdated
writeLine(s"(set-option :smt.arith.nl false)")
readSuccess()
}
}
}