Skip to content

Commit 13b4b9e

Browse files
committed
Refactor result printing messages
1 parent 8c943d3 commit 13b4b9e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

booster/tools/booster/Proxy.hs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
356356
| boosterResult.reason `elem` cfg.fallbackReasons -> do
357357
Booster.Log.withContext CtxProxy $
358358
Booster.Log.logMessage $
359-
Text.pack $
360-
"Booster " <> show boosterResult.reason <> " at " <> show boosterResult.depth
359+
"Booster " <> displayExecuteResultVerbose boosterResult
361360
-- simplify Booster's state with Kore's simplifier
362361
Booster.Log.withContext CtxProxy $
363362
Booster.Log.logMessage ("Simplifying booster state and falling back to Kore" :: Text)
@@ -494,8 +493,8 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
494493
-- we were successful with the booster, thus we
495494
-- return the booster result with the updated
496495
-- depth, in case we previously looped
497-
Booster.Log.withContext CtxProxy . Booster.Log.logMessage . Text.pack $
498-
"Booster " <> show boosterResult.reason <> " at " <> show boosterResult.depth
496+
Booster.Log.withContext CtxProxy . Booster.Log.logMessage $
497+
"Booster " <> displayExecuteResultVerbose boosterResult
499498
-- perform post-exec simplification
500499
postExecResult <-
501500
simplifyExecResult logSettings r._module def boosterResult
@@ -753,3 +752,13 @@ mkFallbackLogEntry boosterResult koreResult =
753752
getRewriteSuccessRuleId = \case
754753
RPCLog.Rewrite{result = RPCLog.Success{ruleId}} -> Just ruleId
755754
_ -> Nothing
755+
756+
displayExecuteResultVerbose :: ExecuteResult -> Text
757+
displayExecuteResultVerbose result =
758+
Text.pack $
759+
show result.reason
760+
<> " at "
761+
<> show result.depth
762+
<> " with "
763+
<> show (length <$> result.nextStates)
764+
<> " next states"

0 commit comments

Comments
 (0)