diff options
| author | Matthieu Sozeau | 2015-10-29 15:11:29 -0400 |
|---|---|---|
| committer | Matthieu Sozeau | 2015-10-29 15:18:16 -0400 |
| commit | a3a17b514a2ffaba54cd182fdf27b7e84366ab44 (patch) | |
| tree | 8d48786996f4a8217404fbd43f3fdc72f922592f /proofs | |
| parent | 78edfe09f34db4a28fb41a1f6fd3bb4922d09ec8 (diff) | |
Handle side-effects of Vernacular commands inside proofs better, so that
universes are declared correctly in the enclosing proofs evar_map's.
Diffstat (limited to 'proofs')
| -rw-r--r-- | proofs/proof_global.ml | 6 | ||||
| -rw-r--r-- | proofs/proof_global.mli | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index 809ed41c7e..c303f486c5 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -695,3 +695,9 @@ let copy_terminators ~src ~tgt = assert(List.length src = List.length tgt); List.map2 (fun op p -> { p with terminator = op.terminator }) src tgt +let update_global_env () = + with_current_proof (fun _ p -> + Proof.in_proof p (fun sigma -> + let tac = Proofview.Unsafe.tclEVARS (Evd.update_sigma_env sigma (Global.env ())) in + let (p,(status,info)) = Proof.run_tactic (Global.env ()) tac p in + (p, ()))) diff --git a/proofs/proof_global.mli b/proofs/proof_global.mli index f8615e8499..a22545080b 100644 --- a/proofs/proof_global.mli +++ b/proofs/proof_global.mli @@ -89,6 +89,11 @@ val start_dependent_proof : Names.Id.t -> Decl_kinds.goal_kind -> Proofview.telescope -> proof_terminator -> unit +(** Update the proofs global environment after a side-effecting command + (e.g. a sublemma definition) has been run inside it. Assumes + there_are_pending_proofs. *) +val update_global_env : unit -> unit + (* Takes a function to add to the exceptions data relative to the state in which the proof was built *) val close_proof : keep_body_ucst_separate:bool -> Future.fix_exn -> closed_proof |
