Debian Codegraph @

sysinit/coqargs.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 type native_compiler = Coq_config.native_compiler =
12 NativeOff | NativeOn of { ondemand : bool }
13
14 type top = TopLogical of string | TopPhysical of string
15
16 type option_command =
17 | OptionSet of string option
18 | OptionUnset
19
20 type export_flag = Export | Import
21
22 type require_injection = { lib: string; prefix: string option; export: export_flag option; allow_failure: bool }
23 (** Parameters follow [Library], that is to say, [lib,prefix,export]
24 means require library [lib] from optional [prefix] and import or
25 export if [export] is [Some Lib.Import]/[Some Lib.Export]. *)
26
27 type injection_command =
28 | OptionInjection of (string list * option_command)
29 (** Set flags or options before the initial state is ready. *)
30 | RequireInjection of require_injection
31 (** Require libraries before the initial state is
32 ready. *)
33 | WarnNoNative of string
34 (** Used so that "-w -native-compiler-disabled -native-compiler yes"
35 does not cause a warning. The native option must be processed
36 before injections (because it affects require), so the
37 instruction to emit a message is separated. *)
38 | WarnNativeDeprecated
39 (** Used so that "-w -native-compiler-deprecated-option -native-compiler FLAG"
40 does not cause a warning, similarly to above. *)
41
42 type coqargs_logic_config = {
43 impredicative_set : bool;
44 indices_matter : bool;
45 type_in_type : bool;
46 rewrite_rules : bool;
47 toplevel_name : top;
48 }
49
50 type time_config = ToFeedback | ToFile of string
51
52 type coqargs_config = {
53 logic : coqargs_logic_config;
54 rcfile : string option;
55 coqlib : string option;
56 enable_VM : bool;
57 native_compiler : native_compiler;
58 native_output_dir : CUnix.physical_path;
59 native_include_dirs : CUnix.physical_path list;
60 output_directory : CUnix.physical_path option;
61 exclude_dirs : CUnix.physical_path list;
62 beautify : bool;
63 quiet : bool;
64 time : time_config option;
65 test_mode : bool;
66 profile : string option;
67 print_emacs : bool;
68 }
69
70 type vo_path = {
71 implicit : bool; (** true if -R, otherwise -Q *)
72 unix_path : string;
73 rocq_path : string;
74 }
75
76 type coqargs_pre = {
77 boot : bool;
78 load_init : bool;
79 load_rcfile : bool;
80
81 ml_includes : CUnix.physical_path list;
82 vo_includes : vo_path list;
83
84 load_vernacular_list : (string * bool) list;
85 injections : injection_command list;
86 }
87
88 type coqargs_main =
89 | Queries of Boot.Usage.query list
90 | Run
91
92 type coqargs_post = {
93 memory_stat : bool;
94 }
95
96 type t = {
97 config : coqargs_config;
98 pre : coqargs_pre;
99 main : coqargs_main;
100 post : coqargs_post;
101 }
102
103 (* Default options *)
104 val default : t
105
106 val parse_args : init:t -> string list -> t * string list
107
108 val injection_commands : t -> injection_command list
109
110 (* Common utilities *)
111
112 val get_int : opt:string -> string -> int
113 val get_int_opt : opt:string -> string -> int option
114 val get_bool : opt:string -> string -> bool
115 val get_float : opt:string -> string -> float
116 val error_missing_arg : string -> 'a
117 val error_wrong_arg : string -> 'a