Skip to content

Commit 4f00fda

Browse files
emarziongithub-actions
andauthored
Profiles rewrite (#2690)
* Rewriting some logging-related functions * Format with fourmolu * removing comment Co-authored-by: github-actions <github-actions@github.com>
1 parent 8585c19 commit 4f00fda

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

kore/src/Kore/Log/InfoReachability.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Kore.Log.InfoReachability (
88
) where
99

1010
import Kore.Reachability.Prim
11-
import Log
11+
import qualified Log
1212
import Prelude.Kore
1313
import Pretty (
1414
Doc,
@@ -24,8 +24,8 @@ instance Pretty InfoReachability where
2424
pretty InfoReachability{prim} =
2525
(Pretty.hsep . catMaybes) [primDoc prim]
2626

27-
instance Entry InfoReachability where
28-
entrySeverity _ = Info
27+
instance Log.Entry InfoReachability where
28+
entrySeverity _ = Log.Info
2929
contextDoc InfoReachability{prim} = (<+>) "while" <$> primDoc prim
3030
helpDoc _ = "log reachability proof steps"
3131

@@ -37,10 +37,10 @@ primDoc ApplyAxioms = Just "applying axioms"
3737
primDoc _ = Nothing
3838

3939
whileReachability ::
40-
MonadLog log =>
40+
Log.MonadLog log =>
4141
Prim ->
4242
log a ->
4343
log a
44-
whileReachability prim
45-
| Just _ <- primDoc prim = logWhile InfoReachability{prim}
46-
| otherwise = id
44+
whileReachability prim log
45+
| Just _ <- primDoc prim = Log.logWhile InfoReachability{prim} log
46+
| otherwise = log

kore/src/Kore/Reachability/Prove.hs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -575,34 +575,35 @@ withDebugClaimState ::
575575
MonadLog monad =>
576576
CommonTransitionRule monad ->
577577
CommonTransitionRule monad
578-
withDebugClaimState transitionFunc =
579-
\transition state ->
580-
Transition.orElse
581-
( debugClaimStateBracket
582-
state
583-
transition
584-
(transitionFunc transition state)
585-
)
586-
( debugClaimStateFinal
587-
state
588-
transition
589-
)
578+
withDebugClaimState transitionFunc transition state =
579+
Transition.orElse
580+
( debugClaimStateBracket
581+
state
582+
transition
583+
(transitionFunc transition state)
584+
)
585+
( debugClaimStateFinal
586+
state
587+
transition
588+
)
590589

591590
withDebugProven ::
592591
forall monad.
593592
MonadLog monad =>
594593
CommonTransitionRule monad ->
595594
CommonTransitionRule monad
596595
withDebugProven rule prim state =
597-
rule prim state >>= debugProven
598-
where
599-
debugProven state'
600-
| ClaimState.Proven <- state'
601-
, Just claim <- extractUnproven state =
602-
do
603-
Log.logEntry DebugProven{claim}
604-
pure state'
605-
| otherwise = pure state'
596+
do
597+
state' <- rule prim state
598+
case state' of
599+
ClaimState.Proven ->
600+
case extractUnproven state of
601+
Just claim ->
602+
do
603+
Log.logEntry DebugProven{claim}
604+
pure state'
605+
_ -> pure state'
606+
_ -> pure state'
606607

607608
withConfiguration ::
608609
MonadCatch monad =>

0 commit comments

Comments
 (0)