From 17a2ba8d59c9b459bb67a09cb0374ca9a1eea634 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 11 May 2018 10:19:35 +0200 Subject: [STM] Nested Proofs Allowed has to be executed immediately since it affects scheduling (actually the error the option lets one silence) --- stm/stm.ml | 2 +- stm/vernac_classifier.ml | 9 ++++++++- stm/vernac_classifier.mli | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'stm') diff --git a/stm/stm.ml b/stm/stm.ml index 9192c1410..20409c25e 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -2768,7 +2768,7 @@ let allow_nested_proofs = ref false let _ = Goptions.declare_bool_option { Goptions.optdepr = false; Goptions.optname = "Nested Proofs Allowed"; - Goptions.optkey = ["Nested";"Proofs";"Allowed"]; + Goptions.optkey = Vernac_classifier.stm_allow_nested_proofs_option_name; Goptions.optread = (fun () -> !allow_nested_proofs); Goptions.optwrite = (fun b -> allow_nested_proofs := b) } diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml index c08cc6e36..e01dcbcb6 100644 --- a/stm/vernac_classifier.ml +++ b/stm/vernac_classifier.ml @@ -54,13 +54,20 @@ let idents_of_name : Names.Name.t -> Names.Id.t list = | Names.Anonymous -> [] | Names.Name n -> [n] +let stm_allow_nested_proofs_option_name = ["Nested";"Proofs";"Allowed"] + +let options_affecting_stm_scheduling = + [ Vernacentries.universe_polymorphism_option_name; + stm_allow_nested_proofs_option_name ] + let classify_vernac e = let static_classifier ~poly e = match e with (* Univ poly compatibility: we run it now, so that we can just * look at Flags in stm.ml. Would be nicer to have the stm * look at the entire dag to detect this option. *) | ( VernacSetOption (_, l,_) | VernacUnsetOption (_, l)) - when CList.equal String.equal l Vernacentries.universe_polymorphism_option_name -> + when CList.exists (CList.equal String.equal l) + options_affecting_stm_scheduling -> VtSideff [], VtNow (* Qed *) | VernacAbort _ -> VtQed VtDrop, VtLater diff --git a/stm/vernac_classifier.mli b/stm/vernac_classifier.mli index abbc04e89..45fbfb42a 100644 --- a/stm/vernac_classifier.mli +++ b/stm/vernac_classifier.mli @@ -25,3 +25,4 @@ val classify_as_query : vernac_classification val classify_as_sideeff : vernac_classification val classify_as_proofstep : vernac_classification +val stm_allow_nested_proofs_option_name : string list -- cgit v1.2.3