Skip to content

Commit d321576

Browse files
committed
Emit a rewrite trace when pruning a branch to a single next state
1 parent 34d6955 commit d321576

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

booster/tools/booster/Proxy.hs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,24 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
632632
}
633633
| length filteredNexts == 1 ->
634634
-- all but one next states are bottom, execution should proceed
635-
Left (execStateToKoreJson $ head filteredNexts, logsOnly <> filteredNextLogs)
635+
-- Note that we've effectively made a rewrite step here, so we need to
636+
-- extract the rule-id information from the result we proceed with
637+
let onlyNext = head filteredNexts
638+
rewriteRuleId = fromMaybe "UNKNOWN" onlyNext.ruleId
639+
proxyRewriteStepLog =
640+
RPCLog.Rewrite
641+
{ result =
642+
RPCLog.Success
643+
{ rewrittenTerm = Nothing
644+
, substitution = Nothing
645+
, ruleId = rewriteRuleId
646+
}
647+
, origin = RPCLog.Proxy
648+
}
649+
in Left
650+
( execStateToKoreJson onlyNext
651+
, logsOnly <> filteredNextLogs <> [Just [proxyRewriteStepLog]]
652+
)
636653
-- otherwise falling through to _otherReason
637654
CutPointRule
638655
| null filteredNexts ->

0 commit comments

Comments
 (0)