Skip to content

Commit

Permalink
Merge branch 'master' into sam/requires-clause-to-list
Browse files Browse the repository at this point in the history
  • Loading branch information
goodlyrottenapple committed Aug 15, 2024
2 parents d439fb0 + 2faf6c1 commit 039e572
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion booster/tools/booster/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ translateSMTOpts = \case
, retryLimit =
KoreSMT.RetryLimit . maybe Unlimited (Limit . fromIntegral) $ smtOpts.retryLimit
, tactic = fmap translateSExpr smtOpts.tactic
, args = smtOpts.args
}
Nothing ->
defaultKoreSolverOptions{solver = KoreSMT.None}
Expand All @@ -499,6 +500,7 @@ translateSMTOpts = \case
, prelude = KoreSMT.Prelude Nothing
, solver = KoreSMT.Z3
, tactic = Nothing
, args = []
}
translateSExpr :: SMT.SExpr -> KoreSMT.SExpr
translateSExpr (SMT.Atom (SMT.SMTId x)) = KoreSMT.Atom (Text.decodeUtf8 x)
Expand Down Expand Up @@ -533,7 +535,7 @@ mkKoreServer [email protected]{logAction} CLOptions{definitionFile, mainMo
, loggerEnv
}
where
KoreSMT.KoreSolverOptions{timeOut, retryLimit, tactic} = koreSolverOptions
KoreSMT.KoreSolverOptions{timeOut, retryLimit, tactic, args} = koreSolverOptions
smtConfig :: KoreSMT.Config
smtConfig =
KoreSMT.defaultConfig
Expand All @@ -542,6 +544,7 @@ mkKoreServer [email protected]{logAction} CLOptions{definitionFile, mainMo
KoreSMT.timeOut = timeOut
, KoreSMT.retryLimit = retryLimit
, KoreSMT.tactic = tactic
, KoreSMT.arguments = args <> KoreSMT.defaultConfig.arguments
}

-- SMT solver with user declared lemmas
Expand Down
2 changes: 2 additions & 0 deletions dev-tools/kore-rpc-dev/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ translateSMTOpts = \case
, retryLimit =
KoreSMT.RetryLimit . maybe Unlimited (Limit . fromIntegral) $ smtOpts.retryLimit
, tactic = fmap translateSExpr smtOpts.tactic
, args = smtOpts.args
}
Nothing ->
defaultKoreSolverOptions{solver = KoreSMT.None}
Expand All @@ -317,6 +318,7 @@ translateSMTOpts = \case
, prelude = KoreSMT.Prelude Nothing
, solver = KoreSMT.Z3
, tactic = Nothing
, args = []
}
translateSExpr :: SMT.SExpr -> KoreSMT.SExpr
translateSExpr (SMT.Atom (SMT.SMTId x)) = KoreSMT.Atom (Text.decodeUtf8 x)
Expand Down
4 changes: 3 additions & 1 deletion kore/app/share/GlobalMain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ import SMT (
SMT,
)
import SMT qualified
import SMT qualified as SMT.Config (Config (..))
import System.Clock (
Clock (Monotonic),
diffTimeSpec,
Expand Down Expand Up @@ -581,14 +582,15 @@ execute options metadataTools lemmas worker =
(declareSMTLemmas metadataTools lemmas)
worker
withoutSMT = SMT.runNoSMT worker
KoreSolverOptions{timeOut, rLimit, resetInterval, prelude, solver} =
KoreSolverOptions{timeOut, rLimit, resetInterval, prelude, solver, args} =
options
config =
SMT.defaultConfig
{ SMT.timeOut = timeOut
, SMT.rLimit = rLimit
, SMT.resetInterval = resetInterval
, SMT.prelude = prelude
, SMT.arguments = args <> SMT.Config.arguments SMT.defaultConfig
}

data SerializedDefinition = SerializedDefinition
Expand Down
10 changes: 10 additions & 0 deletions kore/src/Options/SMT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ data KoreSolverOptions = KoreSolverOptions
, prelude :: !Prelude
, solver :: !Solver
, tactic :: !(Maybe SExpr)
, args :: [String]
}

parseKoreSolverOptions :: Parser KoreSolverOptions
Expand All @@ -72,6 +73,7 @@ parseKoreSolverOptions =
<*> parsePrelude
<*> parseSolver
<*> parseTactic
<*> parseArgs
where
parseTimeOut =
option
Expand Down Expand Up @@ -128,6 +130,14 @@ parseKoreSolverOptions =
<> value defaultTactic
)

parseArgs =
many $
strOption
( metavar "SMT_ARG"
<> long "smt-arg"
<> help "Argument passed to Z3"
)

SMT.Config
{ timeOut = defaultTimeOut
, retryLimit = defaultRetryLimit
Expand Down

0 comments on commit 039e572

Please sign in to comment.