gapt.provers.smtlib.CVC4.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gapt_3 Show documentation
Show all versions of gapt_3 Show documentation
General Architecture for Proof Theory
The newest version!
package gapt.provers.smtlib
import java.io.IOException
import gapt.provers.Session.Runners.ExternalSMTLibSessionRunner
import gapt.provers.IncrementalProver
import gapt.provers.Session._
import gapt.utils.{ExternalProgram, runProcess}
import cats.implicits._
object CVC4 extends CVC4("QF_UF", Seq(), treatUnknownAsSat = false)
class CVC4(val logic: String, val extraArgs: Seq[String] = Seq(), override val treatUnknownAsSat: Boolean = false) extends IncrementalProver with ExternalProgram {
override val isInstalled: Boolean =
try {
runProcess(Seq("cvc4", "--version"))
true
} catch {
case _: IOException => false
}
override def runSession[A](program: Session[A]) = {
val runner = new ExternalSMTLibSessionRunner(Seq("cvc4", "--lang", "smt", "--incremental") ++ extraArgs: _*)
val result = runner.run(setLogic(logic) *> program)
runner.process.destroy()
result
}
}