Skip to content

Commit

Permalink
Add support for cvc5
Browse files Browse the repository at this point in the history
  • Loading branch information
vrindisbacher committed Dec 17, 2024
1 parent 9809266 commit 7dbb8a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Language/Fixpoint/Smt/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ makeContext' cfg ctxLog
Process.defaultConfig
{ Process.exe = "cvc4"
, Process.args = ["--incremental", "-L", "smtlib2"] }
Cvc5 -> makeProcess ctxLog $
Process.defaultConfig
{ Process.exe = "cvc5"
, Process.args = ["--incremental", "-L", "smtlib2"] }
solver <- SMTLIB.Backends.initSolver SMTLIB.Backends.Queuing backend
loud <- isLoud
return Ctx { ctxSolver = solver
Expand Down
5 changes: 5 additions & 0 deletions src/Language/Fixpoint/Smt/Theories.hs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ cvc4Preamble :: Config -> [Builder]
cvc4Preamble z
= "(set-logic ALL_SUPPORTED)" : commonPreamble z

cvc5Preamble :: Config -> [Builder]
cvc5Preamble z
= "(set-logic ALL)" : commonPreamble z

commonPreamble :: Config -> [Builder]
commonPreamble _ --TODO use uif flag u (see z3Preamble)
= [ bSort string "Int"
Expand Down Expand Up @@ -351,6 +355,7 @@ sortAppInfo t = case bkFFunc t of
preamble :: Config -> SMTSolver -> [Builder]
preamble u Z3 = z3Preamble u
preamble u Cvc4 = cvc4Preamble u
preamble u Cvc5 = cvc5Preamble u
preamble u _ = commonPreamble u

--------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion src/Language/Fixpoint/Types/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ instance Read RESTOrdering where

---------------------------------------------------------------------------------------

data SMTSolver = Z3 | Z3mem | Cvc4 | Mathsat
data SMTSolver = Z3 | Z3mem | Cvc4 | Cvc5 | Mathsat
deriving (Eq, Data, Typeable, Generic)

instance Default SMTSolver where
Expand All @@ -154,6 +154,7 @@ instance Show SMTSolver where
show Z3 = "z3"
show Z3mem = "z3 API"
show Cvc4 = "cvc4"
show Cvc5 = "cvc5"
show Mathsat = "mathsat"

instance S.Store SMTSolver
Expand Down

0 comments on commit 7dbb8a0

Please sign in to comment.