From 3e2887bbcba6846ce3a18898fcfebe48632b72b9 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 26 Feb 2018 18:31:32 +0100 Subject: Adding informative variant of shelve_unifiable returning set of shelved evars. --- engine/proofview.ml | 10 ++++++++-- engine/proofview.mli | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/proofview.ml b/engine/proofview.ml index 22271dd02..b7014c542 100644 --- a/engine/proofview.ml +++ b/engine/proofview.ml @@ -710,13 +710,19 @@ let partition_unifiable sigma l = (** Shelves the unifiable goals under focus, i.e. the goals which appear in other goals under focus (the unfocused goals are not considered). *) -let shelve_unifiable = +let shelve_unifiable_informative = let open Proof in Pv.get >>= fun initial -> let (u,n) = partition_unifiable initial.solution initial.comb in Comb.set n >> InfoL.leaf (Info.Tactic (fun () -> Pp.str"shelve_unifiable")) >> - Shelf.modify (fun gls -> gls @ CList.map drop_state u) + let u = CList.map drop_state u in + Shelf.modify (fun gls -> gls @ u) >> + tclUNIT u + +let shelve_unifiable = + let open Proof in + shelve_unifiable_informative >>= fun _ -> tclUNIT () (** [guard_no_unifiable] returns the list of unifiable goals if some goals are unifiable (see {!shelve_unifiable}) in the current focus. *) diff --git a/engine/proofview.mli b/engine/proofview.mli index e7be66552..804f1543d 100644 --- a/engine/proofview.mli +++ b/engine/proofview.mli @@ -326,6 +326,9 @@ val unifiable : Evd.evar_map -> Evar.t -> Evar.t list -> bool considered). *) val shelve_unifiable : unit tactic +(** Idem but also returns the list of shelved variables *) +val shelve_unifiable_informative : Evar.t list tactic + (** [guard_no_unifiable] returns the list of unifiable goals if some goals are unifiable (see {!shelve_unifiable}) in the current focus. *) val guard_no_unifiable : Names.Name.t list option tactic -- cgit v1.2.3