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 |
|
* Option template for option modules. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.cpp file. |
17 |
|
*/ |
18 |
|
#include "options/datatypes_options.h" |
19 |
|
|
20 |
|
#include <iostream> |
21 |
|
|
22 |
|
#include "base/check.h" |
23 |
|
#include "options/option_exception.h" |
24 |
|
|
25 |
|
// clang-format off |
26 |
|
namespace cvc5 { |
27 |
|
|
28 |
|
template <> options::cdtBisimilar__option_t::type& Options::ref( |
29 |
|
options::cdtBisimilar__option_t) |
30 |
|
{ |
31 |
|
return datatypes().cdtBisimilar; |
32 |
|
} |
33 |
86 |
template <> const options::cdtBisimilar__option_t::type& Options::operator[]( |
34 |
|
options::cdtBisimilar__option_t) const |
35 |
|
{ |
36 |
86 |
return datatypes().cdtBisimilar; |
37 |
|
} |
38 |
|
template <> bool Options::wasSetByUser(options::cdtBisimilar__option_t) const |
39 |
|
{ |
40 |
|
return datatypes().cdtBisimilar__setByUser__; |
41 |
|
} |
42 |
|
template <> options::dtBinarySplit__option_t::type& Options::ref( |
43 |
|
options::dtBinarySplit__option_t) |
44 |
|
{ |
45 |
|
return datatypes().dtBinarySplit; |
46 |
|
} |
47 |
1156 |
template <> const options::dtBinarySplit__option_t::type& Options::operator[]( |
48 |
|
options::dtBinarySplit__option_t) const |
49 |
|
{ |
50 |
1156 |
return datatypes().dtBinarySplit; |
51 |
|
} |
52 |
|
template <> bool Options::wasSetByUser(options::dtBinarySplit__option_t) const |
53 |
|
{ |
54 |
|
return datatypes().dtBinarySplit__setByUser__; |
55 |
|
} |
56 |
|
template <> options::dtBlastSplits__option_t::type& Options::ref( |
57 |
|
options::dtBlastSplits__option_t) |
58 |
|
{ |
59 |
|
return datatypes().dtBlastSplits; |
60 |
|
} |
61 |
1156 |
template <> const options::dtBlastSplits__option_t::type& Options::operator[]( |
62 |
|
options::dtBlastSplits__option_t) const |
63 |
|
{ |
64 |
1156 |
return datatypes().dtBlastSplits; |
65 |
|
} |
66 |
|
template <> bool Options::wasSetByUser(options::dtBlastSplits__option_t) const |
67 |
|
{ |
68 |
|
return datatypes().dtBlastSplits__setByUser__; |
69 |
|
} |
70 |
|
template <> options::dtCyclic__option_t::type& Options::ref( |
71 |
|
options::dtCyclic__option_t) |
72 |
|
{ |
73 |
|
return datatypes().dtCyclic; |
74 |
|
} |
75 |
190221 |
template <> const options::dtCyclic__option_t::type& Options::operator[]( |
76 |
|
options::dtCyclic__option_t) const |
77 |
|
{ |
78 |
190221 |
return datatypes().dtCyclic; |
79 |
|
} |
80 |
|
template <> bool Options::wasSetByUser(options::dtCyclic__option_t) const |
81 |
|
{ |
82 |
|
return datatypes().dtCyclic__setByUser__; |
83 |
|
} |
84 |
|
template <> options::dtForceAssignment__option_t::type& Options::ref( |
85 |
|
options::dtForceAssignment__option_t) |
86 |
|
{ |
87 |
|
return datatypes().dtForceAssignment; |
88 |
|
} |
89 |
26160 |
template <> const options::dtForceAssignment__option_t::type& Options::operator[]( |
90 |
|
options::dtForceAssignment__option_t) const |
91 |
|
{ |
92 |
26160 |
return datatypes().dtForceAssignment; |
93 |
|
} |
94 |
|
template <> bool Options::wasSetByUser(options::dtForceAssignment__option_t) const |
95 |
|
{ |
96 |
|
return datatypes().dtForceAssignment__setByUser__; |
97 |
|
} |
98 |
|
template <> options::dtInferAsLemmas__option_t::type& Options::ref( |
99 |
|
options::dtInferAsLemmas__option_t) |
100 |
|
{ |
101 |
|
return datatypes().dtInferAsLemmas; |
102 |
|
} |
103 |
277265 |
template <> const options::dtInferAsLemmas__option_t::type& Options::operator[]( |
104 |
|
options::dtInferAsLemmas__option_t) const |
105 |
|
{ |
106 |
277265 |
return datatypes().dtInferAsLemmas; |
107 |
|
} |
108 |
|
template <> bool Options::wasSetByUser(options::dtInferAsLemmas__option_t) const |
109 |
|
{ |
110 |
|
return datatypes().dtInferAsLemmas__setByUser__; |
111 |
|
} |
112 |
|
template <> options::dtNestedRec__option_t::type& Options::ref( |
113 |
|
options::dtNestedRec__option_t) |
114 |
|
{ |
115 |
|
return datatypes().dtNestedRec; |
116 |
|
} |
117 |
52594 |
template <> const options::dtNestedRec__option_t::type& Options::operator[]( |
118 |
|
options::dtNestedRec__option_t) const |
119 |
|
{ |
120 |
52594 |
return datatypes().dtNestedRec; |
121 |
|
} |
122 |
|
template <> bool Options::wasSetByUser(options::dtNestedRec__option_t) const |
123 |
|
{ |
124 |
|
return datatypes().dtNestedRec__setByUser__; |
125 |
|
} |
126 |
|
template <> options::dtPoliteOptimize__option_t::type& Options::ref( |
127 |
|
options::dtPoliteOptimize__option_t) |
128 |
|
{ |
129 |
|
return datatypes().dtPoliteOptimize; |
130 |
|
} |
131 |
103673 |
template <> const options::dtPoliteOptimize__option_t::type& Options::operator[]( |
132 |
|
options::dtPoliteOptimize__option_t) const |
133 |
|
{ |
134 |
103673 |
return datatypes().dtPoliteOptimize; |
135 |
|
} |
136 |
|
template <> bool Options::wasSetByUser(options::dtPoliteOptimize__option_t) const |
137 |
|
{ |
138 |
|
return datatypes().dtPoliteOptimize__setByUser__; |
139 |
|
} |
140 |
819 |
template <> options::dtRewriteErrorSel__option_t::type& Options::ref( |
141 |
|
options::dtRewriteErrorSel__option_t) |
142 |
|
{ |
143 |
819 |
return datatypes().dtRewriteErrorSel; |
144 |
|
} |
145 |
3244 |
template <> const options::dtRewriteErrorSel__option_t::type& Options::operator[]( |
146 |
|
options::dtRewriteErrorSel__option_t) const |
147 |
|
{ |
148 |
3244 |
return datatypes().dtRewriteErrorSel; |
149 |
|
} |
150 |
819 |
template <> bool Options::wasSetByUser(options::dtRewriteErrorSel__option_t) const |
151 |
|
{ |
152 |
819 |
return datatypes().dtRewriteErrorSel__setByUser__; |
153 |
|
} |
154 |
|
template <> options::dtSharedSelectors__option_t::type& Options::ref( |
155 |
|
options::dtSharedSelectors__option_t) |
156 |
|
{ |
157 |
|
return datatypes().dtSharedSelectors; |
158 |
|
} |
159 |
654269 |
template <> const options::dtSharedSelectors__option_t::type& Options::operator[]( |
160 |
|
options::dtSharedSelectors__option_t) const |
161 |
|
{ |
162 |
654269 |
return datatypes().dtSharedSelectors; |
163 |
|
} |
164 |
|
template <> bool Options::wasSetByUser(options::dtSharedSelectors__option_t) const |
165 |
|
{ |
166 |
|
return datatypes().dtSharedSelectors__setByUser__; |
167 |
|
} |
168 |
|
template <> options::sygusAbortSize__option_t::type& Options::ref( |
169 |
|
options::sygusAbortSize__option_t) |
170 |
|
{ |
171 |
|
return datatypes().sygusAbortSize; |
172 |
|
} |
173 |
650 |
template <> const options::sygusAbortSize__option_t::type& Options::operator[]( |
174 |
|
options::sygusAbortSize__option_t) const |
175 |
|
{ |
176 |
650 |
return datatypes().sygusAbortSize; |
177 |
|
} |
178 |
|
template <> bool Options::wasSetByUser(options::sygusAbortSize__option_t) const |
179 |
|
{ |
180 |
|
return datatypes().sygusAbortSize__setByUser__; |
181 |
|
} |
182 |
|
template <> options::sygusFairMax__option_t::type& Options::ref( |
183 |
|
options::sygusFairMax__option_t) |
184 |
|
{ |
185 |
|
return datatypes().sygusFairMax; |
186 |
|
} |
187 |
431 |
template <> const options::sygusFairMax__option_t::type& Options::operator[]( |
188 |
|
options::sygusFairMax__option_t) const |
189 |
|
{ |
190 |
431 |
return datatypes().sygusFairMax; |
191 |
|
} |
192 |
|
template <> bool Options::wasSetByUser(options::sygusFairMax__option_t) const |
193 |
|
{ |
194 |
|
return datatypes().sygusFairMax__setByUser__; |
195 |
|
} |
196 |
|
template <> options::sygusFair__option_t::type& Options::ref( |
197 |
|
options::sygusFair__option_t) |
198 |
|
{ |
199 |
|
return datatypes().sygusFair; |
200 |
|
} |
201 |
86979 |
template <> const options::sygusFair__option_t::type& Options::operator[]( |
202 |
|
options::sygusFair__option_t) const |
203 |
|
{ |
204 |
86979 |
return datatypes().sygusFair; |
205 |
|
} |
206 |
|
template <> bool Options::wasSetByUser(options::sygusFair__option_t) const |
207 |
|
{ |
208 |
|
return datatypes().sygusFair__setByUser__; |
209 |
|
} |
210 |
|
template <> options::sygusSymBreak__option_t::type& Options::ref( |
211 |
|
options::sygusSymBreak__option_t) |
212 |
|
{ |
213 |
|
return datatypes().sygusSymBreak; |
214 |
|
} |
215 |
2878 |
template <> const options::sygusSymBreak__option_t::type& Options::operator[]( |
216 |
|
options::sygusSymBreak__option_t) const |
217 |
|
{ |
218 |
2878 |
return datatypes().sygusSymBreak; |
219 |
|
} |
220 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreak__option_t) const |
221 |
|
{ |
222 |
|
return datatypes().sygusSymBreak__setByUser__; |
223 |
|
} |
224 |
|
template <> options::sygusSymBreakAgg__option_t::type& Options::ref( |
225 |
|
options::sygusSymBreakAgg__option_t) |
226 |
|
{ |
227 |
|
return datatypes().sygusSymBreakAgg; |
228 |
|
} |
229 |
177 |
template <> const options::sygusSymBreakAgg__option_t::type& Options::operator[]( |
230 |
|
options::sygusSymBreakAgg__option_t) const |
231 |
|
{ |
232 |
177 |
return datatypes().sygusSymBreakAgg; |
233 |
|
} |
234 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreakAgg__option_t) const |
235 |
|
{ |
236 |
|
return datatypes().sygusSymBreakAgg__setByUser__; |
237 |
|
} |
238 |
|
template <> options::sygusSymBreakDynamic__option_t::type& Options::ref( |
239 |
|
options::sygusSymBreakDynamic__option_t) |
240 |
|
{ |
241 |
|
return datatypes().sygusSymBreakDynamic; |
242 |
|
} |
243 |
63396 |
template <> const options::sygusSymBreakDynamic__option_t::type& Options::operator[]( |
244 |
|
options::sygusSymBreakDynamic__option_t) const |
245 |
|
{ |
246 |
63396 |
return datatypes().sygusSymBreakDynamic; |
247 |
|
} |
248 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreakDynamic__option_t) const |
249 |
|
{ |
250 |
|
return datatypes().sygusSymBreakDynamic__setByUser__; |
251 |
|
} |
252 |
|
template <> options::sygusSymBreakLazy__option_t::type& Options::ref( |
253 |
|
options::sygusSymBreakLazy__option_t) |
254 |
|
{ |
255 |
|
return datatypes().sygusSymBreakLazy; |
256 |
|
} |
257 |
293636 |
template <> const options::sygusSymBreakLazy__option_t::type& Options::operator[]( |
258 |
|
options::sygusSymBreakLazy__option_t) const |
259 |
|
{ |
260 |
293636 |
return datatypes().sygusSymBreakLazy; |
261 |
|
} |
262 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreakLazy__option_t) const |
263 |
|
{ |
264 |
|
return datatypes().sygusSymBreakLazy__setByUser__; |
265 |
|
} |
266 |
|
template <> options::sygusSymBreakPbe__option_t::type& Options::ref( |
267 |
|
options::sygusSymBreakPbe__option_t) |
268 |
|
{ |
269 |
|
return datatypes().sygusSymBreakPbe; |
270 |
|
} |
271 |
4984 |
template <> const options::sygusSymBreakPbe__option_t::type& Options::operator[]( |
272 |
|
options::sygusSymBreakPbe__option_t) const |
273 |
|
{ |
274 |
4984 |
return datatypes().sygusSymBreakPbe; |
275 |
|
} |
276 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreakPbe__option_t) const |
277 |
|
{ |
278 |
|
return datatypes().sygusSymBreakPbe__setByUser__; |
279 |
|
} |
280 |
|
template <> options::sygusSymBreakRlv__option_t::type& Options::ref( |
281 |
|
options::sygusSymBreakRlv__option_t) |
282 |
|
{ |
283 |
|
return datatypes().sygusSymBreakRlv; |
284 |
|
} |
285 |
75468 |
template <> const options::sygusSymBreakRlv__option_t::type& Options::operator[]( |
286 |
|
options::sygusSymBreakRlv__option_t) const |
287 |
|
{ |
288 |
75468 |
return datatypes().sygusSymBreakRlv; |
289 |
|
} |
290 |
|
template <> bool Options::wasSetByUser(options::sygusSymBreakRlv__option_t) const |
291 |
|
{ |
292 |
|
return datatypes().sygusSymBreakRlv__setByUser__; |
293 |
|
} |
294 |
|
|
295 |
|
namespace options { |
296 |
|
|
297 |
|
thread_local struct cdtBisimilar__option_t cdtBisimilar; |
298 |
|
thread_local struct dtBinarySplit__option_t dtBinarySplit; |
299 |
|
thread_local struct dtBlastSplits__option_t dtBlastSplits; |
300 |
|
thread_local struct dtCyclic__option_t dtCyclic; |
301 |
|
thread_local struct dtForceAssignment__option_t dtForceAssignment; |
302 |
|
thread_local struct dtInferAsLemmas__option_t dtInferAsLemmas; |
303 |
|
thread_local struct dtNestedRec__option_t dtNestedRec; |
304 |
|
thread_local struct dtPoliteOptimize__option_t dtPoliteOptimize; |
305 |
|
thread_local struct dtRewriteErrorSel__option_t dtRewriteErrorSel; |
306 |
|
thread_local struct dtSharedSelectors__option_t dtSharedSelectors; |
307 |
|
thread_local struct sygusAbortSize__option_t sygusAbortSize; |
308 |
|
thread_local struct sygusFairMax__option_t sygusFairMax; |
309 |
|
thread_local struct sygusFair__option_t sygusFair; |
310 |
|
thread_local struct sygusSymBreak__option_t sygusSymBreak; |
311 |
|
thread_local struct sygusSymBreakAgg__option_t sygusSymBreakAgg; |
312 |
|
thread_local struct sygusSymBreakDynamic__option_t sygusSymBreakDynamic; |
313 |
|
thread_local struct sygusSymBreakLazy__option_t sygusSymBreakLazy; |
314 |
|
thread_local struct sygusSymBreakPbe__option_t sygusSymBreakPbe; |
315 |
|
thread_local struct sygusSymBreakRlv__option_t sygusSymBreakRlv; |
316 |
|
|
317 |
|
|
318 |
|
std::ostream& operator<<(std::ostream& os, SygusFairMode mode) |
319 |
|
{ |
320 |
|
switch(mode) { |
321 |
|
case SygusFairMode::NONE: |
322 |
|
return os << "SygusFairMode::NONE"; |
323 |
|
case SygusFairMode::DT_HEIGHT_PRED: |
324 |
|
return os << "SygusFairMode::DT_HEIGHT_PRED"; |
325 |
|
case SygusFairMode::DT_SIZE_PRED: |
326 |
|
return os << "SygusFairMode::DT_SIZE_PRED"; |
327 |
|
case SygusFairMode::DT_SIZE: |
328 |
|
return os << "SygusFairMode::DT_SIZE"; |
329 |
|
case SygusFairMode::DIRECT: |
330 |
|
return os << "SygusFairMode::DIRECT"; |
331 |
|
default: |
332 |
|
Unreachable(); |
333 |
|
} |
334 |
|
return os; |
335 |
|
} |
336 |
|
|
337 |
2 |
SygusFairMode stringToSygusFairMode(const std::string& optarg) |
338 |
|
{ |
339 |
2 |
if (optarg == "none") |
340 |
|
{ |
341 |
|
return SygusFairMode::NONE; |
342 |
|
} |
343 |
2 |
else if (optarg == "dt-height-bound") |
344 |
|
{ |
345 |
|
return SygusFairMode::DT_HEIGHT_PRED; |
346 |
|
} |
347 |
2 |
else if (optarg == "dt-size-bound") |
348 |
|
{ |
349 |
|
return SygusFairMode::DT_SIZE_PRED; |
350 |
|
} |
351 |
2 |
else if (optarg == "dt-size") |
352 |
|
{ |
353 |
|
return SygusFairMode::DT_SIZE; |
354 |
|
} |
355 |
2 |
else if (optarg == "direct") |
356 |
|
{ |
357 |
2 |
return SygusFairMode::DIRECT; |
358 |
|
} |
359 |
|
else if (optarg == "help") |
360 |
|
{ |
361 |
|
std::cerr << "Modes for enforcing fairness for counterexample guided quantifier instantion.\n" |
362 |
|
"Available modes for --sygus-fair are:\n" |
363 |
|
"+ none\n" |
364 |
|
" Do not enforce fairness.\n" |
365 |
|
"+ dt-height-bound\n" |
366 |
|
" Enforce fairness by height bound predicate.\n" |
367 |
|
"+ dt-size-bound\n" |
368 |
|
" Enforce fairness by size bound predicate.\n" |
369 |
|
"+ dt-size (default)\n" |
370 |
|
" Enforce fairness using size operator.\n" |
371 |
|
"+ direct\n" |
372 |
|
" Enforce fairness using direct conflict lemmas.\n"; |
373 |
|
std::exit(1); |
374 |
|
} |
375 |
|
throw OptionException(std::string("unknown option for --sygus-fair: `") + |
376 |
|
optarg + "'. Try --sygus-fair=help."); |
377 |
|
} |
378 |
|
|
379 |
|
|
380 |
|
} // namespace options |
381 |
27735 |
} // namespace cvc5 |
382 |
|
// clang-format on |