Skip to content

Conversation

@jberthold
Copy link
Member

The previous fix #4133 checked isEvaluated on the term in a sort predicate before applying rules. This is correct but leads to too many fall-backs which slow down symbolic execution when sort predicates are used in rewrite side conditions. The only case that matters is when an unevaluated function is at the head of the term in the sort predicate. This is now matched directly.

The previous fix checked `isEvaluated` on the term in a sort predicate
before applying rules. This is correct but leads to too many
fall-backs which slow down symbolic execution when sort predicates are
used in rewrite side conditions. The only case that matters is when an
_unevaluated function_ is at the _head_ of the term in the sort
predicate. This is now matched directly.
@jberthold jberthold force-pushed the HOTFIX-only-check-term-top-level-for-sort-predicates branch from 400b523 to b14ad6b Compare December 18, 2025 07:29
Comment on lines -882 to +889
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
)
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

@jberthold
Copy link
Member Author

Seems to be working now, and no negative impact on KEVM proofs.

Test HOTFIX-only-check-term-top-level-for-sort-predicates time master-b88b8b65f time (HOTFIX-only-check-term-top-level-for-sort-predicates/master-b88b8b65f) time
mcd/flapper-yank-pass-rough-spec.k 172.68 215.92 0.799740644683216
mcd/flopper-dent-guy-diff-tic-not-0-pass-rough-spec.k 737.82 888.83 0.8301024942902467
mcd/pot-join-pass-rough-spec.k 204.98 245.6 0.8346091205211726
mcd/end-pack-pass-rough-spec.k 135.34 156.17 0.8666197092911572
mcd/end-cash-pass-rough-spec.k 199.86 229.44 0.8710774058577406
mcd-structured/pot-join-pass-rough-spec.k 157.04 151.22 1.0384869726226689
mcd/flopper-cage-pass-spec.k 56.17 53.34 1.0530558680164979
TOTAL 1663.89 1940.52 0.8574454269989488

@jberthold jberthold merged commit aa2aeb9 into master Dec 18, 2025
6 checks passed
@jberthold jberthold deleted the HOTFIX-only-check-term-top-level-for-sort-predicates branch December 18, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants