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/smt_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 |
|
|
29 |
|
|
30 |
|
namespace options { |
31 |
|
|
32 |
|
thread_local struct abstractValues__option_t abstractValues; |
33 |
|
thread_local struct ackermann__option_t ackermann; |
34 |
|
thread_local struct blockModelsMode__option_t blockModelsMode; |
35 |
|
thread_local struct BVAndIntegerGranularity__option_t BVAndIntegerGranularity; |
36 |
|
thread_local struct checkAbducts__option_t checkAbducts; |
37 |
|
thread_local struct checkInterpols__option_t checkInterpols; |
38 |
|
thread_local struct checkModels__option_t checkModels; |
39 |
|
thread_local struct checkProofs__option_t checkProofs; |
40 |
|
thread_local struct checkSynthSol__option_t checkSynthSol; |
41 |
|
thread_local struct checkUnsatCores__option_t checkUnsatCores; |
42 |
|
thread_local struct debugCheckModels__option_t debugCheckModels; |
43 |
|
thread_local struct dumpToFileName__option_t dumpToFileName; |
44 |
|
thread_local struct dumpModeString__option_t dumpModeString; |
45 |
|
thread_local struct earlyIteRemoval__option_t earlyIteRemoval; |
46 |
|
thread_local struct expandDefinitions__option_t expandDefinitions; |
47 |
|
thread_local struct extRewPrep__option_t extRewPrep; |
48 |
|
thread_local struct extRewPrepAgg__option_t extRewPrepAgg; |
49 |
|
thread_local struct foreignTheoryRewrite__option_t foreignTheoryRewrite; |
50 |
|
thread_local struct iandMode__option_t iandMode; |
51 |
|
thread_local struct interactiveMode__option_t interactiveMode; |
52 |
|
thread_local struct doITESimp__option_t doITESimp; |
53 |
|
thread_local struct learnedRewrite__option_t learnedRewrite; |
54 |
|
thread_local struct minimalUnsatCores__option_t minimalUnsatCores; |
55 |
|
thread_local struct modelCoresMode__option_t modelCoresMode; |
56 |
|
thread_local struct modelUninterpPrint__option_t modelUninterpPrint; |
57 |
|
thread_local struct modelWitnessValue__option_t modelWitnessValue; |
58 |
|
thread_local struct doITESimpOnRepeat__option_t doITESimpOnRepeat; |
59 |
|
thread_local struct produceAbducts__option_t produceAbducts; |
60 |
|
thread_local struct produceAssertions__option_t produceAssertions; |
61 |
|
thread_local struct produceAssignments__option_t produceAssignments; |
62 |
|
thread_local struct produceInterpols__option_t produceInterpols; |
63 |
|
thread_local struct produceModels__option_t produceModels; |
64 |
|
thread_local struct produceProofs__option_t produceProofs; |
65 |
|
thread_local struct unsatAssumptions__option_t unsatAssumptions; |
66 |
|
thread_local struct unsatCores__option_t unsatCores; |
67 |
|
thread_local struct repeatSimp__option_t repeatSimp; |
68 |
|
thread_local struct compressItes__option_t compressItes; |
69 |
|
thread_local struct zombieHuntThreshold__option_t zombieHuntThreshold; |
70 |
|
thread_local struct simplifyWithCareEnabled__option_t simplifyWithCareEnabled; |
71 |
|
thread_local struct simplificationMode__option_t simplificationMode; |
72 |
|
thread_local struct solveBVAsInt__option_t solveBVAsInt; |
73 |
|
thread_local struct solveIntAsBV__option_t solveIntAsBV; |
74 |
|
thread_local struct solveRealAsInt__option_t solveRealAsInt; |
75 |
|
thread_local struct sortInference__option_t sortInference; |
76 |
|
thread_local struct doStaticLearning__option_t doStaticLearning; |
77 |
|
thread_local struct sygusOut__option_t sygusOut; |
78 |
|
thread_local struct sygusPrintCallbacks__option_t sygusPrintCallbacks; |
79 |
|
thread_local struct unconstrainedSimp__option_t unconstrainedSimp; |
80 |
|
thread_local struct unsatCoresMode__option_t unsatCoresMode; |
81 |
|
|
82 |
|
|
83 |
|
std::ostream& operator<<(std::ostream& os, BlockModelsMode mode) |
84 |
|
{ |
85 |
|
switch(mode) { |
86 |
|
case BlockModelsMode::VALUES: |
87 |
|
return os << "BlockModelsMode::VALUES"; |
88 |
|
case BlockModelsMode::NONE: |
89 |
|
return os << "BlockModelsMode::NONE"; |
90 |
|
case BlockModelsMode::LITERALS: |
91 |
|
return os << "BlockModelsMode::LITERALS"; |
92 |
|
default: |
93 |
|
Unreachable(); |
94 |
|
} |
95 |
|
return os; |
96 |
|
} |
97 |
|
|
98 |
21 |
BlockModelsMode stringToBlockModelsMode(const std::string& optarg) |
99 |
|
{ |
100 |
21 |
if (optarg == "values") |
101 |
|
{ |
102 |
3 |
return BlockModelsMode::VALUES; |
103 |
|
} |
104 |
18 |
else if (optarg == "none") |
105 |
|
{ |
106 |
|
return BlockModelsMode::NONE; |
107 |
|
} |
108 |
18 |
else if (optarg == "literals") |
109 |
|
{ |
110 |
18 |
return BlockModelsMode::LITERALS; |
111 |
|
} |
112 |
|
else if (optarg == "help") |
113 |
|
{ |
114 |
|
std::cerr << "Blocking models modes.\n" |
115 |
|
"Available modes for --block-models are:\n" |
116 |
|
"+ values\n" |
117 |
|
" Block models based on the concrete model values for the free variables.\n" |
118 |
|
"+ none (default)\n" |
119 |
|
" Do not block models.\n" |
120 |
|
"+ literals\n" |
121 |
|
" Block models based on the SAT skeleton.\n"; |
122 |
|
std::exit(1); |
123 |
|
} |
124 |
|
throw OptionException(std::string("unknown option for --block-models: `") + |
125 |
|
optarg + "'. Try --block-models=help."); |
126 |
|
} |
127 |
|
|
128 |
|
std::ostream& operator<<(std::ostream& os, IandMode mode) |
129 |
|
{ |
130 |
|
switch(mode) { |
131 |
|
case IandMode::BITWISE: |
132 |
|
return os << "IandMode::BITWISE"; |
133 |
|
case IandMode::SUM: |
134 |
|
return os << "IandMode::SUM"; |
135 |
|
case IandMode::VALUE: |
136 |
|
return os << "IandMode::VALUE"; |
137 |
|
default: |
138 |
|
Unreachable(); |
139 |
|
} |
140 |
|
return os; |
141 |
|
} |
142 |
|
|
143 |
68 |
IandMode stringToIandMode(const std::string& optarg) |
144 |
|
{ |
145 |
68 |
if (optarg == "bitwise") |
146 |
|
{ |
147 |
30 |
return IandMode::BITWISE; |
148 |
|
} |
149 |
38 |
else if (optarg == "sum") |
150 |
|
{ |
151 |
19 |
return IandMode::SUM; |
152 |
|
} |
153 |
19 |
else if (optarg == "value") |
154 |
|
{ |
155 |
19 |
return IandMode::VALUE; |
156 |
|
} |
157 |
|
else if (optarg == "help") |
158 |
|
{ |
159 |
|
std::cerr << "Refinement modes for integer AND\n" |
160 |
|
"Available modes for --iand-mode are:\n" |
161 |
|
"+ bitwise\n" |
162 |
|
" use bitwise comparisons on binary representation of integer for refinement\n" |
163 |
|
" (experimental)\n" |
164 |
|
"+ sum\n" |
165 |
|
" use sum to represent integer AND in refinement\n" |
166 |
|
"+ value (default)\n" |
167 |
|
" value-based refinement\n"; |
168 |
|
std::exit(1); |
169 |
|
} |
170 |
|
throw OptionException(std::string("unknown option for --iand-mode: `") + |
171 |
|
optarg + "'. Try --iand-mode=help."); |
172 |
|
} |
173 |
|
|
174 |
|
std::ostream& operator<<(std::ostream& os, ModelCoresMode mode) |
175 |
|
{ |
176 |
|
switch(mode) { |
177 |
|
case ModelCoresMode::NONE: |
178 |
|
return os << "ModelCoresMode::NONE"; |
179 |
|
case ModelCoresMode::NON_IMPLIED: |
180 |
|
return os << "ModelCoresMode::NON_IMPLIED"; |
181 |
|
case ModelCoresMode::SIMPLE: |
182 |
|
return os << "ModelCoresMode::SIMPLE"; |
183 |
|
default: |
184 |
|
Unreachable(); |
185 |
|
} |
186 |
|
return os; |
187 |
|
} |
188 |
|
|
189 |
6 |
ModelCoresMode stringToModelCoresMode(const std::string& optarg) |
190 |
|
{ |
191 |
6 |
if (optarg == "none") |
192 |
|
{ |
193 |
|
return ModelCoresMode::NONE; |
194 |
|
} |
195 |
6 |
else if (optarg == "non-implied") |
196 |
|
{ |
197 |
4 |
return ModelCoresMode::NON_IMPLIED; |
198 |
|
} |
199 |
2 |
else if (optarg == "simple") |
200 |
|
{ |
201 |
2 |
return ModelCoresMode::SIMPLE; |
202 |
|
} |
203 |
|
else if (optarg == "help") |
204 |
|
{ |
205 |
|
std::cerr << "Model cores modes.\n" |
206 |
|
"Available modes for --model-cores are:\n" |
207 |
|
"+ none (default)\n" |
208 |
|
" Do not compute model cores.\n" |
209 |
|
"+ non-implied\n" |
210 |
|
" Only include a subset of variables whose values, in addition to the values of\n" |
211 |
|
" variables whose values are implied, are sufficient to show the input formula\n" |
212 |
|
" is satisfied by the given model.\n" |
213 |
|
"+ simple\n" |
214 |
|
" Only include a subset of variables whose values are sufficient to show the\n" |
215 |
|
" input formula is satisfied by the given model.\n"; |
216 |
|
std::exit(1); |
217 |
|
} |
218 |
|
throw OptionException(std::string("unknown option for --model-cores: `") + |
219 |
|
optarg + "'. Try --model-cores=help."); |
220 |
|
} |
221 |
|
|
222 |
|
std::ostream& operator<<(std::ostream& os, ModelUninterpPrintMode mode) |
223 |
|
{ |
224 |
|
switch(mode) { |
225 |
|
case ModelUninterpPrintMode::None: |
226 |
|
return os << "ModelUninterpPrintMode::None"; |
227 |
|
case ModelUninterpPrintMode::DeclFun: |
228 |
|
return os << "ModelUninterpPrintMode::DeclFun"; |
229 |
|
case ModelUninterpPrintMode::DtEnum: |
230 |
|
return os << "ModelUninterpPrintMode::DtEnum"; |
231 |
|
case ModelUninterpPrintMode::DeclSortAndFun: |
232 |
|
return os << "ModelUninterpPrintMode::DeclSortAndFun"; |
233 |
|
default: |
234 |
|
Unreachable(); |
235 |
|
} |
236 |
|
return os; |
237 |
|
} |
238 |
|
|
239 |
1 |
ModelUninterpPrintMode stringToModelUninterpPrintMode(const std::string& optarg) |
240 |
|
{ |
241 |
1 |
if (optarg == "none") |
242 |
|
{ |
243 |
|
return ModelUninterpPrintMode::None; |
244 |
|
} |
245 |
1 |
else if (optarg == "decl-fun") |
246 |
|
{ |
247 |
1 |
return ModelUninterpPrintMode::DeclFun; |
248 |
|
} |
249 |
|
else if (optarg == "dtenum") |
250 |
|
{ |
251 |
|
return ModelUninterpPrintMode::DtEnum; |
252 |
|
} |
253 |
|
else if (optarg == "decl-sort-and-fun") |
254 |
|
{ |
255 |
|
return ModelUninterpPrintMode::DeclSortAndFun; |
256 |
|
} |
257 |
|
else if (optarg == "help") |
258 |
|
{ |
259 |
|
std::cerr << "uninterpreted elements in models printing modes.\n" |
260 |
|
"Available modes for --model-u-print are:\n" |
261 |
|
"+ none (default)\n" |
262 |
|
" (default) do not print declarations of uninterpreted elements in models.\n" |
263 |
|
"+ decl-fun\n" |
264 |
|
" print uninterpreted elements declare-fun, but don't include a declare-sort for\n" |
265 |
|
" the sort\n" |
266 |
|
"+ dtenum\n" |
267 |
|
" print uninterpreted elements as datatype enumerations, where the sort is the\n" |
268 |
|
" datatype\n" |
269 |
|
"+ decl-sort-and-fun\n" |
270 |
|
" print uninterpreted elements declare-fun, and also include a declare-sort for\n" |
271 |
|
" the sort\n"; |
272 |
|
std::exit(1); |
273 |
|
} |
274 |
|
throw OptionException(std::string("unknown option for --model-u-print: `") + |
275 |
|
optarg + "'. Try --model-u-print=help."); |
276 |
|
} |
277 |
|
|
278 |
|
std::ostream& operator<<(std::ostream& os, ProduceInterpols mode) |
279 |
|
{ |
280 |
|
switch(mode) { |
281 |
|
case ProduceInterpols::DEFAULT: |
282 |
|
return os << "ProduceInterpols::DEFAULT"; |
283 |
|
case ProduceInterpols::CONJECTURE: |
284 |
|
return os << "ProduceInterpols::CONJECTURE"; |
285 |
|
case ProduceInterpols::NONE: |
286 |
|
return os << "ProduceInterpols::NONE"; |
287 |
|
case ProduceInterpols::ASSUMPTIONS: |
288 |
|
return os << "ProduceInterpols::ASSUMPTIONS"; |
289 |
|
case ProduceInterpols::ALL: |
290 |
|
return os << "ProduceInterpols::ALL"; |
291 |
|
case ProduceInterpols::SHARED: |
292 |
|
return os << "ProduceInterpols::SHARED"; |
293 |
|
default: |
294 |
|
Unreachable(); |
295 |
|
} |
296 |
|
return os; |
297 |
|
} |
298 |
|
|
299 |
11 |
ProduceInterpols stringToProduceInterpols(const std::string& optarg) |
300 |
|
{ |
301 |
11 |
if (optarg == "default") |
302 |
|
{ |
303 |
9 |
return ProduceInterpols::DEFAULT; |
304 |
|
} |
305 |
2 |
else if (optarg == "conjecture") |
306 |
|
{ |
307 |
2 |
return ProduceInterpols::CONJECTURE; |
308 |
|
} |
309 |
|
else if (optarg == "none") |
310 |
|
{ |
311 |
|
return ProduceInterpols::NONE; |
312 |
|
} |
313 |
|
else if (optarg == "assumptions") |
314 |
|
{ |
315 |
|
return ProduceInterpols::ASSUMPTIONS; |
316 |
|
} |
317 |
|
else if (optarg == "all") |
318 |
|
{ |
319 |
|
return ProduceInterpols::ALL; |
320 |
|
} |
321 |
|
else if (optarg == "shared") |
322 |
|
{ |
323 |
|
return ProduceInterpols::SHARED; |
324 |
|
} |
325 |
|
else if (optarg == "help") |
326 |
|
{ |
327 |
|
std::cerr << "Interpolants grammar mode\n" |
328 |
|
"Available modes for --produce-interpols are:\n" |
329 |
|
"+ default\n" |
330 |
|
" use the default grammar for the theory or the user-defined grammar if given\n" |
331 |
|
"+ conjecture\n" |
332 |
|
" use only operators that occur in the conjecture\n" |
333 |
|
"+ none (default)\n" |
334 |
|
" don't compute interpolants\n" |
335 |
|
"+ assumptions\n" |
336 |
|
" use only operators that occur in the assumptions\n" |
337 |
|
"+ all\n" |
338 |
|
" use only operators that occur either in the assumptions or the conjecture\n" |
339 |
|
"+ shared\n" |
340 |
|
" use only operators that occur both in the assumptions and the conjecture\n"; |
341 |
|
std::exit(1); |
342 |
|
} |
343 |
|
throw OptionException(std::string("unknown option for --produce-interpols: `") + |
344 |
|
optarg + "'. Try --produce-interpols=help."); |
345 |
|
} |
346 |
|
|
347 |
1 |
std::ostream& operator<<(std::ostream& os, SimplificationMode mode) |
348 |
|
{ |
349 |
1 |
switch(mode) { |
350 |
1 |
case SimplificationMode::NONE: |
351 |
1 |
return os << "SimplificationMode::NONE"; |
352 |
|
case SimplificationMode::BATCH: |
353 |
|
return os << "SimplificationMode::BATCH"; |
354 |
|
default: |
355 |
|
Unreachable(); |
356 |
|
} |
357 |
|
return os; |
358 |
|
} |
359 |
|
|
360 |
32 |
SimplificationMode stringToSimplificationMode(const std::string& optarg) |
361 |
|
{ |
362 |
32 |
if (optarg == "none") |
363 |
|
{ |
364 |
32 |
return SimplificationMode::NONE; |
365 |
|
} |
366 |
|
else if (optarg == "batch") |
367 |
|
{ |
368 |
|
return SimplificationMode::BATCH; |
369 |
|
} |
370 |
|
else if (optarg == "help") |
371 |
|
{ |
372 |
|
std::cerr << "Simplification modes.\n" |
373 |
|
"Available modes for --simplification are:\n" |
374 |
|
"+ none\n" |
375 |
|
" Do not perform nonclausal simplification.\n" |
376 |
|
"+ batch (default)\n" |
377 |
|
" Save up all ASSERTions; run nonclausal simplification and clausal (MiniSat)\n" |
378 |
|
" propagation for all of them only after reaching a querying command (CHECKSAT\n" |
379 |
|
" or QUERY or predicate SUBTYPE declaration).\n"; |
380 |
|
std::exit(1); |
381 |
|
} |
382 |
|
throw OptionException(std::string("unknown option for --simplification: `") + |
383 |
|
optarg + "'. Try --simplification=help."); |
384 |
|
} |
385 |
|
|
386 |
|
std::ostream& operator<<(std::ostream& os, SolveBVAsIntMode mode) |
387 |
|
{ |
388 |
|
switch(mode) { |
389 |
|
case SolveBVAsIntMode::IAND: |
390 |
|
return os << "SolveBVAsIntMode::IAND"; |
391 |
|
case SolveBVAsIntMode::SUM: |
392 |
|
return os << "SolveBVAsIntMode::SUM"; |
393 |
|
case SolveBVAsIntMode::OFF: |
394 |
|
return os << "SolveBVAsIntMode::OFF"; |
395 |
|
case SolveBVAsIntMode::BV: |
396 |
|
return os << "SolveBVAsIntMode::BV"; |
397 |
|
default: |
398 |
|
Unreachable(); |
399 |
|
} |
400 |
|
return os; |
401 |
|
} |
402 |
|
|
403 |
149 |
SolveBVAsIntMode stringToSolveBVAsIntMode(const std::string& optarg) |
404 |
|
{ |
405 |
149 |
if (optarg == "iand") |
406 |
|
{ |
407 |
33 |
return SolveBVAsIntMode::IAND; |
408 |
|
} |
409 |
116 |
else if (optarg == "sum") |
410 |
|
{ |
411 |
95 |
return SolveBVAsIntMode::SUM; |
412 |
|
} |
413 |
21 |
else if (optarg == "off") |
414 |
|
{ |
415 |
|
return SolveBVAsIntMode::OFF; |
416 |
|
} |
417 |
21 |
else if (optarg == "bv") |
418 |
|
{ |
419 |
21 |
return SolveBVAsIntMode::BV; |
420 |
|
} |
421 |
|
else if (optarg == "help") |
422 |
|
{ |
423 |
|
std::cerr << "solve-bv-as-int modes.\n" |
424 |
|
"Available modes for --solve-bv-as-int are:\n" |
425 |
|
"+ iand\n" |
426 |
|
" Translate bvand to the iand operator (experimental)\n" |
427 |
|
"+ sum\n" |
428 |
|
" Generate a sum expression for each bvand instance, based on the value in\n" |
429 |
|
" --solbv-bv-as-int-granularity\n" |
430 |
|
"+ off (default)\n" |
431 |
|
" Do not translate bit-vectors to integers\n" |
432 |
|
"+ bv\n" |
433 |
|
" Translate bvand back to bit-vectors\n"; |
434 |
|
std::exit(1); |
435 |
|
} |
436 |
|
throw OptionException(std::string("unknown option for --solve-bv-as-int: `") + |
437 |
|
optarg + "'. Try --solve-bv-as-int=help."); |
438 |
|
} |
439 |
|
|
440 |
|
std::ostream& operator<<(std::ostream& os, SygusSolutionOutMode mode) |
441 |
|
{ |
442 |
|
switch(mode) { |
443 |
|
case SygusSolutionOutMode::STATUS_OR_DEF: |
444 |
|
return os << "SygusSolutionOutMode::STATUS_OR_DEF"; |
445 |
|
case SygusSolutionOutMode::STATUS_AND_DEF: |
446 |
|
return os << "SygusSolutionOutMode::STATUS_AND_DEF"; |
447 |
|
case SygusSolutionOutMode::STANDARD: |
448 |
|
return os << "SygusSolutionOutMode::STANDARD"; |
449 |
|
case SygusSolutionOutMode::STATUS: |
450 |
|
return os << "SygusSolutionOutMode::STATUS"; |
451 |
|
default: |
452 |
|
Unreachable(); |
453 |
|
} |
454 |
|
return os; |
455 |
|
} |
456 |
|
|
457 |
182 |
SygusSolutionOutMode stringToSygusSolutionOutMode(const std::string& optarg) |
458 |
|
{ |
459 |
182 |
if (optarg == "status-or-def") |
460 |
|
{ |
461 |
|
return SygusSolutionOutMode::STATUS_OR_DEF; |
462 |
|
} |
463 |
182 |
else if (optarg == "status-and-def") |
464 |
|
{ |
465 |
|
return SygusSolutionOutMode::STATUS_AND_DEF; |
466 |
|
} |
467 |
182 |
else if (optarg == "sygus-standard") |
468 |
|
{ |
469 |
|
return SygusSolutionOutMode::STANDARD; |
470 |
|
} |
471 |
182 |
else if (optarg == "status") |
472 |
|
{ |
473 |
182 |
return SygusSolutionOutMode::STATUS; |
474 |
|
} |
475 |
|
else if (optarg == "help") |
476 |
|
{ |
477 |
|
std::cerr << "Modes for sygus solution output.\n" |
478 |
|
"Available modes for --sygus-out are:\n" |
479 |
|
"+ status-or-def\n" |
480 |
|
" Print status if infeasible, or definition corresponding to solution if\n" |
481 |
|
" feasible.\n" |
482 |
|
"+ status-and-def\n" |
483 |
|
" Print status followed by definition corresponding to solution.\n" |
484 |
|
"+ sygus-standard (default)\n" |
485 |
|
" Print based on SyGuS standard.\n" |
486 |
|
"+ status\n" |
487 |
|
" Print only status for check-synth calls.\n"; |
488 |
|
std::exit(1); |
489 |
|
} |
490 |
|
throw OptionException(std::string("unknown option for --sygus-out: `") + |
491 |
|
optarg + "'. Try --sygus-out=help."); |
492 |
|
} |
493 |
|
|
494 |
|
std::ostream& operator<<(std::ostream& os, UnsatCoresMode mode) |
495 |
|
{ |
496 |
|
switch(mode) { |
497 |
|
case UnsatCoresMode::SAT_PROOF: |
498 |
|
return os << "UnsatCoresMode::SAT_PROOF"; |
499 |
|
case UnsatCoresMode::FULL_PROOF: |
500 |
|
return os << "UnsatCoresMode::FULL_PROOF"; |
501 |
|
case UnsatCoresMode::OFF: |
502 |
|
return os << "UnsatCoresMode::OFF"; |
503 |
|
case UnsatCoresMode::ASSUMPTIONS: |
504 |
|
return os << "UnsatCoresMode::ASSUMPTIONS"; |
505 |
|
default: |
506 |
|
Unreachable(); |
507 |
|
} |
508 |
|
return os; |
509 |
|
} |
510 |
|
|
511 |
2 |
UnsatCoresMode stringToUnsatCoresMode(const std::string& optarg) |
512 |
|
{ |
513 |
2 |
if (optarg == "sat-proof") |
514 |
|
{ |
515 |
2 |
return UnsatCoresMode::SAT_PROOF; |
516 |
|
} |
517 |
|
else if (optarg == "full-proof") |
518 |
|
{ |
519 |
|
return UnsatCoresMode::FULL_PROOF; |
520 |
|
} |
521 |
|
else if (optarg == "off") |
522 |
|
{ |
523 |
|
return UnsatCoresMode::OFF; |
524 |
|
} |
525 |
|
else if (optarg == "assumptions") |
526 |
|
{ |
527 |
|
return UnsatCoresMode::ASSUMPTIONS; |
528 |
|
} |
529 |
|
else if (optarg == "help") |
530 |
|
{ |
531 |
|
std::cerr << "unsat cores modes.\n" |
532 |
|
"Available modes for --unsat-cores-mode are:\n" |
533 |
|
"+ sat-proof\n" |
534 |
|
" Produce unsat cores from SAT and preprocessing proofs.\n" |
535 |
|
"+ full-proof\n" |
536 |
|
" Produce unsat cores from full proofs.\n" |
537 |
|
"+ off (default)\n" |
538 |
|
" Do not produce unsat cores.\n" |
539 |
|
"+ assumptions\n" |
540 |
|
" Produce unsat cores using solving under assumptions and preprocessing proofs.\n"; |
541 |
|
std::exit(1); |
542 |
|
} |
543 |
|
throw OptionException(std::string("unknown option for --unsat-cores-mode: `") + |
544 |
|
optarg + "'. Try --unsat-cores-mode=help."); |
545 |
|
} |
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
namespace smt |
550 |
|
{ |
551 |
|
// clang-format off |
552 |
|
void setDefaultAbstractValues(Options& opts, bool value) |
553 |
|
{ |
554 |
|
if (!opts.smt.abstractValuesWasSetByUser) { |
555 |
|
opts.smt.abstractValues = value; |
556 |
|
} |
557 |
|
} |
558 |
|
void setDefaultAckermann(Options& opts, bool value) |
559 |
|
{ |
560 |
|
if (!opts.smt.ackermannWasSetByUser) { |
561 |
|
opts.smt.ackermann = value; |
562 |
|
} |
563 |
|
} |
564 |
|
void setDefaultBlockModelsMode(Options& opts, BlockModelsMode value) |
565 |
|
{ |
566 |
|
if (!opts.smt.blockModelsModeWasSetByUser) { |
567 |
|
opts.smt.blockModelsMode = value; |
568 |
|
} |
569 |
|
} |
570 |
|
void setDefaultBVAndIntegerGranularity(Options& opts, uint64_t value) |
571 |
|
{ |
572 |
|
if (!opts.smt.BVAndIntegerGranularityWasSetByUser) { |
573 |
|
opts.smt.BVAndIntegerGranularity = value; |
574 |
|
} |
575 |
|
} |
576 |
|
void setDefaultCheckAbducts(Options& opts, bool value) |
577 |
|
{ |
578 |
|
if (!opts.smt.checkAbductsWasSetByUser) { |
579 |
|
opts.smt.checkAbducts = value; |
580 |
|
} |
581 |
|
} |
582 |
|
void setDefaultCheckInterpols(Options& opts, bool value) |
583 |
|
{ |
584 |
|
if (!opts.smt.checkInterpolsWasSetByUser) { |
585 |
|
opts.smt.checkInterpols = value; |
586 |
|
} |
587 |
|
} |
588 |
|
void setDefaultCheckModels(Options& opts, bool value) |
589 |
|
{ |
590 |
|
if (!opts.smt.checkModelsWasSetByUser) { |
591 |
|
opts.smt.checkModels = value; |
592 |
|
} |
593 |
|
} |
594 |
|
void setDefaultCheckProofs(Options& opts, bool value) |
595 |
|
{ |
596 |
|
if (!opts.smt.checkProofsWasSetByUser) { |
597 |
|
opts.smt.checkProofs = value; |
598 |
|
} |
599 |
|
} |
600 |
|
void setDefaultCheckSynthSol(Options& opts, bool value) |
601 |
|
{ |
602 |
|
if (!opts.smt.checkSynthSolWasSetByUser) { |
603 |
|
opts.smt.checkSynthSol = value; |
604 |
|
} |
605 |
|
} |
606 |
|
void setDefaultCheckUnsatCores(Options& opts, bool value) |
607 |
|
{ |
608 |
|
if (!opts.smt.checkUnsatCoresWasSetByUser) { |
609 |
|
opts.smt.checkUnsatCores = value; |
610 |
|
} |
611 |
|
} |
612 |
|
void setDefaultDebugCheckModels(Options& opts, bool value) |
613 |
|
{ |
614 |
|
if (!opts.smt.debugCheckModelsWasSetByUser) { |
615 |
|
opts.smt.debugCheckModels = value; |
616 |
|
} |
617 |
|
} |
618 |
|
void setDefaultDumpToFileName(Options& opts, ManagedOut value) |
619 |
|
{ |
620 |
|
if (!opts.smt.dumpToFileNameWasSetByUser) { |
621 |
|
opts.smt.dumpToFileName = value; |
622 |
|
} |
623 |
|
} |
624 |
|
void setDefaultDumpModeString(Options& opts, std::string value) |
625 |
|
{ |
626 |
|
if (!opts.smt.dumpModeStringWasSetByUser) { |
627 |
|
opts.smt.dumpModeString = value; |
628 |
|
} |
629 |
|
} |
630 |
|
void setDefaultEarlyIteRemoval(Options& opts, bool value) |
631 |
|
{ |
632 |
|
if (!opts.smt.earlyIteRemovalWasSetByUser) { |
633 |
|
opts.smt.earlyIteRemoval = value; |
634 |
|
} |
635 |
|
} |
636 |
|
void setDefaultExpandDefinitions(Options& opts, bool value) |
637 |
|
{ |
638 |
|
if (!opts.smt.expandDefinitionsWasSetByUser) { |
639 |
|
opts.smt.expandDefinitions = value; |
640 |
|
} |
641 |
|
} |
642 |
|
void setDefaultExtRewPrep(Options& opts, bool value) |
643 |
|
{ |
644 |
|
if (!opts.smt.extRewPrepWasSetByUser) { |
645 |
|
opts.smt.extRewPrep = value; |
646 |
|
} |
647 |
|
} |
648 |
|
void setDefaultExtRewPrepAgg(Options& opts, bool value) |
649 |
|
{ |
650 |
|
if (!opts.smt.extRewPrepAggWasSetByUser) { |
651 |
|
opts.smt.extRewPrepAgg = value; |
652 |
|
} |
653 |
|
} |
654 |
|
void setDefaultForeignTheoryRewrite(Options& opts, bool value) |
655 |
|
{ |
656 |
|
if (!opts.smt.foreignTheoryRewriteWasSetByUser) { |
657 |
|
opts.smt.foreignTheoryRewrite = value; |
658 |
|
} |
659 |
|
} |
660 |
|
void setDefaultIandMode(Options& opts, IandMode value) |
661 |
|
{ |
662 |
|
if (!opts.smt.iandModeWasSetByUser) { |
663 |
|
opts.smt.iandMode = value; |
664 |
|
} |
665 |
|
} |
666 |
|
void setDefaultInteractiveMode(Options& opts, bool value) |
667 |
|
{ |
668 |
|
if (!opts.smt.interactiveModeWasSetByUser) { |
669 |
|
opts.smt.interactiveMode = value; |
670 |
|
} |
671 |
|
} |
672 |
|
void setDefaultDoITESimp(Options& opts, bool value) |
673 |
|
{ |
674 |
|
if (!opts.smt.doITESimpWasSetByUser) { |
675 |
|
opts.smt.doITESimp = value; |
676 |
|
} |
677 |
|
} |
678 |
|
void setDefaultLearnedRewrite(Options& opts, bool value) |
679 |
|
{ |
680 |
|
if (!opts.smt.learnedRewriteWasSetByUser) { |
681 |
|
opts.smt.learnedRewrite = value; |
682 |
|
} |
683 |
|
} |
684 |
|
void setDefaultMinimalUnsatCores(Options& opts, bool value) |
685 |
|
{ |
686 |
|
if (!opts.smt.minimalUnsatCoresWasSetByUser) { |
687 |
|
opts.smt.minimalUnsatCores = value; |
688 |
|
} |
689 |
|
} |
690 |
|
void setDefaultModelCoresMode(Options& opts, ModelCoresMode value) |
691 |
|
{ |
692 |
|
if (!opts.smt.modelCoresModeWasSetByUser) { |
693 |
|
opts.smt.modelCoresMode = value; |
694 |
|
} |
695 |
|
} |
696 |
|
void setDefaultModelUninterpPrint(Options& opts, ModelUninterpPrintMode value) |
697 |
|
{ |
698 |
|
if (!opts.smt.modelUninterpPrintWasSetByUser) { |
699 |
|
opts.smt.modelUninterpPrint = value; |
700 |
|
} |
701 |
|
} |
702 |
|
void setDefaultModelWitnessValue(Options& opts, bool value) |
703 |
|
{ |
704 |
|
if (!opts.smt.modelWitnessValueWasSetByUser) { |
705 |
|
opts.smt.modelWitnessValue = value; |
706 |
|
} |
707 |
|
} |
708 |
|
void setDefaultDoITESimpOnRepeat(Options& opts, bool value) |
709 |
|
{ |
710 |
|
if (!opts.smt.doITESimpOnRepeatWasSetByUser) { |
711 |
|
opts.smt.doITESimpOnRepeat = value; |
712 |
|
} |
713 |
|
} |
714 |
|
void setDefaultProduceAbducts(Options& opts, bool value) |
715 |
|
{ |
716 |
|
if (!opts.smt.produceAbductsWasSetByUser) { |
717 |
|
opts.smt.produceAbducts = value; |
718 |
|
} |
719 |
|
} |
720 |
|
void setDefaultProduceAssertions(Options& opts, bool value) |
721 |
|
{ |
722 |
|
if (!opts.smt.produceAssertionsWasSetByUser) { |
723 |
|
opts.smt.produceAssertions = value; |
724 |
|
} |
725 |
|
} |
726 |
|
void setDefaultProduceAssignments(Options& opts, bool value) |
727 |
|
{ |
728 |
|
if (!opts.smt.produceAssignmentsWasSetByUser) { |
729 |
|
opts.smt.produceAssignments = value; |
730 |
|
} |
731 |
|
} |
732 |
|
void setDefaultProduceInterpols(Options& opts, ProduceInterpols value) |
733 |
|
{ |
734 |
|
if (!opts.smt.produceInterpolsWasSetByUser) { |
735 |
|
opts.smt.produceInterpols = value; |
736 |
|
} |
737 |
|
} |
738 |
|
void setDefaultProduceModels(Options& opts, bool value) |
739 |
|
{ |
740 |
|
if (!opts.smt.produceModelsWasSetByUser) { |
741 |
|
opts.smt.produceModels = value; |
742 |
|
} |
743 |
|
} |
744 |
|
void setDefaultProduceProofs(Options& opts, bool value) |
745 |
|
{ |
746 |
|
if (!opts.smt.produceProofsWasSetByUser) { |
747 |
|
opts.smt.produceProofs = value; |
748 |
|
} |
749 |
|
} |
750 |
|
void setDefaultUnsatAssumptions(Options& opts, bool value) |
751 |
|
{ |
752 |
|
if (!opts.smt.unsatAssumptionsWasSetByUser) { |
753 |
|
opts.smt.unsatAssumptions = value; |
754 |
|
} |
755 |
|
} |
756 |
|
void setDefaultUnsatCores(Options& opts, bool value) |
757 |
|
{ |
758 |
|
if (!opts.smt.unsatCoresWasSetByUser) { |
759 |
|
opts.smt.unsatCores = value; |
760 |
|
} |
761 |
|
} |
762 |
|
void setDefaultRepeatSimp(Options& opts, bool value) |
763 |
|
{ |
764 |
|
if (!opts.smt.repeatSimpWasSetByUser) { |
765 |
|
opts.smt.repeatSimp = value; |
766 |
|
} |
767 |
|
} |
768 |
|
void setDefaultCompressItes(Options& opts, bool value) |
769 |
|
{ |
770 |
|
if (!opts.smt.compressItesWasSetByUser) { |
771 |
|
opts.smt.compressItes = value; |
772 |
|
} |
773 |
|
} |
774 |
|
void setDefaultZombieHuntThreshold(Options& opts, uint64_t value) |
775 |
|
{ |
776 |
|
if (!opts.smt.zombieHuntThresholdWasSetByUser) { |
777 |
|
opts.smt.zombieHuntThreshold = value; |
778 |
|
} |
779 |
|
} |
780 |
|
void setDefaultSimplifyWithCareEnabled(Options& opts, bool value) |
781 |
|
{ |
782 |
|
if (!opts.smt.simplifyWithCareEnabledWasSetByUser) { |
783 |
|
opts.smt.simplifyWithCareEnabled = value; |
784 |
|
} |
785 |
|
} |
786 |
|
void setDefaultSimplificationMode(Options& opts, SimplificationMode value) |
787 |
|
{ |
788 |
|
if (!opts.smt.simplificationModeWasSetByUser) { |
789 |
|
opts.smt.simplificationMode = value; |
790 |
|
} |
791 |
|
} |
792 |
|
void setDefaultSolveBVAsInt(Options& opts, SolveBVAsIntMode value) |
793 |
|
{ |
794 |
|
if (!opts.smt.solveBVAsIntWasSetByUser) { |
795 |
|
opts.smt.solveBVAsInt = value; |
796 |
|
} |
797 |
|
} |
798 |
|
void setDefaultSolveIntAsBV(Options& opts, uint64_t value) |
799 |
|
{ |
800 |
|
if (!opts.smt.solveIntAsBVWasSetByUser) { |
801 |
|
opts.smt.solveIntAsBV = value; |
802 |
|
} |
803 |
|
} |
804 |
|
void setDefaultSolveRealAsInt(Options& opts, bool value) |
805 |
|
{ |
806 |
|
if (!opts.smt.solveRealAsIntWasSetByUser) { |
807 |
|
opts.smt.solveRealAsInt = value; |
808 |
|
} |
809 |
|
} |
810 |
|
void setDefaultSortInference(Options& opts, bool value) |
811 |
|
{ |
812 |
|
if (!opts.smt.sortInferenceWasSetByUser) { |
813 |
|
opts.smt.sortInference = value; |
814 |
|
} |
815 |
|
} |
816 |
|
void setDefaultDoStaticLearning(Options& opts, bool value) |
817 |
|
{ |
818 |
|
if (!opts.smt.doStaticLearningWasSetByUser) { |
819 |
|
opts.smt.doStaticLearning = value; |
820 |
|
} |
821 |
|
} |
822 |
|
void setDefaultSygusOut(Options& opts, SygusSolutionOutMode value) |
823 |
|
{ |
824 |
|
if (!opts.smt.sygusOutWasSetByUser) { |
825 |
|
opts.smt.sygusOut = value; |
826 |
|
} |
827 |
|
} |
828 |
|
void setDefaultSygusPrintCallbacks(Options& opts, bool value) |
829 |
|
{ |
830 |
|
if (!opts.smt.sygusPrintCallbacksWasSetByUser) { |
831 |
|
opts.smt.sygusPrintCallbacks = value; |
832 |
|
} |
833 |
|
} |
834 |
|
void setDefaultUnconstrainedSimp(Options& opts, bool value) |
835 |
|
{ |
836 |
|
if (!opts.smt.unconstrainedSimpWasSetByUser) { |
837 |
|
opts.smt.unconstrainedSimp = value; |
838 |
|
} |
839 |
|
} |
840 |
|
void setDefaultUnsatCoresMode(Options& opts, UnsatCoresMode value) |
841 |
|
{ |
842 |
|
if (!opts.smt.unsatCoresModeWasSetByUser) { |
843 |
|
opts.smt.unsatCoresMode = value; |
844 |
|
} |
845 |
|
} |
846 |
|
// clang-format on |
847 |
|
} |
848 |
|
|
849 |
|
} // namespace options |
850 |
29322 |
} // namespace cvc5 |
851 |
|
// clang-format on |