1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mathias Preiner, Aina Niemetz |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Contains code for handling command-line options. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.h file. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__OPTIONS__BASE_H |
22 |
|
#define CVC5__OPTIONS__BASE_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
#include "options/language.h" |
28 |
|
#include <iosfwd> |
29 |
|
// clang-format on |
30 |
|
|
31 |
|
namespace cvc5 { |
32 |
|
namespace options { |
33 |
|
|
34 |
|
// clang-format off |
35 |
|
|
36 |
|
// clang-format on |
37 |
|
|
38 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
39 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
40 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
41 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
42 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
43 |
|
|
44 |
63263 |
struct HolderBASE |
45 |
|
{ |
46 |
|
// clang-format off |
47 |
|
std::string binary_name;\ |
48 |
|
bool binary_name__setByUser__ = false; |
49 |
|
std::ostream* err = &std::cerr;\ |
50 |
|
bool err__setByUser__ = false; |
51 |
|
std::istream* in = &std::cin;\ |
52 |
|
bool in__setByUser__ = false; |
53 |
|
InputLanguage inputLanguage = language::input::LANG_AUTO;\ |
54 |
|
bool inputLanguage__setByUser__ = false; |
55 |
|
bool languageHelp;\ |
56 |
|
bool languageHelp__setByUser__ = false; |
57 |
|
std::ostream* out = &std::cout;\ |
58 |
|
bool out__setByUser__ = false; |
59 |
|
OutputLanguage outputLanguage = language::output::LANG_AUTO;\ |
60 |
|
bool outputLanguage__setByUser__ = false; |
61 |
|
bool parseOnly;\ |
62 |
|
bool parseOnly__setByUser__ = false; |
63 |
|
bool preprocessOnly;\ |
64 |
|
bool preprocessOnly__setByUser__ = false; |
65 |
|
bool printSuccess;\ |
66 |
|
bool printSuccess__setByUser__ = false; |
67 |
|
bool statistics;\ |
68 |
|
bool statistics__setByUser__ = false; |
69 |
|
bool statisticsAll;\ |
70 |
|
bool statisticsAll__setByUser__ = false; |
71 |
|
bool statisticsEveryQuery = false;\ |
72 |
|
bool statisticsEveryQuery__setByUser__ = false; |
73 |
|
bool statisticsExpert;\ |
74 |
|
bool statisticsExpert__setByUser__ = false; |
75 |
|
int verbosity = 0;\ |
76 |
|
bool verbosity__setByUser__ = false; |
77 |
|
// clang-format on |
78 |
|
}; |
79 |
|
|
80 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
81 |
|
|
82 |
|
// clang-format off |
83 |
|
extern struct binary_name__option_t |
84 |
|
{ |
85 |
|
typedef std::string type; |
86 |
|
type operator()() const; |
87 |
|
} thread_local binary_name; |
88 |
|
extern struct err__option_t |
89 |
|
{ |
90 |
|
typedef std::ostream* type; |
91 |
|
type operator()() const; |
92 |
|
} thread_local err; |
93 |
|
extern struct in__option_t |
94 |
|
{ |
95 |
|
typedef std::istream* type; |
96 |
|
type operator()() const; |
97 |
|
} thread_local in; |
98 |
|
extern struct inputLanguage__option_t |
99 |
|
{ |
100 |
|
typedef InputLanguage type; |
101 |
|
type operator()() const; |
102 |
|
} thread_local inputLanguage; |
103 |
|
extern struct languageHelp__option_t |
104 |
|
{ |
105 |
|
typedef bool type; |
106 |
|
type operator()() const; |
107 |
|
} thread_local languageHelp; |
108 |
|
extern struct out__option_t |
109 |
|
{ |
110 |
|
typedef std::ostream* type; |
111 |
|
type operator()() const; |
112 |
|
} thread_local out; |
113 |
|
extern struct outputLanguage__option_t |
114 |
|
{ |
115 |
|
typedef OutputLanguage type; |
116 |
|
type operator()() const; |
117 |
|
} thread_local outputLanguage; |
118 |
|
extern struct parseOnly__option_t |
119 |
|
{ |
120 |
|
typedef bool type; |
121 |
|
type operator()() const; |
122 |
|
} thread_local parseOnly; |
123 |
|
extern struct preprocessOnly__option_t |
124 |
|
{ |
125 |
|
typedef bool type; |
126 |
|
type operator()() const; |
127 |
|
} thread_local preprocessOnly; |
128 |
|
extern struct printSuccess__option_t |
129 |
|
{ |
130 |
|
typedef bool type; |
131 |
|
type operator()() const; |
132 |
|
} thread_local printSuccess; |
133 |
|
extern struct statistics__option_t |
134 |
|
{ |
135 |
|
typedef bool type; |
136 |
|
type operator()() const; |
137 |
|
} thread_local statistics; |
138 |
|
extern struct statisticsAll__option_t |
139 |
|
{ |
140 |
|
typedef bool type; |
141 |
|
type operator()() const; |
142 |
|
} thread_local statisticsAll; |
143 |
|
extern struct statisticsEveryQuery__option_t |
144 |
|
{ |
145 |
|
typedef bool type; |
146 |
|
type operator()() const; |
147 |
|
} thread_local statisticsEveryQuery; |
148 |
|
extern struct statisticsExpert__option_t |
149 |
|
{ |
150 |
|
typedef bool type; |
151 |
|
type operator()() const; |
152 |
|
} thread_local statisticsExpert; |
153 |
|
extern struct verbosity__option_t |
154 |
|
{ |
155 |
|
typedef int type; |
156 |
|
type operator()() const; |
157 |
|
} thread_local verbosity; |
158 |
|
// clang-format on |
159 |
|
|
160 |
|
namespace base |
161 |
|
{ |
162 |
|
// clang-format off |
163 |
|
static constexpr const char* binary_name__name = ""; |
164 |
|
static constexpr const char* err__name = ""; |
165 |
|
static constexpr const char* in__name = ""; |
166 |
|
static constexpr const char* inputLanguage__name = "lang"; |
167 |
|
static constexpr const char* languageHelp__name = ""; |
168 |
|
static constexpr const char* out__name = ""; |
169 |
|
static constexpr const char* outputLanguage__name = "output-lang"; |
170 |
|
static constexpr const char* parseOnly__name = "parse-only"; |
171 |
|
static constexpr const char* preprocessOnly__name = "preprocess-only"; |
172 |
|
static constexpr const char* printSuccess__name = "print-success"; |
173 |
|
static constexpr const char* statistics__name = "stats"; |
174 |
|
static constexpr const char* statisticsAll__name = "stats-all"; |
175 |
|
static constexpr const char* statisticsEveryQuery__name = "stats-every-query"; |
176 |
|
static constexpr const char* statisticsExpert__name = "stats-expert"; |
177 |
|
static constexpr const char* verbosity__name = "verbosity"; |
178 |
|
// clang-format on |
179 |
|
} |
180 |
|
|
181 |
|
} // namespace options |
182 |
|
|
183 |
|
// clang-format off |
184 |
|
template <> options::binary_name__option_t::type& Options::ref( |
185 |
|
options::binary_name__option_t); |
186 |
|
template <> const options::binary_name__option_t::type& Options::operator[]( |
187 |
|
options::binary_name__option_t) const; |
188 |
|
template <> bool Options::wasSetByUser(options::binary_name__option_t) const; |
189 |
|
template <> options::err__option_t::type& Options::ref( |
190 |
|
options::err__option_t); |
191 |
|
template <> const options::err__option_t::type& Options::operator[]( |
192 |
|
options::err__option_t) const; |
193 |
|
template <> bool Options::wasSetByUser(options::err__option_t) const; |
194 |
|
template <> options::in__option_t::type& Options::ref( |
195 |
|
options::in__option_t); |
196 |
|
template <> const options::in__option_t::type& Options::operator[]( |
197 |
|
options::in__option_t) const; |
198 |
|
template <> bool Options::wasSetByUser(options::in__option_t) const; |
199 |
|
template <> options::inputLanguage__option_t::type& Options::ref( |
200 |
|
options::inputLanguage__option_t); |
201 |
|
template <> const options::inputLanguage__option_t::type& Options::operator[]( |
202 |
|
options::inputLanguage__option_t) const; |
203 |
|
template <> bool Options::wasSetByUser(options::inputLanguage__option_t) const; |
204 |
|
template <> options::languageHelp__option_t::type& Options::ref( |
205 |
|
options::languageHelp__option_t); |
206 |
|
template <> const options::languageHelp__option_t::type& Options::operator[]( |
207 |
|
options::languageHelp__option_t) const; |
208 |
|
template <> bool Options::wasSetByUser(options::languageHelp__option_t) const; |
209 |
|
template <> options::out__option_t::type& Options::ref( |
210 |
|
options::out__option_t); |
211 |
|
template <> const options::out__option_t::type& Options::operator[]( |
212 |
|
options::out__option_t) const; |
213 |
|
template <> bool Options::wasSetByUser(options::out__option_t) const; |
214 |
|
template <> options::outputLanguage__option_t::type& Options::ref( |
215 |
|
options::outputLanguage__option_t); |
216 |
|
template <> const options::outputLanguage__option_t::type& Options::operator[]( |
217 |
|
options::outputLanguage__option_t) const; |
218 |
|
template <> bool Options::wasSetByUser(options::outputLanguage__option_t) const; |
219 |
|
template <> options::parseOnly__option_t::type& Options::ref( |
220 |
|
options::parseOnly__option_t); |
221 |
|
template <> const options::parseOnly__option_t::type& Options::operator[]( |
222 |
|
options::parseOnly__option_t) const; |
223 |
|
template <> bool Options::wasSetByUser(options::parseOnly__option_t) const; |
224 |
|
template <> options::preprocessOnly__option_t::type& Options::ref( |
225 |
|
options::preprocessOnly__option_t); |
226 |
|
template <> const options::preprocessOnly__option_t::type& Options::operator[]( |
227 |
|
options::preprocessOnly__option_t) const; |
228 |
|
template <> bool Options::wasSetByUser(options::preprocessOnly__option_t) const; |
229 |
|
template <> options::printSuccess__option_t::type& Options::ref( |
230 |
|
options::printSuccess__option_t); |
231 |
|
template <> const options::printSuccess__option_t::type& Options::operator[]( |
232 |
|
options::printSuccess__option_t) const; |
233 |
|
template <> bool Options::wasSetByUser(options::printSuccess__option_t) const; |
234 |
|
template <> options::statistics__option_t::type& Options::ref( |
235 |
|
options::statistics__option_t); |
236 |
|
template <> const options::statistics__option_t::type& Options::operator[]( |
237 |
|
options::statistics__option_t) const; |
238 |
|
template <> bool Options::wasSetByUser(options::statistics__option_t) const; |
239 |
|
template <> options::statisticsAll__option_t::type& Options::ref( |
240 |
|
options::statisticsAll__option_t); |
241 |
|
template <> const options::statisticsAll__option_t::type& Options::operator[]( |
242 |
|
options::statisticsAll__option_t) const; |
243 |
|
template <> bool Options::wasSetByUser(options::statisticsAll__option_t) const; |
244 |
|
template <> options::statisticsEveryQuery__option_t::type& Options::ref( |
245 |
|
options::statisticsEveryQuery__option_t); |
246 |
|
template <> const options::statisticsEveryQuery__option_t::type& Options::operator[]( |
247 |
|
options::statisticsEveryQuery__option_t) const; |
248 |
|
template <> bool Options::wasSetByUser(options::statisticsEveryQuery__option_t) const; |
249 |
|
template <> options::statisticsExpert__option_t::type& Options::ref( |
250 |
|
options::statisticsExpert__option_t); |
251 |
|
template <> const options::statisticsExpert__option_t::type& Options::operator[]( |
252 |
|
options::statisticsExpert__option_t) const; |
253 |
|
template <> bool Options::wasSetByUser(options::statisticsExpert__option_t) const; |
254 |
|
template <> options::verbosity__option_t::type& Options::ref( |
255 |
|
options::verbosity__option_t); |
256 |
|
template <> const options::verbosity__option_t::type& Options::operator[]( |
257 |
|
options::verbosity__option_t) const; |
258 |
|
template <> bool Options::wasSetByUser(options::verbosity__option_t) const; |
259 |
|
// clang-format on |
260 |
|
|
261 |
|
namespace options { |
262 |
|
// clang-format off |
263 |
|
inline binary_name__option_t::type binary_name__option_t::operator()() const |
264 |
|
{ |
265 |
|
return Options::current()[*this]; |
266 |
|
} |
267 |
20186 |
inline err__option_t::type err__option_t::operator()() const |
268 |
|
{ |
269 |
20186 |
return Options::current()[*this]; |
270 |
|
} |
271 |
|
inline in__option_t::type in__option_t::operator()() const |
272 |
|
{ |
273 |
|
return Options::current()[*this]; |
274 |
|
} |
275 |
98759 |
inline inputLanguage__option_t::type inputLanguage__option_t::operator()() const |
276 |
|
{ |
277 |
98759 |
return Options::current()[*this]; |
278 |
|
} |
279 |
|
inline languageHelp__option_t::type languageHelp__option_t::operator()() const |
280 |
|
{ |
281 |
|
return Options::current()[*this]; |
282 |
|
} |
283 |
36 |
inline out__option_t::type out__option_t::operator()() const |
284 |
|
{ |
285 |
36 |
return Options::current()[*this]; |
286 |
|
} |
287 |
46279 |
inline outputLanguage__option_t::type outputLanguage__option_t::operator()() const |
288 |
|
{ |
289 |
46279 |
return Options::current()[*this]; |
290 |
|
} |
291 |
|
inline parseOnly__option_t::type parseOnly__option_t::operator()() const |
292 |
|
{ |
293 |
|
return Options::current()[*this]; |
294 |
|
} |
295 |
14310 |
inline preprocessOnly__option_t::type preprocessOnly__option_t::operator()() const |
296 |
|
{ |
297 |
14310 |
return Options::current()[*this]; |
298 |
|
} |
299 |
|
inline printSuccess__option_t::type printSuccess__option_t::operator()() const |
300 |
|
{ |
301 |
|
return Options::current()[*this]; |
302 |
|
} |
303 |
|
inline statistics__option_t::type statistics__option_t::operator()() const |
304 |
|
{ |
305 |
|
return Options::current()[*this]; |
306 |
|
} |
307 |
|
inline statisticsAll__option_t::type statisticsAll__option_t::operator()() const |
308 |
|
{ |
309 |
|
return Options::current()[*this]; |
310 |
|
} |
311 |
|
inline statisticsEveryQuery__option_t::type statisticsEveryQuery__option_t::operator()() const |
312 |
|
{ |
313 |
|
return Options::current()[*this]; |
314 |
|
} |
315 |
|
inline statisticsExpert__option_t::type statisticsExpert__option_t::operator()() const |
316 |
|
{ |
317 |
|
return Options::current()[*this]; |
318 |
|
} |
319 |
14645 |
inline verbosity__option_t::type verbosity__option_t::operator()() const |
320 |
|
{ |
321 |
14645 |
return Options::current()[*this]; |
322 |
|
} |
323 |
|
// clang-format on |
324 |
|
|
325 |
|
} // namespace options |
326 |
|
} // namespace cvc5 |
327 |
|
|
328 |
|
#endif /* CVC5__OPTIONS__BASE_H */ |