Skip to content

Include result.kore with --bug-report #2324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jan 15, 2021
Merged
Changes from 18 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
38 changes: 20 additions & 18 deletions kore/app/exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -555,20 +555,21 @@ main = do

mainWithOptions :: KoreExecOptions -> IO ()
mainWithOptions execOptions = do
let KoreExecOptions
{ koreLogOptions
, koreSolverOptions
, bugReportOption
}
= execOptions
let KoreExecOptions { koreSolverOptions, bugReportOption, outputFileName } = execOptions
ensureSmtPreludeExists koreSolverOptions
exitCode <-
withBugReport Main.exeName bugReportOption $ \tmpDir -> do
writeOptionsAndKoreFiles tmpDir execOptions
go <* warnIfLowProductivity
& handle handleWithConfiguration
& handle handleSomeException
& runKoreLog tmpDir koreLogOptions
let execOptions' = execOptions {
outputFileName = Just (tmpDir </> "result.kore") }
writeOptionsAndKoreFiles tmpDir execOptions'
e <- go execOptions' <* warnIfLowProductivity
& handle handleWithConfiguration
& handle handleSomeException
& runKoreLog tmpDir koreLogOptions
case outputFileName of
Nothing -> readFile (tmpDir </> "result.kore") >>= putStr
Just fileName -> copyFile (tmpDir </> "result.kore") fileName
return e
let KoreExecOptions { rtsStatistics } = execOptions
for_ rtsStatistics $ \filePath ->
writeStats filePath =<< getStats
Expand All @@ -577,6 +578,7 @@ mainWithOptions execOptions = do
KoreExecOptions { koreProveOptions } = execOptions
KoreExecOptions { koreSearchOptions } = execOptions
KoreExecOptions { koreMergeOptions } = execOptions
KoreExecOptions { koreLogOptions } = execOptions

handleSomeException :: SomeException -> Main ExitCode
handleSomeException someException = do
Expand All @@ -594,21 +596,21 @@ mainWithOptions execOptions = do
("// Last configuration:\n" <> unparse lastConfiguration)
throwM someException

go :: Main ExitCode
go
go :: KoreExecOptions -> Main ExitCode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we are passing KoreExecOptions into this function now, can we extract it to the top level?

go eOpts
| Just proveOptions@KoreProveOptions{bmc} <- koreProveOptions =
if bmc
then koreBmc execOptions proveOptions
else koreProve execOptions proveOptions
then koreBmc eOpts proveOptions
else koreProve eOpts proveOptions

| Just searchOptions <- koreSearchOptions =
koreSearch execOptions searchOptions
koreSearch eOpts searchOptions

| Just mergeOptions <- koreMergeOptions =
koreMerge execOptions mergeOptions
koreMerge eOpts mergeOptions

| otherwise =
koreRun execOptions
koreRun eOpts

koreSearch :: KoreExecOptions -> KoreSearchOptions -> Main ExitCode
koreSearch execOptions searchOptions = do
Expand Down