aboutsummaryrefslogtreecommitdiff
path: root/proofs/goal.ml
diff options
context:
space:
mode:
authorMaxime Dénès2020-06-11 13:11:21 +0200
committerMaxime Dénès2020-08-26 16:38:34 +0200
commit4e59a68fd6f2cd3cdf936c10cdbfeb46fc22ca95 (patch)
tree0bdb09f0eae78a88b855ebcff4da3e2a9b363800 /proofs/goal.ml
parent4e6b029805a74ea16166da2c5f59f9669fd34eb8 (diff)
Better encapsulation of future goals
We try to encapsulate the future goals abstraction in the evar map. A few calls to `save_future_goals` and `restore_future_goals` are still there, but we try to minimize them. This is a preliminary refactoring to make the invariants between the shelf and future goals more explicit, before giving unification access to the shelf, which is needed for #7825.
Diffstat (limited to 'proofs/goal.ml')
-rw-r--r--proofs/goal.ml14
1 files changed, 10 insertions, 4 deletions
diff --git a/proofs/goal.ml b/proofs/goal.ml
index 1c3aed8fc2..7aea07d6f0 100644
--- a/proofs/goal.ml
+++ b/proofs/goal.ml
@@ -56,12 +56,18 @@ module V82 = struct
be shelved. It must not appear as a future_goal, so the future
goals are restored to their initial value after the evar is
created. *)
- let prev_future_goals = Evd.save_future_goals evars in
let inst = EConstr.identity_subst_val hyps in
- let (evars, evk) =
- Evarutil.new_pure_evar ~src:(Loc.tag Evar_kinds.GoalEvar) ~typeclass_candidate:false ~identity:inst hyps evars concl
+ let evi = { Evd.evar_hyps = hyps;
+ Evd.evar_concl = concl;
+ Evd.evar_filter = Evd.Filter.identity;
+ Evd.evar_abstract_arguments = Evd.Abstraction.identity;
+ Evd.evar_body = Evd.Evar_empty;
+ Evd.evar_source = (Loc.tag Evar_kinds.GoalEvar);
+ Evd.evar_candidates = None;
+ Evd.evar_identity = Evd.Identity.make inst;
+ }
in
- let evars = Evd.restore_future_goals evars prev_future_goals in
+ let (evars, evk) = Evd.new_evar evars ~typeclass_candidate:false evi in
let ev = EConstr.mkEvar (evk,inst) in
(evk, ev, evars)