Skip to content

fix(simplify): honour the proof-local head filter on every path - #1213

Merged
strub merged 1 commit into
mainfrom
fix/simplify-head-filter
Oct 23, 2026
Merged

strub merged 1 commit into
mainfrom
fix/simplify-head-filter

Conversation

@strub

@strub strub commented Oct 23, 2026

Copy link
Copy Markdown
Member

The proof-local default head filter set by hint -[f] / hint +[f]
was only read by the explicit simplify / cbv tactics. Every other
simplification path -- /=, //, done, progress, trivial,
auto, and the conversion checks behind apply / exact / rewrite
-- threaded the proof-local context (user_local) but never its head
filter, so a rule the proof had excluded kept firing there:

hint simplify fE.
lemma t : f 0 = 1.
proof. hint -[f]. rewrite /=. (* rewrote `f 0` anyway *)

Resolve the default filter in EcReduction.reduce_user_gen instead:
an explicit use-site filter wins, otherwise the proof-local default of
ri.user_local applies. Every path that threads user_local now
honours it, and the front-ends need no special casing.

Also thread the proof-local context into the remaining bare full_red
reductions of the goal layer, so that they see locally added rules and
the filter as well: t_lazy_match, t_intros_x, t_elim_r, the
rewrite-pattern search of LowRewrite, and process_delta.

Not covered: the name computation of intro patterns and the generic
destruct_product of EcProofTyping, which have no goal at hand.

The proof-local default head filter set by `hint -[f]` / `hint +[f]`
was only read by the explicit `simplify` / `cbv` tactics. Every other
simplification path -- `/=`, `//`, `done`, `progress`, `trivial`,
`auto`, and the conversion checks behind `apply` / `exact` / `rewrite`
-- threaded the proof-local context (`user_local`) but never its head
filter, so a rule the proof had excluded kept firing there:

    hint simplify fE.
    lemma t : f 0 = 1.
    proof. hint -[f]. rewrite /=. (* rewrote `f 0` anyway *)

Resolve the default filter in `EcReduction.reduce_user_gen` instead:
an explicit use-site filter wins, otherwise the proof-local default of
`ri.user_local` applies. Every path that threads `user_local` now
honours it, and the front-ends need no special casing.

Also thread the proof-local context into the remaining bare `full_red`
reductions of the goal layer, so that they see locally added rules and
the filter as well: `t_lazy_match`, `t_intros_x`, `t_elim_r`, the
rewrite-pattern search of `LowRewrite`, and `process_delta`.

Not covered: the name computation of intro patterns and the generic
`destruct_product` of `EcProofTyping`, which have no goal at hand.
@strub strub self-assigned this Oct 23, 2026
@strub strub added the yolo-pr Don't bother reviewing, I will merge label Oct 23, 2026
@strub
strub merged commit d1e7c10 into main Oct 23, 2026
20 checks passed
@strub
strub deleted the fix/simplify-head-filter branch October 23, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

yolo-pr Don't bother reviewing, I will merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant