Skip to content

Commit

Permalink
[STM] Nested Proofs Allowed has to be executed immediately
Browse files Browse the repository at this point in the history
since it affects scheduling (actually the error the option lets one
silence)
  • Loading branch information
gares authored and Zimmi48 committed May 17, 2018
1 parent 1ffa181 commit 17a2ba8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stm/stm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down
9 changes: 8 additions & 1 deletion stm/vernac_classifier.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stm/vernac_classifier.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 17a2ba8

Please sign in to comment.