aboutsummaryrefslogtreecommitdiffhomepage
path: root/proofs/proof.ml
diff options
context:
space:
mode:
authorGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-12-12 09:28:23 +0100
committerGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-12-12 19:21:56 +0100
commita5ccde6f22deb1a1a2d59d3b532f74c217a05aee (patch)
tree61ec37224340213b6be70024ea55b80f5d4b6d68 /proofs/proof.ml
parented89c1ee0d24d0e4356e77561bab4822125db057 (diff)
Make sure the goals on the shelve are identified as goal and unresolvable for typeclasses.
This was not the case for goals created at the end of the tactic by salvaging the [future_goals] from the evar map. It would cause typeclass resolution to try and solve these goals (if they have a class type) at each subsequent tactic. Fixes #3841.
Diffstat (limited to 'proofs/proof.ml')
-rw-r--r--proofs/proof.ml22
1 files changed, 15 insertions, 7 deletions
diff --git a/proofs/proof.ml b/proofs/proof.ml
index 8dc9184b8..ca98af977 100644
--- a/proofs/proof.ml
+++ b/proofs/proof.ml
@@ -322,15 +322,23 @@ let compact p =
let run_tactic env tac pr =
let sp = pr.proofview in
- let (_,tacticced_proofview,(status,to_shelve,give_up),info_trace) = Proofview.apply env tac sp in
- let shelf =
- let sigma = Proofview.return tacticced_proofview in
- let pre_shelf = pr.shelf@(List.rev (Evd.future_goals sigma))@to_shelve in
- (* avoid already to count already solved goals as shelved. *)
- List.filter (fun g -> Evd.is_undefined sigma g) pre_shelf
+ let (_,tacticced_proofview,(status,to_shelve,give_up),info_trace) =
+ Proofview.apply env tac sp
+ in
+ let sigma = Proofview.return tacticced_proofview in
+ (* Already solved goals are not to be counted as shelved. Nor are
+ they to be marked as unresolvable. *)
+ let undef l = List.filter (fun g -> Evd.is_undefined sigma g) l in
+ let retrieved = undef (List.rev (Evd.future_goals sigma)) in
+ let shelf = (undef pr.shelf)@retrieved@(undef to_shelve) in
+ let proofview =
+ List.fold_left
+ Proofview.Unsafe.mark_as_goal
+ tacticced_proofview
+ retrieved
in
let given_up = pr.given_up@give_up in
- let proofview = Proofview.Unsafe.reset_future_goals tacticced_proofview in
+ let proofview = Proofview.Unsafe.reset_future_goals proofview in
{ pr with proofview ; shelf ; given_up },(status,info_trace)
(*** Commands ***)