-
Notifications
You must be signed in to change notification settings - Fork 44
Do not ignore --strategy all
#2231
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
Do not ignore --strategy all
#2231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all looks in order to me but let's wait for Ana's review as well
kore/src/Kore/Exec.hs
Outdated
exitCodePatterns <- do | ||
pat <- Logic.scatter $ fmap mkGetExitCode `MultiOr.map` finalConfig | ||
Pattern.simplifyTopConfiguration pat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to gather the branches here, and remove Logic.observeAllT
in takeExitCode
, below. Otherwise, we would return ExitFailure 111
when all the branches agree, if any branch would return \bottom
.
exitCodePatterns <- do | |
pat <- Logic.scatter $ fmap mkGetExitCode `MultiOr.map` finalConfig | |
Pattern.simplifyTopConfiguration pat | |
exitCodePatterns <- | |
do | |
pat <- Logic.scatter $ fmap mkGetExitCode `MultiOr.map` finalConfig | |
Pattern.simplifyTopConfiguration pat | |
& MultiOr.gather |
kore/src/Kore/Exec.hs
Outdated
let exitList = | ||
extractExit . Pattern.term | ||
<$> Foldable.toList exitCodePatterns | ||
exitCode = | ||
case nubOrd exitList of | ||
[exit] -> exit | ||
_ -> ExitFailure 111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need nubOrd
here if we use MultiOr.gather
above:
let exitList = | |
extractExit . Pattern.term | |
<$> Foldable.toList exitCodePatterns | |
exitCode = | |
case nubOrd exitList of | |
[exit] -> exit | |
_ -> ExitFailure 111 | |
let exitCode = | |
case toList (MultiOr.map Pattern.term exitCodePatterns) of | |
[exitTerm] -> extractExit exitTerm | |
_ -> ExitFailure 111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some suggestions for clean-up, but this looks pretty good.
=> VerifiedModule StepperAttributes | ||
-- ^ The main module | ||
-> Pattern VariableName | ||
-> OrPattern.OrPattern VariableName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this type was changed, let's change the name of the argument to configs
instead.
kore/src/Kore/Exec.hs
Outdated
exitCodePatterns <- | ||
do | ||
pat <- Logic.scatter $ fmap mkGetExitCode `MultiOr.map` finalConfig | ||
Pattern.simplifyTopConfiguration pat | ||
& MultiOr.gather | ||
let flatExitCodePatterns = MultiOr.flatten exitCodePatterns | ||
exitCode = | ||
case toList (MultiOr.map Pattern.term flatExitCodePatterns) of | ||
[exitTerm] -> extractExit exitTerm | ||
_ -> ExitFailure 111 | ||
return exitCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exitCodePatterns <- | |
do | |
pat <- Logic.scatter $ fmap mkGetExitCode `MultiOr.map` finalConfig | |
Pattern.simplifyTopConfiguration pat | |
& MultiOr.gather | |
let flatExitCodePatterns = MultiOr.flatten exitCodePatterns | |
exitCode = | |
case toList (MultiOr.map Pattern.term flatExitCodePatterns) of | |
[exitTerm] -> extractExit exitTerm | |
_ -> ExitFailure 111 | |
return exitCode | |
exitCodePatterns <- | |
do | |
config <- Logic.scatter configs | |
Pattern.simplifyTopConfiguration (mkGetExitCode <$> config) | |
>>= Logic.scatter | |
& MultiOr.gather | |
let exitCode = | |
case toList (MultiOr.map Pattern.term exitCodePatterns) of | |
[exitTerm] -> extractExit exitTerm | |
_ -> ExitFailure 111 | |
return exitCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ttuegel If I use gather :: (Ord a, TopBottom a, MonadLogic m) => m a -> m (MultiOr a)
there, then the lambda function given to takeExitCode
has to return a MonadLogic
result. Then how can I change its signature to
takeExitCode :: (([Sort] -> Symbol) -> simplifier ExitCode)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant to suggest using MultiOr.observeAllT
instead of MultiOr.gather
.
kore/src/Kore/Exec.hs
Outdated
resolve = resolveInternalSymbol indexedModule . noLocationId | ||
|
||
takeExitCode | ||
:: (([Sort] -> Symbol) -> LogicT simplifier ExitCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra LogicT
here:
:: (([Sort] -> Symbol) -> LogicT simplifier ExitCode) | |
:: (([Sort] -> Symbol) -> simplifier ExitCode) |
kore/src/Kore/Exec.hs
Outdated
Just mkGetExitCodeSymbol -> | ||
Logic.runLogicT | ||
(act mkGetExitCodeSymbol) | ||
(\a _ -> pure a) | ||
(pure $ ExitFailure 111) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this function is simply
takeExitCode act =
resolve "LblgetExitCode"
& maybe (pure ExitSuccess) act
Fixes #2205
Reviewer checklist
stack test --coverage
stack haddock