File tree 4 files changed +8
-3
lines changed
4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1303,6 +1303,8 @@ let given_up evd = evd.given_up
1303
1303
1304
1304
let shelf evd = List. flatten evd.shelf
1305
1305
1306
+ let mem_shelf e evd = List. exists (List. exists (fun e' -> Evar. equal e e')) evd.shelf
1307
+
1306
1308
let pr_shelf evd =
1307
1309
let open Pp in
1308
1310
if List. is_empty evd.shelf then str" (empty stack)"
Original file line number Diff line number Diff line change @@ -441,6 +441,10 @@ val unshelve : evar_map -> Evar.t list -> evar_map
441
441
val given_up : evar_map -> Evar.Set .t
442
442
443
443
val shelf : evar_map -> Evar .t list
444
+ (* * All evars in the shelf (not just the shallowest shelf) *)
445
+
446
+ val mem_shelf : Evar .t -> evar_map -> bool
447
+ (* * [true] if the evar is in the shelf (not necessarily in the shallowest shelf) *)
444
448
445
449
val pr_shelf : evar_map -> Pp .t
446
450
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ let focus_id cond inf id pr =
202
202
(* goal is already under focus *)
203
203
_focus cond inf i i pr
204
204
| None ->
205
- if CList. mem_f Evar. equal ev ( Evd. shelf evar_map) then
205
+ if Evd. mem_shelf ev evar_map then
206
206
(* goal is on the shelf, put it in focus *)
207
207
let proofview = Proofview. unshelve [ev] pr.proofview in
208
208
let pr = { pr with proofview } in
Original file line number Diff line number Diff line change @@ -75,8 +75,7 @@ let generic_refine ~typecheck f gl =
75
75
let future_goals, sigma = Evd. pop_future_goals sigma in
76
76
(* Select the goals *)
77
77
let future_goals = Evd.FutureGoals. map_filter (Proofview.Unsafe. advance sigma) future_goals in
78
- let shelf = Evd. shelf sigma in
79
- let future_goals = Evd.FutureGoals. filter (fun ev -> not @@ List. mem ev shelf) future_goals in
78
+ let future_goals = Evd.FutureGoals. filter (fun ev -> not @@ Evd. mem_shelf ev sigma) future_goals in
80
79
(* Proceed to the refinement *)
81
80
let sigma = match Proofview.Unsafe. advance sigma self with
82
81
| None ->
You can’t perform that action at this time.
0 commit comments