Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions booster/library/Booster/Pattern/ApplyEquations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -873,18 +873,20 @@ applyEquation ::
EquationT
io
(Either ((EquationT io () -> EquationT io ()) -> EquationT io (), ApplyEquationFailure) Term)
applyEquation (FunctionApplication _sym [] [Term term _]) rule
applyEquation (FunctionApplication _sym [] [term]) rule
| isSortPredicate rule
, not term.isEvaluated =
, FunctionApplication _ _ _ <- term =
-- sort predicates only match on a sort injection, unevaluated
-- function applications may create false negatives
getPrettyModifiers >>= \case
ModifiersRep (_ :: FromModifiersT mods => Proxy mods) -> do
pure $
Left
( \ctxt -> ctxt $ logWarn "Refusing to apply sort predicate rule to an unevaluated term"
, IndeterminateMatch
)
pure $
Left
( \ctxt ->
ctxt $
withTermContext term $
withContext CtxWarn $
logMessage ("Refusing to apply sort predicate rule to an unevaluated term" :: Text)
, IndeterminateMatch
)
Comment on lines -882 to +889
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also modified the logging to include the term with function head, for easier debugging

applyEquation term rule =
runExceptT $
getPrettyModifiers >>= \case
Expand Down
Loading
Loading