aboutsummaryrefslogtreecommitdiff
path: root/engine/uState.ml
diff options
context:
space:
mode:
authorThéo Zimmermann2020-04-01 16:54:37 +0200
committerThéo Zimmermann2020-04-06 15:30:08 +0200
commit5c5fbf68034fdd18ddfcd19c9c8b1438af6b5c92 (patch)
tree32313fbf73082cff3da3832b0ff709c192ec28b7 /engine/uState.ml
parent2089207415565e8a28816f53b61d9292d04f4c59 (diff)
Clean and fix definitions of options.
- Provide new helper functions in `Goptions` on the model of `declare_bool_option_and_ref`; - Use these helper functions in many parts of the code base (encapsulates the corresponding references); - Move almost all options from `declare_string_option` to `declare_stringopt_option` (only "Warnings" continue to use the former). This means that these options now support `Unset` to get back to the default setting. Note that there is a naming misalignment since `declare_int_option` is similar to `declare_stringopt_option` and supports `Unset`. When "Warning" is eventually migrated to support `Unset` as well, we can remove `declare_string_option` and rename `declare_stringopt_option` to `declare_string_option`. - For some vernac options and flags that have an equivalent command-line option or flag, implement it like the standard `-set` and `-unset`.
Diffstat (limited to 'engine/uState.ml')
-rw-r--r--engine/uState.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/engine/uState.ml b/engine/uState.ml
index d532129dc5..ff85f09efa 100644
--- a/engine/uState.ml
+++ b/engine/uState.ml
@@ -176,8 +176,11 @@ let instantiate_variable l b v =
exception UniversesDiffer
-let drop_weak_constraints = ref false
-
+let drop_weak_constraints =
+ Goptions.declare_bool_option_and_ref
+ ~depr:false
+ ~key:["Cumulativity";"Weak";"Constraints"]
+ ~value:false
let process_universe_constraints ctx cstrs =
let open UnivSubst in
@@ -270,7 +273,7 @@ let process_universe_constraints ctx cstrs =
| ULub (l, r) ->
equalize_variables true (Universe.make l) l (Universe.make r) r local
| UWeak (l, r) ->
- if not !drop_weak_constraints then weak := UPairSet.add (l,r) !weak; local
+ if not (drop_weak_constraints ()) then weak := UPairSet.add (l,r) !weak; local
| UEq (l, r) -> equalize_universes l r local
in
let local =