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/quantifiers_options.h" |
19 |
|
|
20 |
|
#include <iostream> |
21 |
|
|
22 |
|
#include "base/check.h" |
23 |
|
#include "options/option_exception.h" |
24 |
|
|
25 |
|
namespace cvc5::options { |
26 |
|
|
27 |
|
// clang-format off |
28 |
|
std::ostream& operator<<(std::ostream& os, CegisSampleMode mode) |
29 |
|
{ |
30 |
|
switch(mode) |
31 |
|
{ |
32 |
|
case CegisSampleMode::USE: return os << "use"; |
33 |
|
case CegisSampleMode::NONE: return os << "none"; |
34 |
|
case CegisSampleMode::TRUST: return os << "trust"; |
35 |
|
default: Unreachable(); |
36 |
|
} |
37 |
|
return os; |
38 |
|
} |
39 |
5 |
CegisSampleMode stringToCegisSampleMode(const std::string& optarg) |
40 |
|
{ |
41 |
5 |
if (optarg == "use") return CegisSampleMode::USE; |
42 |
1 |
else if (optarg == "none") return CegisSampleMode::NONE; |
43 |
1 |
else if (optarg == "trust") return CegisSampleMode::TRUST; |
44 |
|
else if (optarg == "help") |
45 |
|
{ |
46 |
|
std::cerr << R"FOOBAR( |
47 |
|
Modes for sampling with counterexample-guided inductive synthesis (CEGIS). |
48 |
|
Available modes for --cegis-sample are: |
49 |
|
+ use |
50 |
|
Use sampling to accelerate CEGIS. This will rule out solutions for a |
51 |
|
conjecture when they are not satisfied by a sample point. |
52 |
|
+ none (default) |
53 |
|
Do not use sampling with CEGIS. |
54 |
|
+ trust |
55 |
|
Trust that when a solution for a conjecture is always true under sampling, |
56 |
|
then it is indeed a solution. Note this option may print out spurious |
57 |
|
solutions for synthesis conjectures. |
58 |
|
)FOOBAR"; |
59 |
|
std::exit(1); |
60 |
|
} |
61 |
|
throw OptionException(std::string("unknown option for --cegis-sample: `") + |
62 |
|
optarg + "'. Try --cegis-sample=help."); |
63 |
|
} |
64 |
|
std::ostream& operator<<(std::ostream& os, CegqiBvIneqMode mode) |
65 |
|
{ |
66 |
|
switch(mode) |
67 |
|
{ |
68 |
|
case CegqiBvIneqMode::EQ_BOUNDARY: return os << "eq-boundary"; |
69 |
|
case CegqiBvIneqMode::EQ_SLACK: return os << "eq-slack"; |
70 |
|
case CegqiBvIneqMode::KEEP: return os << "keep"; |
71 |
|
default: Unreachable(); |
72 |
|
} |
73 |
|
return os; |
74 |
|
} |
75 |
82 |
CegqiBvIneqMode stringToCegqiBvIneqMode(const std::string& optarg) |
76 |
|
{ |
77 |
82 |
if (optarg == "eq-boundary") return CegqiBvIneqMode::EQ_BOUNDARY; |
78 |
79 |
else if (optarg == "eq-slack") return CegqiBvIneqMode::EQ_SLACK; |
79 |
79 |
else if (optarg == "keep") return CegqiBvIneqMode::KEEP; |
80 |
|
else if (optarg == "help") |
81 |
|
{ |
82 |
|
std::cerr << R"FOOBAR( |
83 |
|
Modes for handling bit-vector inequalities in counterexample-guided |
84 |
|
instantiation. |
85 |
|
Available modes for --cegqi-bv-ineq are: |
86 |
|
+ eq-boundary (default) |
87 |
|
Solve for the boundary point of the inequality, e.g., t > s becomes t = s+1. |
88 |
|
+ eq-slack |
89 |
|
Solve for the inequality using the slack value in the model, e.g., t > s |
90 |
|
becomes t = s + ( t-s )^M. |
91 |
|
+ keep |
92 |
|
Solve for the inequality directly using side conditions for invertibility. |
93 |
|
)FOOBAR"; |
94 |
|
std::exit(1); |
95 |
|
} |
96 |
|
throw OptionException(std::string("unknown option for --cegqi-bv-ineq: `") + |
97 |
|
optarg + "'. Try --cegqi-bv-ineq=help."); |
98 |
|
} |
99 |
|
std::ostream& operator<<(std::ostream& os, InstWhenMode mode) |
100 |
|
{ |
101 |
|
switch(mode) |
102 |
|
{ |
103 |
|
case InstWhenMode::FULL_DELAY: return os << "full-delay"; |
104 |
|
case InstWhenMode::FULL_DELAY_LAST_CALL: return os << "full-delay-last-call"; |
105 |
|
case InstWhenMode::LAST_CALL: return os << "last-call"; |
106 |
|
case InstWhenMode::FULL_LAST_CALL: return os << "full-last-call"; |
107 |
|
case InstWhenMode::FULL: return os << "full"; |
108 |
|
default: Unreachable(); |
109 |
|
} |
110 |
|
return os; |
111 |
|
} |
112 |
3 |
InstWhenMode stringToInstWhenMode(const std::string& optarg) |
113 |
|
{ |
114 |
3 |
if (optarg == "full-delay") return InstWhenMode::FULL_DELAY; |
115 |
3 |
else if (optarg == "full-delay-last-call") return InstWhenMode::FULL_DELAY_LAST_CALL; |
116 |
3 |
else if (optarg == "last-call") return InstWhenMode::LAST_CALL; |
117 |
3 |
else if (optarg == "full-last-call") return InstWhenMode::FULL_LAST_CALL; |
118 |
3 |
else if (optarg == "full") return InstWhenMode::FULL; |
119 |
|
else if (optarg == "help") |
120 |
|
{ |
121 |
|
std::cerr << R"FOOBAR( |
122 |
|
Instantiation modes. |
123 |
|
Available modes for --inst-when are: |
124 |
|
+ full-delay |
125 |
|
Run instantiation round at full effort, before theory combination, after all |
126 |
|
other theories have finished. |
127 |
|
+ full-delay-last-call |
128 |
|
Alternate running instantiation rounds at full effort after all other theories |
129 |
|
have finished, and last call. |
130 |
|
+ last-call |
131 |
|
Run instantiation at last call effort, after theory combination and and |
132 |
|
theories report sat. |
133 |
|
+ full-last-call (default) |
134 |
|
Alternate running instantiation rounds at full effort and last call. In other |
135 |
|
words, interleave instantiation and theory combination. |
136 |
|
+ full |
137 |
|
Run instantiation round at full effort, before theory combination. |
138 |
|
)FOOBAR"; |
139 |
|
std::exit(1); |
140 |
|
} |
141 |
|
throw OptionException(std::string("unknown option for --inst-when: `") + |
142 |
|
optarg + "'. Try --inst-when=help."); |
143 |
|
} |
144 |
|
std::ostream& operator<<(std::ostream& os, IteLiftQuantMode mode) |
145 |
|
{ |
146 |
|
switch(mode) |
147 |
|
{ |
148 |
|
case IteLiftQuantMode::SIMPLE: return os << "simple"; |
149 |
|
case IteLiftQuantMode::NONE: return os << "none"; |
150 |
|
case IteLiftQuantMode::ALL: return os << "all"; |
151 |
|
default: Unreachable(); |
152 |
|
} |
153 |
|
return os; |
154 |
|
} |
155 |
|
IteLiftQuantMode stringToIteLiftQuantMode(const std::string& optarg) |
156 |
|
{ |
157 |
|
if (optarg == "simple") return IteLiftQuantMode::SIMPLE; |
158 |
|
else if (optarg == "none") return IteLiftQuantMode::NONE; |
159 |
|
else if (optarg == "all") return IteLiftQuantMode::ALL; |
160 |
|
else if (optarg == "help") |
161 |
|
{ |
162 |
|
std::cerr << R"FOOBAR( |
163 |
|
ITE lifting modes for quantified formulas. |
164 |
|
Available modes for --ite-lift-quant are: |
165 |
|
+ simple (default) |
166 |
|
Lift if-then-else in quantified formulas if results in smaller term size. |
167 |
|
+ none |
168 |
|
Do not lift if-then-else in quantified formulas. |
169 |
|
+ all |
170 |
|
Lift if-then-else in quantified formulas. |
171 |
|
)FOOBAR"; |
172 |
|
std::exit(1); |
173 |
|
} |
174 |
|
throw OptionException(std::string("unknown option for --ite-lift-quant: `") + |
175 |
|
optarg + "'. Try --ite-lift-quant=help."); |
176 |
|
} |
177 |
|
std::ostream& operator<<(std::ostream& os, LiteralMatchMode mode) |
178 |
|
{ |
179 |
|
switch(mode) |
180 |
|
{ |
181 |
|
case LiteralMatchMode::AGG_PREDICATE: return os << "agg-predicate"; |
182 |
|
case LiteralMatchMode::USE: return os << "use"; |
183 |
|
case LiteralMatchMode::AGG: return os << "agg"; |
184 |
|
case LiteralMatchMode::NONE: return os << "none"; |
185 |
|
default: Unreachable(); |
186 |
|
} |
187 |
|
return os; |
188 |
|
} |
189 |
|
LiteralMatchMode stringToLiteralMatchMode(const std::string& optarg) |
190 |
|
{ |
191 |
|
if (optarg == "agg-predicate") return LiteralMatchMode::AGG_PREDICATE; |
192 |
|
else if (optarg == "use") return LiteralMatchMode::USE; |
193 |
|
else if (optarg == "agg") return LiteralMatchMode::AGG; |
194 |
|
else if (optarg == "none") return LiteralMatchMode::NONE; |
195 |
|
else if (optarg == "help") |
196 |
|
{ |
197 |
|
std::cerr << R"FOOBAR( |
198 |
|
Literal match modes. |
199 |
|
Available modes for --literal-matching are: |
200 |
|
+ agg-predicate |
201 |
|
Consider phase requirements aggressively for predicates. In the above example, |
202 |
|
only match P( x ) with terms that are in the equivalence class of false. |
203 |
|
+ use (default) |
204 |
|
Consider phase requirements of triggers conservatively. For example, the |
205 |
|
trigger P( x ) in forall( x ). ( P( x ) V ~Q( x ) ) will not be matched with |
206 |
|
terms in the equivalence class of true, and likewise Q( x ) will not be |
207 |
|
matched terms in the equivalence class of false. Extends to equality. |
208 |
|
+ agg |
209 |
|
Consider the phase requirements aggressively for all triggers. |
210 |
|
+ none |
211 |
|
Do not use literal matching. |
212 |
|
)FOOBAR"; |
213 |
|
std::exit(1); |
214 |
|
} |
215 |
|
throw OptionException(std::string("unknown option for --literal-matching: `") + |
216 |
|
optarg + "'. Try --literal-matching=help."); |
217 |
|
} |
218 |
|
std::ostream& operator<<(std::ostream& os, MacrosQuantMode mode) |
219 |
|
{ |
220 |
|
switch(mode) |
221 |
|
{ |
222 |
|
case MacrosQuantMode::GROUND_UF: return os << "ground-uf"; |
223 |
|
case MacrosQuantMode::GROUND: return os << "ground"; |
224 |
|
case MacrosQuantMode::ALL: return os << "all"; |
225 |
|
default: Unreachable(); |
226 |
|
} |
227 |
|
return os; |
228 |
|
} |
229 |
2 |
MacrosQuantMode stringToMacrosQuantMode(const std::string& optarg) |
230 |
|
{ |
231 |
2 |
if (optarg == "ground-uf") return MacrosQuantMode::GROUND_UF; |
232 |
2 |
else if (optarg == "ground") return MacrosQuantMode::GROUND; |
233 |
|
else if (optarg == "all") return MacrosQuantMode::ALL; |
234 |
|
else if (optarg == "help") |
235 |
|
{ |
236 |
|
std::cerr << R"FOOBAR( |
237 |
|
Modes for quantifiers macro expansion. |
238 |
|
Available modes for --macros-quant-mode are: |
239 |
|
+ ground-uf (default) |
240 |
|
Only infer ground definitions for functions that result in triggers for all |
241 |
|
free variables. |
242 |
|
+ ground |
243 |
|
Only infer ground definitions for functions. |
244 |
|
+ all |
245 |
|
Infer definitions for functions, including those containing quantified |
246 |
|
formulas. |
247 |
|
)FOOBAR"; |
248 |
|
std::exit(1); |
249 |
|
} |
250 |
|
throw OptionException(std::string("unknown option for --macros-quant-mode: `") + |
251 |
|
optarg + "'. Try --macros-quant-mode=help."); |
252 |
|
} |
253 |
|
std::ostream& operator<<(std::ostream& os, MbqiMode mode) |
254 |
|
{ |
255 |
|
switch(mode) |
256 |
|
{ |
257 |
|
case MbqiMode::FMC: return os << "fmc"; |
258 |
|
case MbqiMode::NONE: return os << "none"; |
259 |
|
case MbqiMode::TRUST: return os << "trust"; |
260 |
|
default: Unreachable(); |
261 |
|
} |
262 |
|
return os; |
263 |
|
} |
264 |
|
MbqiMode stringToMbqiMode(const std::string& optarg) |
265 |
|
{ |
266 |
|
if (optarg == "fmc") return MbqiMode::FMC; |
267 |
|
else if (optarg == "none") return MbqiMode::NONE; |
268 |
|
else if (optarg == "trust") return MbqiMode::TRUST; |
269 |
|
else if (optarg == "help") |
270 |
|
{ |
271 |
|
std::cerr << R"FOOBAR( |
272 |
|
Model-based quantifier instantiation modes. |
273 |
|
Available modes for --mbqi are: |
274 |
|
+ fmc (default) |
275 |
|
Use algorithm from Section 5.4.2 of thesis Finite Model Finding in |
276 |
|
Satisfiability Modulo Theories. |
277 |
|
+ none |
278 |
|
Disable model-based quantifier instantiation. |
279 |
|
+ trust |
280 |
|
Do not instantiate quantified formulas (incomplete technique). |
281 |
|
)FOOBAR"; |
282 |
|
std::exit(1); |
283 |
|
} |
284 |
|
throw OptionException(std::string("unknown option for --mbqi: `") + |
285 |
|
optarg + "'. Try --mbqi=help."); |
286 |
|
} |
287 |
|
std::ostream& operator<<(std::ostream& os, PrenexQuantMode mode) |
288 |
|
{ |
289 |
|
switch(mode) |
290 |
|
{ |
291 |
|
case PrenexQuantMode::SIMPLE: return os << "simple"; |
292 |
|
case PrenexQuantMode::NONE: return os << "none"; |
293 |
|
case PrenexQuantMode::NORMAL: return os << "norm"; |
294 |
|
default: Unreachable(); |
295 |
|
} |
296 |
|
return os; |
297 |
|
} |
298 |
|
PrenexQuantMode stringToPrenexQuantMode(const std::string& optarg) |
299 |
|
{ |
300 |
|
if (optarg == "simple") return PrenexQuantMode::SIMPLE; |
301 |
|
else if (optarg == "none") return PrenexQuantMode::NONE; |
302 |
|
else if (optarg == "norm") return PrenexQuantMode::NORMAL; |
303 |
|
else if (optarg == "help") |
304 |
|
{ |
305 |
|
std::cerr << R"FOOBAR( |
306 |
|
Prenex quantifiers modes. |
307 |
|
Available modes for --prenex-quant are: |
308 |
|
+ simple (default) |
309 |
|
Do simple prenexing of same sign quantifiers. |
310 |
|
+ none |
311 |
|
Do no prenex nested quantifiers. |
312 |
|
+ norm |
313 |
|
Prenex to prenex normal form. |
314 |
|
)FOOBAR"; |
315 |
|
std::exit(1); |
316 |
|
} |
317 |
|
throw OptionException(std::string("unknown option for --prenex-quant: `") + |
318 |
|
optarg + "'. Try --prenex-quant=help."); |
319 |
|
} |
320 |
|
std::ostream& operator<<(std::ostream& os, QcfMode mode) |
321 |
|
{ |
322 |
|
switch(mode) |
323 |
|
{ |
324 |
|
case QcfMode::PARTIAL: return os << "partial"; |
325 |
|
case QcfMode::CONFLICT_ONLY: return os << "conflict"; |
326 |
|
case QcfMode::PROP_EQ: return os << "prop-eq"; |
327 |
|
default: Unreachable(); |
328 |
|
} |
329 |
|
return os; |
330 |
|
} |
331 |
|
QcfMode stringToQcfMode(const std::string& optarg) |
332 |
|
{ |
333 |
|
if (optarg == "partial") return QcfMode::PARTIAL; |
334 |
|
else if (optarg == "conflict") return QcfMode::CONFLICT_ONLY; |
335 |
|
else if (optarg == "prop-eq") return QcfMode::PROP_EQ; |
336 |
|
else if (optarg == "help") |
337 |
|
{ |
338 |
|
std::cerr << R"FOOBAR( |
339 |
|
Quantifier conflict find modes. |
340 |
|
Available modes for --quant-cf-mode are: |
341 |
|
+ partial |
342 |
|
Use QCF for conflicts, propagations and heuristic instantiations. |
343 |
|
+ conflict |
344 |
|
Apply QCF algorithm to find conflicts only. |
345 |
|
+ prop-eq (default) |
346 |
|
Apply QCF algorithm to propagate equalities as well as conflicts. |
347 |
|
)FOOBAR"; |
348 |
|
std::exit(1); |
349 |
|
} |
350 |
|
throw OptionException(std::string("unknown option for --quant-cf-mode: `") + |
351 |
|
optarg + "'. Try --quant-cf-mode=help."); |
352 |
|
} |
353 |
|
std::ostream& operator<<(std::ostream& os, QcfWhenMode mode) |
354 |
|
{ |
355 |
|
switch(mode) |
356 |
|
{ |
357 |
|
case QcfWhenMode::STD: return os << "std"; |
358 |
|
case QcfWhenMode::DEFAULT: return os << "default"; |
359 |
|
case QcfWhenMode::STD_H: return os << "std-h"; |
360 |
|
case QcfWhenMode::LAST_CALL: return os << "last-call"; |
361 |
|
default: Unreachable(); |
362 |
|
} |
363 |
|
return os; |
364 |
|
} |
365 |
|
QcfWhenMode stringToQcfWhenMode(const std::string& optarg) |
366 |
|
{ |
367 |
|
if (optarg == "std") return QcfWhenMode::STD; |
368 |
|
else if (optarg == "default") return QcfWhenMode::DEFAULT; |
369 |
|
else if (optarg == "std-h") return QcfWhenMode::STD_H; |
370 |
|
else if (optarg == "last-call") return QcfWhenMode::LAST_CALL; |
371 |
|
else if (optarg == "help") |
372 |
|
{ |
373 |
|
std::cerr << R"FOOBAR( |
374 |
|
Quantifier conflict find modes. |
375 |
|
Available modes for --quant-cf-when are: |
376 |
|
+ std |
377 |
|
Apply conflict finding at standard effort. |
378 |
|
+ default |
379 |
|
Default, apply conflict finding at full effort. |
380 |
|
+ std-h |
381 |
|
Apply conflict finding at standard effort when heuristic says to. |
382 |
|
+ last-call |
383 |
|
Apply conflict finding at last call, after theory combination and and all |
384 |
|
theories report sat. |
385 |
|
)FOOBAR"; |
386 |
|
std::exit(1); |
387 |
|
} |
388 |
|
throw OptionException(std::string("unknown option for --quant-cf-when: `") + |
389 |
|
optarg + "'. Try --quant-cf-when=help."); |
390 |
|
} |
391 |
|
std::ostream& operator<<(std::ostream& os, QuantDSplitMode mode) |
392 |
|
{ |
393 |
|
switch(mode) |
394 |
|
{ |
395 |
|
case QuantDSplitMode::DEFAULT: return os << "default"; |
396 |
|
case QuantDSplitMode::AGG: return os << "agg"; |
397 |
|
case QuantDSplitMode::NONE: return os << "none"; |
398 |
|
default: Unreachable(); |
399 |
|
} |
400 |
|
return os; |
401 |
|
} |
402 |
|
QuantDSplitMode stringToQuantDSplitMode(const std::string& optarg) |
403 |
|
{ |
404 |
|
if (optarg == "default") return QuantDSplitMode::DEFAULT; |
405 |
|
else if (optarg == "agg") return QuantDSplitMode::AGG; |
406 |
|
else if (optarg == "none") return QuantDSplitMode::NONE; |
407 |
|
else if (optarg == "help") |
408 |
|
{ |
409 |
|
std::cerr << R"FOOBAR( |
410 |
|
Modes for quantifiers splitting. |
411 |
|
Available modes for --quant-dsplit-mode are: |
412 |
|
+ default |
413 |
|
Split quantified formulas over some finite datatypes when finite model finding |
414 |
|
is enabled. |
415 |
|
+ agg |
416 |
|
Aggressively split quantified formulas. |
417 |
|
+ none |
418 |
|
Never split quantified formulas. |
419 |
|
)FOOBAR"; |
420 |
|
std::exit(1); |
421 |
|
} |
422 |
|
throw OptionException(std::string("unknown option for --quant-dsplit-mode: `") + |
423 |
|
optarg + "'. Try --quant-dsplit-mode=help."); |
424 |
|
} |
425 |
|
std::ostream& operator<<(std::ostream& os, QuantRepMode mode) |
426 |
|
{ |
427 |
|
switch(mode) |
428 |
|
{ |
429 |
|
case QuantRepMode::DEPTH: return os << "depth"; |
430 |
|
case QuantRepMode::EE: return os << "ee"; |
431 |
|
case QuantRepMode::FIRST: return os << "first"; |
432 |
|
default: Unreachable(); |
433 |
|
} |
434 |
|
return os; |
435 |
|
} |
436 |
|
QuantRepMode stringToQuantRepMode(const std::string& optarg) |
437 |
|
{ |
438 |
|
if (optarg == "depth") return QuantRepMode::DEPTH; |
439 |
|
else if (optarg == "ee") return QuantRepMode::EE; |
440 |
|
else if (optarg == "first") return QuantRepMode::FIRST; |
441 |
|
else if (optarg == "help") |
442 |
|
{ |
443 |
|
std::cerr << R"FOOBAR( |
444 |
|
Modes for quantifiers representative selection. |
445 |
|
Available modes for --quant-rep-mode are: |
446 |
|
+ depth |
447 |
|
Choose terms that are of minimal depth. |
448 |
|
+ ee |
449 |
|
Let equality engine choose representatives. |
450 |
|
+ first (default) |
451 |
|
Choose terms that appear first. |
452 |
|
)FOOBAR"; |
453 |
|
std::exit(1); |
454 |
|
} |
455 |
|
throw OptionException(std::string("unknown option for --quant-rep-mode: `") + |
456 |
|
optarg + "'. Try --quant-rep-mode=help."); |
457 |
|
} |
458 |
|
std::ostream& operator<<(std::ostream& os, SygusActiveGenMode mode) |
459 |
|
{ |
460 |
|
switch(mode) |
461 |
|
{ |
462 |
|
case SygusActiveGenMode::VAR_AGNOSTIC: return os << "var-agnostic"; |
463 |
|
case SygusActiveGenMode::ENUM: return os << "enum"; |
464 |
|
case SygusActiveGenMode::AUTO: return os << "auto"; |
465 |
|
case SygusActiveGenMode::NONE: return os << "none"; |
466 |
|
case SygusActiveGenMode::ENUM_BASIC: return os << "basic"; |
467 |
|
default: Unreachable(); |
468 |
|
} |
469 |
|
return os; |
470 |
|
} |
471 |
20 |
SygusActiveGenMode stringToSygusActiveGenMode(const std::string& optarg) |
472 |
|
{ |
473 |
20 |
if (optarg == "var-agnostic") return SygusActiveGenMode::VAR_AGNOSTIC; |
474 |
18 |
else if (optarg == "enum") return SygusActiveGenMode::ENUM; |
475 |
6 |
else if (optarg == "auto") return SygusActiveGenMode::AUTO; |
476 |
6 |
else if (optarg == "none") return SygusActiveGenMode::NONE; |
477 |
|
else if (optarg == "basic") return SygusActiveGenMode::ENUM_BASIC; |
478 |
|
else if (optarg == "help") |
479 |
|
{ |
480 |
|
std::cerr << R"FOOBAR( |
481 |
|
Modes for actively-generated sygus enumerators. |
482 |
|
Available modes for --sygus-active-gen are: |
483 |
|
+ var-agnostic |
484 |
|
Use sygus solver to enumerate terms that are agnostic to variables. |
485 |
|
+ enum |
486 |
|
Use optimized enumerator for actively-generated sygus enumerators. |
487 |
|
+ auto (default) |
488 |
|
Internally decide the best policy for each enumerator. |
489 |
|
+ none |
490 |
|
Do not use actively-generated sygus enumerators. |
491 |
|
+ basic |
492 |
|
Use basic type enumerator for actively-generated sygus enumerators. |
493 |
|
)FOOBAR"; |
494 |
|
std::exit(1); |
495 |
|
} |
496 |
|
throw OptionException(std::string("unknown option for --sygus-active-gen: `") + |
497 |
|
optarg + "'. Try --sygus-active-gen=help."); |
498 |
|
} |
499 |
|
std::ostream& operator<<(std::ostream& os, SygusFilterSolMode mode) |
500 |
|
{ |
501 |
|
switch(mode) |
502 |
|
{ |
503 |
|
case SygusFilterSolMode::WEAK: return os << "weak"; |
504 |
|
case SygusFilterSolMode::STRONG: return os << "strong"; |
505 |
|
case SygusFilterSolMode::NONE: return os << "none"; |
506 |
|
default: Unreachable(); |
507 |
|
} |
508 |
|
return os; |
509 |
|
} |
510 |
|
SygusFilterSolMode stringToSygusFilterSolMode(const std::string& optarg) |
511 |
|
{ |
512 |
|
if (optarg == "weak") return SygusFilterSolMode::WEAK; |
513 |
|
else if (optarg == "strong") return SygusFilterSolMode::STRONG; |
514 |
|
else if (optarg == "none") return SygusFilterSolMode::NONE; |
515 |
|
else if (optarg == "help") |
516 |
|
{ |
517 |
|
std::cerr << R"FOOBAR( |
518 |
|
Modes for filtering sygus solutions. |
519 |
|
Available modes for --sygus-filter-sol are: |
520 |
|
+ weak |
521 |
|
Filter solutions that are logically weaker than others. |
522 |
|
+ strong |
523 |
|
Filter solutions that are logically stronger than others. |
524 |
|
+ none (default) |
525 |
|
Do not filter sygus solutions. |
526 |
|
)FOOBAR"; |
527 |
|
std::exit(1); |
528 |
|
} |
529 |
|
throw OptionException(std::string("unknown option for --sygus-filter-sol: `") + |
530 |
|
optarg + "'. Try --sygus-filter-sol=help."); |
531 |
|
} |
532 |
|
std::ostream& operator<<(std::ostream& os, SygusGrammarConsMode mode) |
533 |
|
{ |
534 |
|
switch(mode) |
535 |
|
{ |
536 |
|
case SygusGrammarConsMode::ANY_CONST: return os << "any-const"; |
537 |
|
case SygusGrammarConsMode::SIMPLE: return os << "simple"; |
538 |
|
case SygusGrammarConsMode::ANY_TERM: return os << "any-term"; |
539 |
|
case SygusGrammarConsMode::ANY_TERM_CONCISE: return os << "any-term-concise"; |
540 |
|
default: Unreachable(); |
541 |
|
} |
542 |
|
return os; |
543 |
|
} |
544 |
12 |
SygusGrammarConsMode stringToSygusGrammarConsMode(const std::string& optarg) |
545 |
|
{ |
546 |
12 |
if (optarg == "any-const") return SygusGrammarConsMode::ANY_CONST; |
547 |
8 |
else if (optarg == "simple") return SygusGrammarConsMode::SIMPLE; |
548 |
8 |
else if (optarg == "any-term") return SygusGrammarConsMode::ANY_TERM; |
549 |
4 |
else if (optarg == "any-term-concise") return SygusGrammarConsMode::ANY_TERM_CONCISE; |
550 |
|
else if (optarg == "help") |
551 |
|
{ |
552 |
|
std::cerr << R"FOOBAR( |
553 |
|
Modes for default SyGuS grammars. |
554 |
|
Available modes for --sygus-grammar-cons are: |
555 |
|
+ any-const |
556 |
|
Use symoblic constant constructors. |
557 |
|
+ simple (default) |
558 |
|
Use simple grammar construction (no symbolic terms or constants). |
559 |
|
+ any-term |
560 |
|
When applicable, use constructors corresponding to any symbolic term. This |
561 |
|
option enables a sum-of-monomials grammar for arithmetic. For all other types, |
562 |
|
it enables symbolic constant constructors. |
563 |
|
+ any-term-concise |
564 |
|
When applicable, use constructors corresponding to any symbolic term, favoring |
565 |
|
conciseness over generality. This option is equivalent to any-term but enables |
566 |
|
a polynomial grammar for arithmetic when not in a combined theory. |
567 |
|
)FOOBAR"; |
568 |
|
std::exit(1); |
569 |
|
} |
570 |
|
throw OptionException(std::string("unknown option for --sygus-grammar-cons: `") + |
571 |
|
optarg + "'. Try --sygus-grammar-cons=help."); |
572 |
|
} |
573 |
|
std::ostream& operator<<(std::ostream& os, SygusInstMode mode) |
574 |
|
{ |
575 |
|
switch(mode) |
576 |
|
{ |
577 |
|
case SygusInstMode::INTERLEAVE: return os << "interleave"; |
578 |
|
case SygusInstMode::PRIORITY_INST: return os << "priority-inst"; |
579 |
|
case SygusInstMode::PRIORITY_EVAL: return os << "priority-eval"; |
580 |
|
default: Unreachable(); |
581 |
|
} |
582 |
|
return os; |
583 |
|
} |
584 |
|
SygusInstMode stringToSygusInstMode(const std::string& optarg) |
585 |
|
{ |
586 |
|
if (optarg == "interleave") return SygusInstMode::INTERLEAVE; |
587 |
|
else if (optarg == "priority-inst") return SygusInstMode::PRIORITY_INST; |
588 |
|
else if (optarg == "priority-eval") return SygusInstMode::PRIORITY_EVAL; |
589 |
|
else if (optarg == "help") |
590 |
|
{ |
591 |
|
std::cerr << R"FOOBAR( |
592 |
|
SyGuS instantiation lemma modes. |
593 |
|
Available modes for --sygus-inst-mode are: |
594 |
|
+ interleave |
595 |
|
add instantiation and evaluation unfolding lemmas in the same step. |
596 |
|
+ priority-inst (default) |
597 |
|
add instantiation lemmas first, add evaluation unfolding if instantiation |
598 |
|
fails. |
599 |
|
+ priority-eval |
600 |
|
add evaluation unfolding lemma first, add instantiation lemma if unfolding |
601 |
|
lemmas already added. |
602 |
|
)FOOBAR"; |
603 |
|
std::exit(1); |
604 |
|
} |
605 |
|
throw OptionException(std::string("unknown option for --sygus-inst-mode: `") + |
606 |
|
optarg + "'. Try --sygus-inst-mode=help."); |
607 |
|
} |
608 |
|
std::ostream& operator<<(std::ostream& os, SygusInstScope mode) |
609 |
|
{ |
610 |
|
switch(mode) |
611 |
|
{ |
612 |
|
case SygusInstScope::BOTH: return os << "both"; |
613 |
|
case SygusInstScope::OUT: return os << "out"; |
614 |
|
case SygusInstScope::IN: return os << "in"; |
615 |
|
default: Unreachable(); |
616 |
|
} |
617 |
|
return os; |
618 |
|
} |
619 |
|
SygusInstScope stringToSygusInstScope(const std::string& optarg) |
620 |
|
{ |
621 |
|
if (optarg == "both") return SygusInstScope::BOTH; |
622 |
|
else if (optarg == "out") return SygusInstScope::OUT; |
623 |
|
else if (optarg == "in") return SygusInstScope::IN; |
624 |
|
else if (optarg == "help") |
625 |
|
{ |
626 |
|
std::cerr << R"FOOBAR( |
627 |
|
scope for collecting ground terms for the grammar. |
628 |
|
Available modes for --sygus-inst-scope are: |
629 |
|
+ both |
630 |
|
combines inside and outside. |
631 |
|
+ out |
632 |
|
use ground terms outside of quantified formulas only. |
633 |
|
+ in (default) |
634 |
|
use ground terms inside given quantified formula only. |
635 |
|
)FOOBAR"; |
636 |
|
std::exit(1); |
637 |
|
} |
638 |
|
throw OptionException(std::string("unknown option for --sygus-inst-scope: `") + |
639 |
|
optarg + "'. Try --sygus-inst-scope=help."); |
640 |
|
} |
641 |
|
std::ostream& operator<<(std::ostream& os, SygusInstTermSelMode mode) |
642 |
|
{ |
643 |
|
switch(mode) |
644 |
|
{ |
645 |
|
case SygusInstTermSelMode::MIN: return os << "min"; |
646 |
|
case SygusInstTermSelMode::BOTH: return os << "both"; |
647 |
|
case SygusInstTermSelMode::MAX: return os << "max"; |
648 |
|
default: Unreachable(); |
649 |
|
} |
650 |
|
return os; |
651 |
|
} |
652 |
|
SygusInstTermSelMode stringToSygusInstTermSelMode(const std::string& optarg) |
653 |
|
{ |
654 |
|
if (optarg == "min") return SygusInstTermSelMode::MIN; |
655 |
|
else if (optarg == "both") return SygusInstTermSelMode::BOTH; |
656 |
|
else if (optarg == "max") return SygusInstTermSelMode::MAX; |
657 |
|
else if (optarg == "help") |
658 |
|
{ |
659 |
|
std::cerr << R"FOOBAR( |
660 |
|
Ground term selection modes. |
661 |
|
Available modes for --sygus-inst-term-sel are: |
662 |
|
+ min (default) |
663 |
|
collect minimal ground terms only. |
664 |
|
+ both |
665 |
|
combines minimal and maximal . |
666 |
|
+ max |
667 |
|
collect maximal ground terms only. |
668 |
|
)FOOBAR"; |
669 |
|
std::exit(1); |
670 |
|
} |
671 |
|
throw OptionException(std::string("unknown option for --sygus-inst-term-sel: `") + |
672 |
|
optarg + "'. Try --sygus-inst-term-sel=help."); |
673 |
|
} |
674 |
|
std::ostream& operator<<(std::ostream& os, SygusInvTemplMode mode) |
675 |
|
{ |
676 |
|
switch(mode) |
677 |
|
{ |
678 |
|
case SygusInvTemplMode::NONE: return os << "none"; |
679 |
|
case SygusInvTemplMode::PRE: return os << "pre"; |
680 |
|
case SygusInvTemplMode::POST: return os << "post"; |
681 |
|
default: Unreachable(); |
682 |
|
} |
683 |
|
return os; |
684 |
|
} |
685 |
6 |
SygusInvTemplMode stringToSygusInvTemplMode(const std::string& optarg) |
686 |
|
{ |
687 |
6 |
if (optarg == "none") return SygusInvTemplMode::NONE; |
688 |
6 |
else if (optarg == "pre") return SygusInvTemplMode::PRE; |
689 |
4 |
else if (optarg == "post") return SygusInvTemplMode::POST; |
690 |
|
else if (optarg == "help") |
691 |
|
{ |
692 |
|
std::cerr << R"FOOBAR( |
693 |
|
Template modes for sygus invariant synthesis. |
694 |
|
Available modes for --sygus-inv-templ are: |
695 |
|
+ none |
696 |
|
Synthesize invariant directly. |
697 |
|
+ pre |
698 |
|
Synthesize invariant based on weakening of precondition. |
699 |
|
+ post (default) |
700 |
|
Synthesize invariant based on strengthening of postcondition. |
701 |
|
)FOOBAR"; |
702 |
|
std::exit(1); |
703 |
|
} |
704 |
|
throw OptionException(std::string("unknown option for --sygus-inv-templ: `") + |
705 |
|
optarg + "'. Try --sygus-inv-templ=help."); |
706 |
|
} |
707 |
|
std::ostream& operator<<(std::ostream& os, SygusQueryGenMode mode) |
708 |
|
{ |
709 |
|
switch(mode) |
710 |
|
{ |
711 |
|
case SygusQueryGenMode::SAT: return os << "sat"; |
712 |
|
case SygusQueryGenMode::NONE: return os << "none"; |
713 |
|
case SygusQueryGenMode::UNSAT: return os << "unsat"; |
714 |
|
default: Unreachable(); |
715 |
|
} |
716 |
|
return os; |
717 |
|
} |
718 |
2 |
SygusQueryGenMode stringToSygusQueryGenMode(const std::string& optarg) |
719 |
|
{ |
720 |
2 |
if (optarg == "sat") return SygusQueryGenMode::SAT; |
721 |
2 |
else if (optarg == "none") return SygusQueryGenMode::NONE; |
722 |
2 |
else if (optarg == "unsat") return SygusQueryGenMode::UNSAT; |
723 |
|
else if (optarg == "help") |
724 |
|
{ |
725 |
|
std::cerr << R"FOOBAR( |
726 |
|
Modes for generating interesting satisfiability queries using SyGuS. |
727 |
|
Available modes for --sygus-query-gen are: |
728 |
|
+ sat |
729 |
|
Generate interesting SAT queries, for e.g. soundness testing. |
730 |
|
+ none (default) |
731 |
|
Do not generate queries with SyGuS. |
732 |
|
+ unsat |
733 |
|
Generate interesting UNSAT queries, for e.g. proof testing. |
734 |
|
)FOOBAR"; |
735 |
|
std::exit(1); |
736 |
|
} |
737 |
|
throw OptionException(std::string("unknown option for --sygus-query-gen: `") + |
738 |
|
optarg + "'. Try --sygus-query-gen=help."); |
739 |
|
} |
740 |
|
std::ostream& operator<<(std::ostream& os, SygusQueryDumpFilesMode mode) |
741 |
|
{ |
742 |
|
switch(mode) |
743 |
|
{ |
744 |
|
case SygusQueryDumpFilesMode::UNSOLVED: return os << "unsolved"; |
745 |
|
case SygusQueryDumpFilesMode::NONE: return os << "none"; |
746 |
|
case SygusQueryDumpFilesMode::ALL: return os << "all"; |
747 |
|
default: Unreachable(); |
748 |
|
} |
749 |
|
return os; |
750 |
|
} |
751 |
|
SygusQueryDumpFilesMode stringToSygusQueryDumpFilesMode(const std::string& optarg) |
752 |
|
{ |
753 |
|
if (optarg == "unsolved") return SygusQueryDumpFilesMode::UNSOLVED; |
754 |
|
else if (optarg == "none") return SygusQueryDumpFilesMode::NONE; |
755 |
|
else if (optarg == "all") return SygusQueryDumpFilesMode::ALL; |
756 |
|
else if (optarg == "help") |
757 |
|
{ |
758 |
|
std::cerr << R"FOOBAR( |
759 |
|
Query file options. |
760 |
|
Available modes for --sygus-query-gen-dump-files are: |
761 |
|
+ unsolved |
762 |
|
Dump query files that the subsolver did not solve. |
763 |
|
+ none (default) |
764 |
|
Do not dump query files when using --sygus-query-gen. |
765 |
|
+ all |
766 |
|
Dump all query files. |
767 |
|
)FOOBAR"; |
768 |
|
std::exit(1); |
769 |
|
} |
770 |
|
throw OptionException(std::string("unknown option for --sygus-query-gen-dump-files: `") + |
771 |
|
optarg + "'. Try --sygus-query-gen-dump-files=help."); |
772 |
|
} |
773 |
|
std::ostream& operator<<(std::ostream& os, CegqiSingleInvMode mode) |
774 |
|
{ |
775 |
|
switch(mode) |
776 |
|
{ |
777 |
|
case CegqiSingleInvMode::USE: return os << "use"; |
778 |
|
case CegqiSingleInvMode::NONE: return os << "none"; |
779 |
|
case CegqiSingleInvMode::ALL: return os << "all"; |
780 |
|
default: Unreachable(); |
781 |
|
} |
782 |
|
return os; |
783 |
|
} |
784 |
92 |
CegqiSingleInvMode stringToCegqiSingleInvMode(const std::string& optarg) |
785 |
|
{ |
786 |
92 |
if (optarg == "use") return CegqiSingleInvMode::USE; |
787 |
92 |
else if (optarg == "none") return CegqiSingleInvMode::NONE; |
788 |
50 |
else if (optarg == "all") return CegqiSingleInvMode::ALL; |
789 |
|
else if (optarg == "help") |
790 |
|
{ |
791 |
|
std::cerr << R"FOOBAR( |
792 |
|
Modes for single invocation techniques. |
793 |
|
Available modes for --sygus-si are: |
794 |
|
+ use |
795 |
|
Use single invocation techniques only if grammar is not restrictive. |
796 |
|
+ none (default) |
797 |
|
Do not use single invocation techniques. |
798 |
|
+ all |
799 |
|
Always use single invocation techniques. |
800 |
|
)FOOBAR"; |
801 |
|
std::exit(1); |
802 |
|
} |
803 |
|
throw OptionException(std::string("unknown option for --sygus-si: `") + |
804 |
|
optarg + "'. Try --sygus-si=help."); |
805 |
|
} |
806 |
|
std::ostream& operator<<(std::ostream& os, CegqiSingleInvRconsMode mode) |
807 |
|
{ |
808 |
|
switch(mode) |
809 |
|
{ |
810 |
|
case CegqiSingleInvRconsMode::ALL: return os << "all"; |
811 |
|
case CegqiSingleInvRconsMode::NONE: return os << "none"; |
812 |
|
case CegqiSingleInvRconsMode::ALL_LIMIT: return os << "all-limit"; |
813 |
|
case CegqiSingleInvRconsMode::TRY: return os << "try"; |
814 |
|
default: Unreachable(); |
815 |
|
} |
816 |
|
return os; |
817 |
|
} |
818 |
|
CegqiSingleInvRconsMode stringToCegqiSingleInvRconsMode(const std::string& optarg) |
819 |
|
{ |
820 |
|
if (optarg == "all") return CegqiSingleInvRconsMode::ALL; |
821 |
|
else if (optarg == "none") return CegqiSingleInvRconsMode::NONE; |
822 |
|
else if (optarg == "all-limit") return CegqiSingleInvRconsMode::ALL_LIMIT; |
823 |
|
else if (optarg == "try") return CegqiSingleInvRconsMode::TRY; |
824 |
|
else if (optarg == "help") |
825 |
|
{ |
826 |
|
std::cerr << R"FOOBAR( |
827 |
|
Modes for reconstruction solutions while using single invocation techniques. |
828 |
|
Available modes for --sygus-si-rcons are: |
829 |
|
+ all |
830 |
|
Try to reconstruct solutions in the original grammar. In this mode, we do not |
831 |
|
terminate until a solution is successfully reconstructed. |
832 |
|
+ none |
833 |
|
Do not try to reconstruct solutions in the original (user-provided) grammar |
834 |
|
when using single invocation techniques. In this mode, solutions produced by |
835 |
|
cvc5 may violate grammar restrictions. |
836 |
|
+ all-limit (default) |
837 |
|
Try to reconstruct solutions in the original grammar, but termintate if a |
838 |
|
maximum number of rounds for reconstruction is exceeded. |
839 |
|
+ try |
840 |
|
Try to reconstruct solutions in the original grammar when using single |
841 |
|
invocation techniques in an incomplete (fail-fast) manner. |
842 |
|
)FOOBAR"; |
843 |
|
std::exit(1); |
844 |
|
} |
845 |
|
throw OptionException(std::string("unknown option for --sygus-si-rcons: `") + |
846 |
|
optarg + "'. Try --sygus-si-rcons=help."); |
847 |
|
} |
848 |
|
std::ostream& operator<<(std::ostream& os, SygusUnifPiMode mode) |
849 |
|
{ |
850 |
|
switch(mode) |
851 |
|
{ |
852 |
|
case SygusUnifPiMode::COMPLETE: return os << "complete"; |
853 |
|
case SygusUnifPiMode::CENUM_IGAIN: return os << "cond-enum-igain"; |
854 |
|
case SygusUnifPiMode::NONE: return os << "none"; |
855 |
|
case SygusUnifPiMode::CENUM: return os << "cond-enum"; |
856 |
|
default: Unreachable(); |
857 |
|
} |
858 |
|
return os; |
859 |
|
} |
860 |
16 |
SygusUnifPiMode stringToSygusUnifPiMode(const std::string& optarg) |
861 |
|
{ |
862 |
16 |
if (optarg == "complete") return SygusUnifPiMode::COMPLETE; |
863 |
|
else if (optarg == "cond-enum-igain") return SygusUnifPiMode::CENUM_IGAIN; |
864 |
|
else if (optarg == "none") return SygusUnifPiMode::NONE; |
865 |
|
else if (optarg == "cond-enum") return SygusUnifPiMode::CENUM; |
866 |
|
else if (optarg == "help") |
867 |
|
{ |
868 |
|
std::cerr << R"FOOBAR( |
869 |
|
Modes for piecewise-independent unification. |
870 |
|
Available modes for --sygus-unif-pi are: |
871 |
|
+ complete |
872 |
|
Use complete approach for piecewise-independent unification (see Section 3 of |
873 |
|
Barbosa et al FMCAD 2019) |
874 |
|
+ cond-enum-igain |
875 |
|
Same as cond-enum, but additionally uses an information gain heuristic when |
876 |
|
doing decision tree learning. |
877 |
|
+ none (default) |
878 |
|
Do not use piecewise-independent unification. |
879 |
|
+ cond-enum |
880 |
|
Use unconstrained condition enumeration for piecewise-independent unification |
881 |
|
(see Section 4 of Barbosa et al FMCAD 2019). |
882 |
|
)FOOBAR"; |
883 |
|
std::exit(1); |
884 |
|
} |
885 |
|
throw OptionException(std::string("unknown option for --sygus-unif-pi: `") + |
886 |
|
optarg + "'. Try --sygus-unif-pi=help."); |
887 |
|
} |
888 |
|
std::ostream& operator<<(std::ostream& os, TermDbMode mode) |
889 |
|
{ |
890 |
|
switch(mode) |
891 |
|
{ |
892 |
|
case TermDbMode::RELEVANT: return os << "relevant"; |
893 |
|
case TermDbMode::ALL: return os << "all"; |
894 |
|
default: Unreachable(); |
895 |
|
} |
896 |
|
return os; |
897 |
|
} |
898 |
|
TermDbMode stringToTermDbMode(const std::string& optarg) |
899 |
|
{ |
900 |
|
if (optarg == "relevant") return TermDbMode::RELEVANT; |
901 |
|
else if (optarg == "all") return TermDbMode::ALL; |
902 |
|
else if (optarg == "help") |
903 |
|
{ |
904 |
|
std::cerr << R"FOOBAR( |
905 |
|
Modes for terms included in the quantifiers term database. |
906 |
|
Available modes for --term-db-mode are: |
907 |
|
+ relevant |
908 |
|
Quantifiers module considers only ground terms connected to current |
909 |
|
assertions. |
910 |
|
+ all (default) |
911 |
|
Quantifiers module considers all ground terms. |
912 |
|
)FOOBAR"; |
913 |
|
std::exit(1); |
914 |
|
} |
915 |
|
throw OptionException(std::string("unknown option for --term-db-mode: `") + |
916 |
|
optarg + "'. Try --term-db-mode=help."); |
917 |
|
} |
918 |
|
std::ostream& operator<<(std::ostream& os, TriggerActiveSelMode mode) |
919 |
|
{ |
920 |
|
switch(mode) |
921 |
|
{ |
922 |
|
case TriggerActiveSelMode::MIN: return os << "min"; |
923 |
|
case TriggerActiveSelMode::MAX: return os << "max"; |
924 |
|
case TriggerActiveSelMode::ALL: return os << "all"; |
925 |
|
default: Unreachable(); |
926 |
|
} |
927 |
|
return os; |
928 |
|
} |
929 |
|
TriggerActiveSelMode stringToTriggerActiveSelMode(const std::string& optarg) |
930 |
|
{ |
931 |
|
if (optarg == "min") return TriggerActiveSelMode::MIN; |
932 |
|
else if (optarg == "max") return TriggerActiveSelMode::MAX; |
933 |
|
else if (optarg == "all") return TriggerActiveSelMode::ALL; |
934 |
|
else if (optarg == "help") |
935 |
|
{ |
936 |
|
std::cerr << R"FOOBAR( |
937 |
|
Trigger active selection modes. |
938 |
|
Available modes for --trigger-active-sel are: |
939 |
|
+ min |
940 |
|
Activate triggers with minimal ground terms. |
941 |
|
+ max |
942 |
|
Activate triggers with maximal ground terms. |
943 |
|
+ all (default) |
944 |
|
Make all triggers active. |
945 |
|
)FOOBAR"; |
946 |
|
std::exit(1); |
947 |
|
} |
948 |
|
throw OptionException(std::string("unknown option for --trigger-active-sel: `") + |
949 |
|
optarg + "'. Try --trigger-active-sel=help."); |
950 |
|
} |
951 |
|
std::ostream& operator<<(std::ostream& os, TriggerSelMode mode) |
952 |
|
{ |
953 |
|
switch(mode) |
954 |
|
{ |
955 |
|
case TriggerSelMode::MIN: return os << "min"; |
956 |
|
case TriggerSelMode::MIN_SINGLE_MAX: return os << "min-s-max"; |
957 |
|
case TriggerSelMode::ALL: return os << "all"; |
958 |
|
case TriggerSelMode::MIN_SINGLE_ALL: return os << "min-s-all"; |
959 |
|
case TriggerSelMode::MAX: return os << "max"; |
960 |
|
default: Unreachable(); |
961 |
|
} |
962 |
|
return os; |
963 |
|
} |
964 |
|
TriggerSelMode stringToTriggerSelMode(const std::string& optarg) |
965 |
|
{ |
966 |
|
if (optarg == "min") return TriggerSelMode::MIN; |
967 |
|
else if (optarg == "min-s-max") return TriggerSelMode::MIN_SINGLE_MAX; |
968 |
|
else if (optarg == "all") return TriggerSelMode::ALL; |
969 |
|
else if (optarg == "min-s-all") return TriggerSelMode::MIN_SINGLE_ALL; |
970 |
|
else if (optarg == "max") return TriggerSelMode::MAX; |
971 |
|
else if (optarg == "help") |
972 |
|
{ |
973 |
|
std::cerr << R"FOOBAR( |
974 |
|
Trigger selection modes. |
975 |
|
Available modes for --trigger-sel are: |
976 |
|
+ min (default) |
977 |
|
Consider only minimal subterms that meet criteria for triggers. |
978 |
|
+ min-s-max |
979 |
|
Consider only minimal subterms that meet criteria for single triggers, maximal |
980 |
|
otherwise. |
981 |
|
+ all |
982 |
|
Consider all subterms that meet criteria for triggers. |
983 |
|
+ min-s-all |
984 |
|
Consider only minimal subterms that meet criteria for single triggers, all |
985 |
|
otherwise. |
986 |
|
+ max |
987 |
|
Consider only maximal subterms that meet criteria for triggers. |
988 |
|
)FOOBAR"; |
989 |
|
std::exit(1); |
990 |
|
} |
991 |
|
throw OptionException(std::string("unknown option for --trigger-sel: `") + |
992 |
|
optarg + "'. Try --trigger-sel=help."); |
993 |
|
} |
994 |
|
std::ostream& operator<<(std::ostream& os, UserPatMode mode) |
995 |
|
{ |
996 |
|
switch(mode) |
997 |
|
{ |
998 |
|
case UserPatMode::INTERLEAVE: return os << "interleave"; |
999 |
|
case UserPatMode::USE: return os << "use"; |
1000 |
|
case UserPatMode::IGNORE: return os << "ignore"; |
1001 |
|
case UserPatMode::STRICT: return os << "strict"; |
1002 |
|
case UserPatMode::RESORT: return os << "resort"; |
1003 |
|
case UserPatMode::TRUST: return os << "trust"; |
1004 |
|
default: Unreachable(); |
1005 |
|
} |
1006 |
|
return os; |
1007 |
|
} |
1008 |
3 |
UserPatMode stringToUserPatMode(const std::string& optarg) |
1009 |
|
{ |
1010 |
3 |
if (optarg == "interleave") return UserPatMode::INTERLEAVE; |
1011 |
3 |
else if (optarg == "use") return UserPatMode::USE; |
1012 |
|
else if (optarg == "ignore") return UserPatMode::IGNORE; |
1013 |
|
else if (optarg == "strict") return UserPatMode::STRICT; |
1014 |
|
else if (optarg == "resort") return UserPatMode::RESORT; |
1015 |
|
else if (optarg == "trust") return UserPatMode::TRUST; |
1016 |
|
else if (optarg == "help") |
1017 |
|
{ |
1018 |
|
std::cerr << R"FOOBAR( |
1019 |
|
These modes determine how user provided patterns (triggers) are used during |
1020 |
|
E-matching. The modes vary on when instantiation based on user-provided |
1021 |
|
triggers is combined with instantiation based on automatically selected |
1022 |
|
triggers. |
1023 |
|
Available modes for --user-pat are: |
1024 |
|
+ interleave |
1025 |
|
Alternate between use/resort. |
1026 |
|
+ use |
1027 |
|
Use both user-provided and auto-generated patterns when patterns are provided |
1028 |
|
for a quantified formula. |
1029 |
|
+ ignore |
1030 |
|
Ignore user-provided patterns. |
1031 |
|
+ strict |
1032 |
|
When provided, use only user-provided patterns for a quantified formula, and |
1033 |
|
do not use any other instantiation techniques. |
1034 |
|
+ resort |
1035 |
|
Use user-provided patterns only after auto-generated patterns saturate. |
1036 |
|
+ trust (default) |
1037 |
|
When provided, use only user-provided patterns for a quantified formula. |
1038 |
|
)FOOBAR"; |
1039 |
|
std::exit(1); |
1040 |
|
} |
1041 |
|
throw OptionException(std::string("unknown option for --user-pat: `") + |
1042 |
|
optarg + "'. Try --user-pat=help."); |
1043 |
|
} |
1044 |
|
// clang-format on |
1045 |
|
|
1046 |
31137 |
} // namespace cvc5::options |