Debian Codegraph @

lib/flags.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (** Global options of the system. *)
12
13 (** WARNING: don't add new entries to this file!
14
15 This file is own its way to deprecation in favor of a purely
16 functional state, but meanwhile it will contain options that are
17 truly global to the system such as [debug]
18
19 If you are thinking about adding a global flag, well, just
20 don't. First of all, options make testins exponentially more
21 expensive, due to the growth of flag combinations. So please make
22 some effort in order for your idea to work in a configuration-free
23 manner.
24
25 If you absolutely must pass an option to your new system, then do
26 so as a functional argument so flags are exposed to unit
27 testing. Then, register such parameters with the proper
28 state-handling mechanism of the top-level subsystem of Rocq.
29
30 *)
31
32 (** Command-line flags *)
33
34 (** Async-related flags *)
35 val async_proofs_worker_id : string ref
36 val async_proofs_is_worker : unit -> bool
37
38 (** Debug flags *)
39 val in_debugger : bool ref
40 val in_ml_toplevel : bool ref
41
42 (* Used to check stages are used correctly. *)
43 val in_synterp_phase : bool option ref
44
45 (* Beautify command line flags, should move to printing? *)
46 val beautify : bool ref
47 val beautify_file : bool ref
48
49 (* Rocq quiet mode. Note that normal mode is called "verbose" here,
50 whereas [quiet] suppresses normal output such as goals in rocq repl *)
51 val quiet : bool ref
52 val silently : ('a -> 'b) -> 'a -> 'b
53 val verbosely : ('a -> 'b) -> 'a -> 'b
54 val if_silent : ('a -> unit) -> 'a -> unit
55 val if_verbose : ('a -> unit) -> 'a -> unit
56
57 (** [with_modified_ref r nf f x] Temporarily modify a reference in the
58 call to [f x] . Be very careful with these functions, it is very
59 easy to fall in the typical problem with effects:
60
61 with_modified_ref r nf f x y != with_modified_ref r nf (f x) y
62
63 *)
64 val with_modified_ref : 'c ref -> ('c -> 'c) -> ('a -> 'b) -> 'a -> 'b
65
66 (** Temporarily activate an option (to activate option [o] on [f x y z],
67 use [with_option o (f x y) z]) *)
68 val with_option : bool ref -> ('a -> 'b) -> 'a -> 'b
69
70 (** As [with_option], but on several flags. *)
71 val with_options : bool ref list -> ('a -> 'b) -> 'a -> 'b
72
73 (** Temporarily deactivate an option *)
74 val without_option : bool ref -> ('a -> 'b) -> 'a -> 'b
75
76 (** Flag set when the test-suite is called.
77 - display verbose information for [Fail]
78 - print quickfix info in error printers *)
79 val test_mode : bool ref