Skip to content

Commit b692823

Browse files
Fix bug report: --smt-reset-interval (#2263)
1 parent 626f230 commit b692823

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

kore/app/exec/Main.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ parserInfoModifiers =
396396
unparseKoreSearchOptions :: KoreSearchOptions -> [String]
397397
unparseKoreSearchOptions (KoreSearchOptions _ bound searchType) =
398398
[ "--search searchFile.kore"
399-
, maybeLimit "" (\limit -> "--bound " <> show limit) bound
400-
, "--searchType " <> show searchType
399+
, maybeLimit "" (\limit -> unwords ["--bound", show limit]) bound
400+
, unwords ["--searchType", show searchType]
401401
]
402402

403403
unparseKoreMergeOptions :: KoreMergeOptions -> [String]
@@ -416,9 +416,11 @@ unparseKoreProveOptions
416416
)
417417
=
418418
[ "--prove spec.kore"
419-
, "--spec-module " <> unpack moduleName
420-
, "--graph-search "
421-
<> if graphSearch == DepthFirst then "depth-first" else "breadth-first"
419+
, unwords ["--spec-module", unpack moduleName]
420+
, unwords
421+
[ "--graph-search"
422+
, if graphSearch == DepthFirst then "depth-first" else "breadth-first"
423+
]
422424
, if bmc then "--bmc" else ""
423425
, maybe "" ("--save-proofs " <>) saveProofs
424426
]
@@ -455,12 +457,12 @@ koreExecSh
455457
[ pure $ defaultDefinitionFilePath koreExecOptions
456458
, patternFileName $> "--pattern pgm.kore"
457459
, outputFileName $> "--output result.kore"
458-
, pure $ "--module " <> unpack (getModuleName mainModuleName)
460+
, pure $ unwords ["--module", unpack (getModuleName mainModuleName)]
459461
, (\limit -> unwords ["--breadth", show limit])
460462
<$> maybeLimit Nothing Just breadthLimit
461463
, (\limit -> unwords ["--depth", show limit])
462464
<$> maybeLimit Nothing Just depthLimit
463-
, pure $ "--strategy " <> fst strategy
465+
, pure $ unwords ["--strategy", fst strategy]
464466
, rtsStatistics $>
465467
unwords ["--rts-statistics", defaultRtsStatisticsFilePath]
466468
]

kore/src/Options/SMT.hs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ unparseKoreSolverOptions
121121
catMaybes
122122
[ (\limit -> unwords ["--smt-timeout", show limit])
123123
<$> maybeLimit Nothing Just unwrappedTimeOut
124-
, pure $ unwords ["--smt-reset-interval", show resetInterval]
124+
, pure
125+
$ unwords
126+
[ "--smt-reset-interval"
127+
, show . getResetInterval $ resetInterval
128+
]
125129
, unwrappedPrelude
126130
$> unwords ["--smt-prelude", defaultSmtPreludeFilePath]
127-
, pure $ "--smt " <> fmap Char.toLower (show solver)
131+
, pure $ unwords ["--smt", unparseSolver solver]
128132
]
129133

130134
-- | Available SMT solvers.
@@ -144,6 +148,10 @@ parseSolver =
144148
knownOptions = intercalate ", " (map fst options)
145149
options = [ (map Char.toLower $ show s, s) | s <- [minBound .. maxBound] ]
146150

151+
unparseSolver :: Solver -> String
152+
unparseSolver Z3 = "z3"
153+
unparseSolver None = "none"
154+
147155
readSum :: String -> [(String, value)] -> Options.ReadM (String, value)
148156
readSum longName options = do
149157
opt <- str

0 commit comments

Comments
 (0)