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 22271dd02c..b7014c542e 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 e7be665527..804f1543d0 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 From a7946816d96cb66aa7d62302e8aa602a3a9f3c99 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Tue, 27 Feb 2018 06:09:21 +0100 Subject: Export Proofview.undefined as "unsafe" primitive. --- engine/proofview.ml | 2 ++ engine/proofview.mli | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'engine') diff --git a/engine/proofview.ml b/engine/proofview.ml index b7014c542e..639f48e77c 100644 --- a/engine/proofview.ml +++ b/engine/proofview.ml @@ -1041,6 +1041,8 @@ module Unsafe = struct let advance = Evarutil.advance + let undefined = undefined + let mark_as_unresolvable p gl = { p with solution = mark_in_evm ~goal:false p.solution gl } diff --git a/engine/proofview.mli b/engine/proofview.mli index 804f1543d0..1905686fe7 100644 --- a/engine/proofview.mli +++ b/engine/proofview.mli @@ -469,6 +469,12 @@ module Unsafe : sig solved. *) val advance : Evd.evar_map -> Evar.t -> Evar.t option + (** [undefined sigma l] applies [advance] to the goals of [l], then + returns the subset of resulting goals which have not yet been + defined *) + val undefined : Evd.evar_map -> Proofview_monad.goal_with_state list -> + Proofview_monad.goal_with_state list + val typeclass_resolvable : unit Evd.Store.field end -- cgit v1.2.3