Skip to content

Commit

Permalink
cbn don't double reduce the head of applications
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Jan 10, 2025
1 parent 6e32b07 commit 6635ec6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tactics/cbn.ml
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,14 @@ let norm_cbn flags env sigma t =
| d -> d in
push_rel d env in
let rec strongrec env t =
map_constr_with_full_binders env sigma
push_rel_check_zeta strongrec env (whd_cbn flags env sigma t) in
let t = whd_cbn flags env sigma t in
(* don't recurse on the head, it's already reduced *)
match EConstr.kind sigma t with
| App (h,args) ->
let args' = Array.Smart.map (strongrec env) args in
if args == args' then t else mkApp (h, args')
| _ ->
map_constr_with_full_binders env sigma
push_rel_check_zeta strongrec env t
in
strongrec env t

0 comments on commit 6635ec6

Please sign in to comment.