From b6dabf6aa5b96cfa3c11038316399f0797d734ac Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Tue, 25 Apr 2017 21:54:31 +0200 Subject: Refine test for unresolved evars: not reachable from initial evars The test is refined to handle aliases: i.e. undefined evars coming from restrictions and evar-evar unifications with an initial evar are not considered fresh unresolved evars. To check this, we generalize the restricted_evars set to an aliased_evars set in the evar map, registering evars being solved by another evar due to restriction or evar-evar unifications. This implements the proposal of PR #370 for testing the resolution status of evars independently of the evar-evar orientation order. This allows [apply] to refine an evar with a new one if it results from a [clear] request or an evar-evar solution only, otherwise the new evar is considered fresh and an error is raised. Also fixes bugs #4095 and #4413. Co-authored-by: Maxime Dénès --- proofs/refine.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'proofs') diff --git a/proofs/refine.ml b/proofs/refine.ml index dcff5e2b6c..ac410a958f 100644 --- a/proofs/refine.ml +++ b/proofs/refine.ml @@ -75,6 +75,8 @@ let generic_refine ~typecheck f gl = let future_goals, sigma = Evd.pop_future_goals sigma in (* Select the goals *) let future_goals = Evd.FutureGoals.map_filter (Proofview.Unsafe.advance sigma) future_goals in + let shelf = Evd.shelf sigma in + let future_goals = Evd.FutureGoals.filter (fun ev -> not @@ List.mem ev shelf) future_goals in (* Proceed to the refinement *) let sigma = match Proofview.Unsafe.advance sigma self with | None -> -- cgit v1.2.3