Repository navigation
feat(simplify): hint simplify disable / enable, local rule switches - #1214
Merged
Merged
Conversation
hint simplify disable L1, L2.
hint simplify enable L1, L2.
hint simplify in db : disable L.
switch the user-reduction rules compiled from the lemmas `L1`, `L2`
(in the default database, or in `db`) off, and back on, for the rest
of the enclosing theory / section of the current file. Every
simplification path is affected: `simplify`, `/=`, `//`, `done`,
`trivial`, `auto`, rewriting and conversion. An explicit per-call
(`simplify hint {L}`) or proof-local (`hint {L}`) addition still
fires, as it does not go through the database. Disabling a lemma that
has no rule in the database, or enabling one that is not disabled, is
an error.
The switches are independent from `hint simplify L`, which feeds the
database: adding a disabled lemma again does not switch it back on,
only `enable` does. And they are deliberately not theory items: they
are never exported to the files requiring this one -- a file able to
switch off rules in its clients would be a nightmare -- and they end
with the enclosing theory or section, whose environment is dropped
when it is closed. The implementation is a per-database mask of lemma
paths in the environment, applied when the rules of a head symbol are
fetched.
The motivating case is Jasmin's eclib `hint simplify powS_minus@1`,
which makes every simplification unroll `2^1024` again and again in
the files that use it; those files can now switch it off for
themselves.
`print hint simplify` reflects the switches and drops the heads left
without rules.
strub
force-pushed
the
feat/simplify-disable-enable
branch
from
October 23, 2026 09:31
c5f37aa to
8af07d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
switch the user-reduction rules compiled from the lemmas
L1,L2(in the default database, or in
db) off, and back on, for the restof the enclosing theory / section of the current file. Every
simplification path is affected:
simplify,/=,//,done,trivial,auto, rewriting and conversion. An explicit per-call(
simplify hint {L}) or proof-local (hint {L}) addition stillfires, as it does not go through the database. Disabling a lemma that
has no rule in the database, or enabling one that is not disabled, is
an error.
The switches are independent from
hint simplify L, which feeds thedatabase: adding a disabled lemma again does not switch it back on,
only
enabledoes. And they are deliberately not theory items: theyare never exported to the files requiring this one -- a file able to
switch off rules in its clients would be a nightmare -- and they end
with the enclosing theory or section, whose environment is dropped
when it is closed. The implementation is a per-database mask of lemma
paths in the environment, applied when the rules of a head symbol are
fetched.
The motivating case is Jasmin's eclib
hint simplify powS_minus@1,which makes every simplification unroll
2^1024again and again inthe files that use it; those files can now switch it off for
themselves.
print hint simplifyreflects the switches and drops the heads leftwithout rules.