Skip to content

Commit

Permalink
Add -l EquationWarnings and warning context in Booster (#3937)
Browse files Browse the repository at this point in the history
Fixes #3927

This PR disables the display of the three equation-related warning in
Booster by default. They can be re-enabled by the flag `-l
EquationWarnings`, which is a shorthand to the context expression
`--log-context booster>(simplification *|function *)>warning`.

---------

Co-authored-by: rv-jenkins <admin@runtimeverification.com>
  • Loading branch information
geo2a and rv-jenkins authored Jun 13, 2024
1 parent e8a623f commit 50f4a48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions booster/library/Booster/CLOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ allowedLogLevels =
, ("Depth", "Log the current depth of the state")
, ("SMT", "Log the SMT-solver interactions")
, ("ErrorDetails", "Log error conditions with extensive details")
,
( "EquationWarnings"
, "Log warnings indicating soft-violations of conditions, i.e. exceeding the equation recursion/iteration limit "
)
]

levelToContext :: Map Text [ContextFilter]
Expand Down Expand Up @@ -279,6 +283,12 @@ levelToContext =
, [ctxt| booster>failure,abort |]
]
)
,
( "EquationWarnings"
,
[ [ctxt| booster>(simplification *|function *)>warning |]
]
)
]

-- Partition provided log levels into standard and custom ones, and
Expand Down
4 changes: 2 additions & 2 deletions booster/library/Booster/Pattern/ApplyEquations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ fromCache tag t = eqState $ Map.lookup t <$> gets (select tag . (.cache))

logWarn :: LoggerMIO m => Text -> m ()
logWarn msg =
logMessage' $
msg <> " For more details, enable full context logging '--log-context \"*\"'"
withContext "warning" $
logMessage msg

checkForLoop :: LoggerMIO io => Term -> EquationT io ()
checkForLoop t = do
Expand Down

0 comments on commit 50f4a48

Please sign in to comment.