aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stm/lemmas.ml4
-rw-r--r--stm/lemmas.mli2
-rw-r--r--toplevel/obligations.ml15
3 files changed, 13 insertions, 8 deletions
diff --git a/stm/lemmas.ml b/stm/lemmas.ml
index 5d2babaca9..fbe17b8f8b 100644
--- a/stm/lemmas.ml
+++ b/stm/lemmas.ml
@@ -336,11 +336,11 @@ let standard_proof_terminator compute_guard hook =
let universe_proof_terminator compute_guard hook =
let open Proof_global in function
| Admitted ->
- admit (hook Evd.empty_evar_universe_context) ();
+ admit (hook None) ();
Pp.feedback Feedback.AddedAxiom
| Proved (is_opaque,idopt,proof) ->
let proof = get_proof proof compute_guard
- (hook proof.Proof_global.universes) is_opaque in
+ (hook (Some proof.Proof_global.universes)) is_opaque in
begin match idopt with
| None -> save_named proof
| Some ((_,id),None) -> save_anonymous proof id
diff --git a/stm/lemmas.mli b/stm/lemmas.mli
index d5a4c709e8..b77413bc9f 100644
--- a/stm/lemmas.mli
+++ b/stm/lemmas.mli
@@ -31,7 +31,7 @@ val start_proof : Id.t -> goal_kind -> Evd.evar_universe_context -> ?sign:Enviro
val start_proof_univs : Id.t -> goal_kind -> Evd.evar_universe_context -> ?sign:Environ.named_context_val -> types ->
?init_tac:unit Proofview.tactic -> ?compute_guard:lemma_possible_guards ->
- (Proof_global.proof_universes -> unit declaration_hook) -> unit
+ (Proof_global.proof_universes option -> unit declaration_hook) -> unit
val start_proof_com : goal_kind ->
(lident option * (local_binder list * constr_expr * (lident option * recursion_order_expr) option)) list ->
diff --git a/toplevel/obligations.ml b/toplevel/obligations.ml
index 8f637aa325..13f9e9339d 100644
--- a/toplevel/obligations.ml
+++ b/toplevel/obligations.ml
@@ -834,11 +834,16 @@ let rec solve_obligation prg num tac =
let obls = Array.copy obls in
let _ = obls.(num) <- obl in
let ctx' =
- if not (pi2 prg.prg_kind) (* Not polymorphic *) then
- (* This context is already declared globally, we cannot
- instantiate the rigid variables anymore *)
- Evd.abstract_undefined_variables ctx'
- else ctx'
+ let ctx =
+ match ctx' with
+ | None -> prg.prg_ctx
+ | Some ctx' -> ctx'
+ in
+ if not (pi2 prg.prg_kind) (* Not polymorphic *) then
+ (* This context is already declared globally, we cannot
+ instantiate the rigid variables anymore *)
+ Evd.abstract_undefined_variables ctx
+ else ctx
in
let res =
try update_obls