Skip to content

Commit

Permalink
Fast path in the Tacticals.check_evars function.
Browse files Browse the repository at this point in the history
We only care about the difference between undefined evars, so whenever the
new evarmap has physically the same undefined evars as the original one, we return
immediately.

This seriously alleviates the slowdowns introduced in coq#17564.
  • Loading branch information
ppedrot committed May 10, 2023
1 parent 505c3cf commit 369077b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tactics/tacticals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ let tclPROGRESS t =
(* Check that holes in arguments have been resolved *)

let check_evars env sigma extsigma origsigma =
(* origsigma ⊆ extsigma ⊆ sigma *)
let reachable = lazy (Evarutil.reachable_from_evars sigma
(Evar.Map.domain (Evd.undefined_map origsigma))) in
let rec is_undefined_up_to_restriction sigma evk =
Expand All @@ -393,6 +394,8 @@ let check_evars env sigma extsigma origsigma =
evar remaining after typing from the initial term given to
apply/elim and co tactics, is it correct? *)
None in
if Evd.undefined_map extsigma == Evd.undefined_map origsigma then ()
else
let rest =
Evd.fold_undefined (fun evk evi acc ->
match is_undefined_up_to_restriction sigma evk with
Expand Down

0 comments on commit 369077b

Please sign in to comment.