Update copyright headers.
[cvc5.git] / src / options / options_template.cpp
1 /********************* */
2 /*! \file options_template.cpp
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Morgan Deters, Tim King, Mathias Preiner
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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.\endverbatim
11 **
12 ** \brief Contains code for handling command-line options.
13 **
14 ** Contains code for handling command-line options
15 **/
16
17 #if !defined(_BSD_SOURCE) && defined(__MINGW32__) && !defined(__MINGW64__)
18 // force use of optreset; mingw32 croaks on argv-switching otherwise
19 # include "cvc4autoconfig.h"
20 # define _BSD_SOURCE
21 # undef HAVE_DECL_OPTRESET
22 # define HAVE_DECL_OPTRESET 1
23 # define CVC4_IS_NOT_REALLY_BSD
24 #endif /* !_BSD_SOURCE && __MINGW32__ && !__MINGW64__ */
25
26 #ifdef __MINGW64__
27 extern int optreset;
28 #endif /* __MINGW64__ */
29
30 #include <getopt.h>
31
32 // clean up
33 #ifdef CVC4_IS_NOT_REALLY_BSD
34 # undef _BSD_SOURCE
35 #endif /* CVC4_IS_NOT_REALLY_BSD */
36
37 #include <unistd.h>
38 #include <string.h>
39 #include <stdint.h>
40 #include <time.h>
41
42 #include <cstdio>
43 #include <cstdlib>
44 #include <cstring>
45 #include <iomanip>
46 #include <new>
47 #include <string>
48 #include <sstream>
49 #include <limits>
50
51 #include "base/check.h"
52 #include "base/exception.h"
53 #include "base/output.h"
54 #include "options/didyoumean.h"
55 #include "options/language.h"
56 #include "options/options_handler.h"
57
58 ${headers_module}$
59
60
61 #include "options/options_holder.h"
62 #include "cvc4autoconfig.h"
63 #include "options/base_handlers.h"
64
65 ${headers_handler}$
66
67
68 using namespace CVC4;
69 using namespace CVC4::options;
70
71 namespace CVC4 {
72
73 thread_local Options* Options::s_current = NULL;
74
75 /**
76 * This is a default handler for options of built-in C++ type. This
77 * template is really just a helper for the handleOption() template,
78 * below. Variants of this template handle numeric and non-numeric,
79 * integral and non-integral, signed and unsigned C++ types.
80 * handleOption() makes sure to instantiate the right one.
81 *
82 * This implements default behavior when e.g. an option is
83 * unsigned but the user specifies a negative argument; etc.
84 */
85 template <class T, bool is_numeric, bool is_integer>
86 struct OptionHandler {
87 static T handle(std::string option, std::string optionarg);
88 };/* struct OptionHandler<> */
89
90 /** Variant for integral C++ types */
91 template <class T>
92 struct OptionHandler<T, true, true> {
93 static bool stringToInt(T& t, const std::string& str) {
94 std::istringstream ss(str);
95 ss >> t;
96 char tmp;
97 return !(ss.fail() || ss.get(tmp));
98 }
99
100 static bool containsMinus(const std::string& str) {
101 return str.find('-') != std::string::npos;
102 }
103
104 static T handle(const std::string& option, const std::string& optionarg) {
105 try {
106 T i;
107 bool success = stringToInt(i, optionarg);
108
109 if(!success){
110 throw OptionException(option + ": failed to parse "+ optionarg +
111 " as an integer of the appropriate type.");
112 }
113
114 // Depending in the platform unsigned numbers with '-' signs may parse.
115 // Reject these by looking for any minus if it is not signed.
116 if( (! std::numeric_limits<T>::is_signed) && containsMinus(optionarg) ) {
117 // unsigned type but user gave negative argument
118 throw OptionException(option + " requires a nonnegative argument");
119 } else if(i < std::numeric_limits<T>::min()) {
120 // negative overflow for type
121 std::stringstream ss;
122 ss << option << " requires an argument >= "
123 << std::numeric_limits<T>::min();
124 throw OptionException(ss.str());
125 } else if(i > std::numeric_limits<T>::max()) {
126 // positive overflow for type
127 std::stringstream ss;
128 ss << option << " requires an argument <= "
129 << std::numeric_limits<T>::max();
130 throw OptionException(ss.str());
131 }
132
133 return i;
134
135 // if(std::numeric_limits<T>::is_signed) {
136 // return T(i.getLong());
137 // } else {
138 // return T(i.getUnsignedLong());
139 // }
140 } catch(std::invalid_argument&) {
141 // user gave something other than an integer
142 throw OptionException(option + " requires an integer argument");
143 }
144 }
145 };/* struct OptionHandler<T, true, true> */
146
147 /** Variant for numeric but non-integral C++ types */
148 template <class T>
149 struct OptionHandler<T, true, false> {
150 static T handle(std::string option, std::string optionarg) {
151 std::stringstream in(optionarg);
152 long double r;
153 in >> r;
154 if(! in.eof()) {
155 // we didn't consume the whole string (junk at end)
156 throw OptionException(option + " requires a numeric argument");
157 }
158
159 if(! std::numeric_limits<T>::is_signed && r < 0.0) {
160 // unsigned type but user gave negative value
161 throw OptionException(option + " requires a nonnegative argument");
162 } else if(r < -std::numeric_limits<T>::max()) {
163 // negative overflow for type
164 std::stringstream ss;
165 ss << option << " requires an argument >= "
166 << -std::numeric_limits<T>::max();
167 throw OptionException(ss.str());
168 } else if(r > std::numeric_limits<T>::max()) {
169 // positive overflow for type
170 std::stringstream ss;
171 ss << option << " requires an argument <= "
172 << std::numeric_limits<T>::max();
173 throw OptionException(ss.str());
174 }
175
176 return T(r);
177 }
178 };/* struct OptionHandler<T, true, false> */
179
180 /** Variant for non-numeric C++ types */
181 template <class T>
182 struct OptionHandler<T, false, false> {
183 static T handle(std::string option, std::string optionarg) {
184 T::unsupported_handleOption_call___please_write_me;
185 // The above line causes a compiler error if this version of the template
186 // is ever instantiated (meaning that a specialization is missing). So
187 // don't worry about the segfault in the next line, the "return" is only
188 // there to keep the compiler from giving additional, distracting errors
189 // and warnings.
190 return *(T*)0;
191 }
192 };/* struct OptionHandler<T, false, false> */
193
194 /** Handle an option of type T in the default way. */
195 template <class T>
196 T handleOption(std::string option, std::string optionarg) {
197 return OptionHandler<T, std::numeric_limits<T>::is_specialized, std::numeric_limits<T>::is_integer>::handle(option, optionarg);
198 }
199
200 /** Handle an option of type std::string in the default way. */
201 template <>
202 std::string handleOption<std::string>(std::string option, std::string optionarg) {
203 return optionarg;
204 }
205
206 /**
207 * Run handler, and any user-given predicates, for option T.
208 * If a user specifies a :handler or :predicates, it overrides this.
209 */
210 template <class T>
211 typename T::type runHandlerAndPredicates(T, std::string option, std::string optionarg, options::OptionsHandler* handler) {
212 // By default, parse the option argument in a way appropriate for its type.
213 // E.g., for "unsigned int" options, ensure that the provided argument is
214 // a nonnegative integer that fits in the unsigned int type.
215
216 return handleOption<typename T::type>(option, optionarg);
217 }
218
219 template <class T>
220 void runBoolPredicates(T, std::string option, bool b, options::OptionsHandler* handler) {
221 // By default, nothing to do for bool. Users add things with
222 // :predicate in options files to provide custom checking routines
223 // that can throw exceptions.
224 }
225
226
227 Options::Options()
228 : d_holder(new options::OptionsHolder())
229 , d_handler(new options::OptionsHandler(this))
230 , d_beforeSearchListeners()
231 , d_tlimitListeners()
232 , d_tlimitPerListeners()
233 , d_rlimitListeners()
234 , d_rlimitPerListeners()
235 {}
236
237 Options::~Options() {
238 delete d_handler;
239 delete d_holder;
240 }
241
242 void Options::copyValues(const Options& options){
243 if(this != &options) {
244 delete d_holder;
245 d_holder = new options::OptionsHolder(*options.d_holder);
246 }
247 }
248
249 std::string Options::formatThreadOptionException(const std::string& option) {
250 std::stringstream ss;
251 ss << "can't understand option `" << option
252 << "': expected something like --threadN=\"--option1 --option2\","
253 << " where N is a nonnegative integer";
254 return ss.str();
255 }
256
257 ListenerCollection::Registration* Options::registerAndNotify(
258 ListenerCollection& collection, Listener* listener, bool notify)
259 {
260 ListenerCollection::Registration* registration =
261 collection.registerListener(listener);
262 if(notify) {
263 try
264 {
265 listener->notify();
266 }
267 catch (OptionException& e)
268 {
269 // It can happen that listener->notify() throws an OptionException. In
270 // that case, we have to make sure that we delete the registration of our
271 // listener before rethrowing the exception. Otherwise the
272 // ListenerCollection deconstructor will complain that not all
273 // registrations have been removed before invoking the deconstructor.
274 delete registration;
275 throw OptionException(e.getRawMessage());
276 }
277 }
278 return registration;
279 }
280
281 ListenerCollection::Registration* Options::registerBeforeSearchListener(
282 Listener* listener)
283 {
284 return d_beforeSearchListeners.registerListener(listener);
285 }
286
287 ListenerCollection::Registration* Options::registerTlimitListener(
288 Listener* listener, bool notifyIfSet)
289 {
290 bool notify = notifyIfSet &&
291 wasSetByUser(options::cumulativeMillisecondLimit);
292 return registerAndNotify(d_tlimitListeners, listener, notify);
293 }
294
295 ListenerCollection::Registration* Options::registerTlimitPerListener(
296 Listener* listener, bool notifyIfSet)
297 {
298 bool notify = notifyIfSet && wasSetByUser(options::perCallMillisecondLimit);
299 return registerAndNotify(d_tlimitPerListeners, listener, notify);
300 }
301
302 ListenerCollection::Registration* Options::registerRlimitListener(
303 Listener* listener, bool notifyIfSet)
304 {
305 bool notify = notifyIfSet && wasSetByUser(options::cumulativeResourceLimit);
306 return registerAndNotify(d_rlimitListeners, listener, notify);
307 }
308
309 ListenerCollection::Registration* Options::registerRlimitPerListener(
310 Listener* listener, bool notifyIfSet)
311 {
312 bool notify = notifyIfSet && wasSetByUser(options::perCallResourceLimit);
313 return registerAndNotify(d_rlimitPerListeners, listener, notify);
314 }
315
316 ListenerCollection::Registration* Options::registerSetDefaultExprDepthListener(
317 Listener* listener, bool notifyIfSet)
318 {
319 bool notify = notifyIfSet && wasSetByUser(options::defaultExprDepth);
320 return registerAndNotify(d_setDefaultExprDepthListeners, listener, notify);
321 }
322
323 ListenerCollection::Registration* Options::registerSetDefaultExprDagListener(
324 Listener* listener, bool notifyIfSet)
325 {
326 bool notify = notifyIfSet && wasSetByUser(options::defaultDagThresh);
327 return registerAndNotify(d_setDefaultDagThreshListeners, listener, notify);
328 }
329
330 ListenerCollection::Registration* Options::registerSetPrintExprTypesListener(
331 Listener* listener, bool notifyIfSet)
332 {
333 bool notify = notifyIfSet && wasSetByUser(options::printExprTypes);
334 return registerAndNotify(d_setPrintExprTypesListeners, listener, notify);
335 }
336
337 ListenerCollection::Registration* Options::registerSetDumpModeListener(
338 Listener* listener, bool notifyIfSet)
339 {
340 bool notify = notifyIfSet && wasSetByUser(options::dumpModeString);
341 return registerAndNotify(d_setDumpModeListeners, listener, notify);
342 }
343
344 ListenerCollection::Registration* Options::registerSetPrintSuccessListener(
345 Listener* listener, bool notifyIfSet)
346 {
347 bool notify = notifyIfSet && wasSetByUser(options::printSuccess);
348 return registerAndNotify(d_setPrintSuccessListeners, listener, notify);
349 }
350
351 ListenerCollection::Registration* Options::registerDumpToFileNameListener(
352 Listener* listener, bool notifyIfSet)
353 {
354 bool notify = notifyIfSet && wasSetByUser(options::dumpToFileName);
355 return registerAndNotify(d_dumpToFileListeners, listener, notify);
356 }
357
358 ListenerCollection::Registration*
359 Options::registerSetRegularOutputChannelListener(
360 Listener* listener, bool notifyIfSet)
361 {
362 bool notify = notifyIfSet && wasSetByUser(options::regularChannelName);
363 return registerAndNotify(d_setRegularChannelListeners, listener, notify);
364 }
365
366 ListenerCollection::Registration*
367 Options::registerSetDiagnosticOutputChannelListener(
368 Listener* listener, bool notifyIfSet)
369 {
370 bool notify = notifyIfSet && wasSetByUser(options::diagnosticChannelName);
371 return registerAndNotify(d_setDiagnosticChannelListeners, listener, notify);
372 }
373
374 ${custom_handlers}$
375
376
377 #ifdef CVC4_DEBUG
378 # define USE_EARLY_TYPE_CHECKING_BY_DEFAULT true
379 #else /* CVC4_DEBUG */
380 # define USE_EARLY_TYPE_CHECKING_BY_DEFAULT false
381 #endif /* CVC4_DEBUG */
382
383 #if defined(CVC4_MUZZLED) || defined(CVC4_COMPETITION_MODE)
384 # define DO_SEMANTIC_CHECKS_BY_DEFAULT false
385 #else /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
386 # define DO_SEMANTIC_CHECKS_BY_DEFAULT true
387 #endif /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
388
389 options::OptionsHolder::OptionsHolder() :
390 ${module_defaults}$
391 {
392 }
393
394
395 static const std::string mostCommonOptionsDescription = "\
396 Most commonly-used CVC4 options:\n"
397 ${help_common}$;
398
399
400 static const std::string optionsDescription = mostCommonOptionsDescription + "\n\
401 \n\
402 Additional CVC4 options:\n"
403 ${help_others}$;
404
405
406 static const std::string optionsFootnote = "\n\
407 [*] Each of these options has a --no-OPTIONNAME variant, which reverses the\n\
408 sense of the option.\n\
409 ";
410
411 static const std::string languageDescription =
412 "\
413 Languages currently supported as arguments to the -L / --lang option:\n\
414 auto attempt to automatically determine language\n\
415 cvc4 | presentation | pl CVC4 presentation language\n\
416 smt | smtlib | smt2 |\n\
417 smt2.0 | smtlib2 | smtlib2.0 SMT-LIB format 2.0\n\
418 smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
419 smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
420 tptp TPTP format (cnf, fof and tff)\n\
421 sygus1 SyGuS version 1.0 \n\
422 sygus | sygus2 SyGuS version 2.0\n\
423 \n\
424 Languages currently supported as arguments to the --output-lang option:\n\
425 auto match output language to input language\n\
426 cvc4 | presentation | pl CVC4 presentation language\n\
427 cvc3 CVC3 presentation language\n\
428 smt | smtlib | smt2 |\n\
429 smt2.0 | smtlib2.0 | smtlib2 SMT-LIB format 2.0\n\
430 smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
431 smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
432 tptp TPTP format\n\
433 z3str SMT-LIB 2.0 with Z3-str string constraints\n\
434 ast internal format (simple syntax trees)\n\
435 ";
436
437 std::string Options::getDescription() const {
438 return optionsDescription;
439 }
440
441 void Options::printUsage(const std::string msg, std::ostream& out) {
442 out << msg << optionsDescription << std::endl
443 << optionsFootnote << std::endl << std::flush;
444 }
445
446 void Options::printShortUsage(const std::string msg, std::ostream& out) {
447 out << msg << mostCommonOptionsDescription << std::endl
448 << optionsFootnote << std::endl
449 << "For full usage, please use --help."
450 << std::endl << std::endl << std::flush;
451 }
452
453 void Options::printLanguageHelp(std::ostream& out) {
454 out << languageDescription << std::flush;
455 }
456
457 /**
458 * This is a table of long options. By policy, each short option
459 * should have an equivalent long option (but the reverse isn't the
460 * case), so this table should thus contain all command-line options.
461 *
462 * Each option in this array has four elements:
463 *
464 * 1. the long option string
465 * 2. argument behavior for the option:
466 * no_argument - no argument permitted
467 * required_argument - an argument is expected
468 * optional_argument - an argument is permitted but not required
469 * 3. this is a pointer to an int which is set to the 4th entry of the
470 * array if the option is present; or NULL, in which case
471 * getopt_long() returns the 4th entry
472 * 4. the return value for getopt_long() when this long option (or the
473 * value to set the 3rd entry to; see #3)
474 *
475 * If you add something here, you should add it in src/main/usage.h
476 * also, to document it.
477 *
478 * If you add something that has a short option equivalent, you should
479 * add it to the getopt_long() call in parseOptions().
480 */
481 static struct option cmdlineOptions[] = {
482 ${cmdline_options}$
483 { NULL, no_argument, NULL, '\0' }
484 };/* cmdlineOptions */
485
486 namespace options {
487
488 /** Set a given Options* as "current" just for a particular scope. */
489 class OptionsGuard {
490 Options** d_field;
491 Options* d_old;
492 public:
493 OptionsGuard(Options** field, Options* opts) :
494 d_field(field),
495 d_old(*field) {
496 *field = opts;
497 }
498 ~OptionsGuard() {
499 *d_field = d_old;
500 }
501 };/* class OptionsGuard */
502
503 }/* CVC4::options namespace */
504
505 /**
506 * Parse argc/argv and put the result into a CVC4::Options.
507 * The return value is what's left of the command line (that is, the
508 * non-option arguments).
509 *
510 * Throws OptionException on failures.
511 */
512 std::vector<std::string> Options::parseOptions(Options* options,
513 int argc,
514 char* argv[])
515 {
516 Assert(options != NULL);
517 Assert(argv != NULL);
518
519 options::OptionsGuard guard(&s_current, options);
520
521 const char *progName = argv[0];
522
523 // To debug options parsing, you may prefer to simply uncomment this
524 // and recompile. Debug flags have not been parsed yet so these have
525 // not been set.
526 //DebugChannel.on("options");
527
528 Debug("options") << "Options::parseOptions == " << options << std::endl;
529 Debug("options") << "argv == " << argv << std::endl;
530
531 // Find the base name of the program.
532 const char *x = strrchr(progName, '/');
533 if(x != NULL) {
534 progName = x + 1;
535 }
536 options->d_holder->binary_name = std::string(progName);
537
538
539 std::vector<std::string> nonoptions;
540 parseOptionsRecursive(options, argc, argv, &nonoptions);
541 if(Debug.isOn("options")){
542 for(std::vector<std::string>::const_iterator i = nonoptions.begin(),
543 iend = nonoptions.end(); i != iend; ++i){
544 Debug("options") << "nonoptions " << *i << std::endl;
545 }
546 }
547
548 return nonoptions;
549 }
550
551 void Options::parseOptionsRecursive(Options* options,
552 int argc,
553 char* argv[],
554 std::vector<std::string>* nonoptions)
555 {
556
557 if(Debug.isOn("options")) {
558 Debug("options") << "starting a new parseOptionsRecursive with "
559 << argc << " arguments" << std::endl;
560 for( int i = 0; i < argc ; i++ ){
561 Assert(argv[i] != NULL);
562 Debug("options") << " argv[" << i << "] = " << argv[i] << std::endl;
563 }
564 }
565
566 // Having this synonym simplifies the generation code in mkoptions.
567 options::OptionsHandler* handler = options->d_handler;
568
569 // Reset getopt(), in the case of multiple calls to parseOptions().
570 // This can be = 1 in newer GNU getopt, but older (< 2007) require = 0.
571 optind = 0;
572 #if HAVE_DECL_OPTRESET
573 optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
574 #endif /* HAVE_DECL_OPTRESET */
575
576 // We must parse the binary name, which is manually ignored below. Setting
577 // this to 1 leads to incorrect behavior on some platforms.
578 int main_optind = 0;
579 int old_optind;
580
581
582 while(true) { // Repeat Forever
583
584 optopt = 0;
585 std::string option, optionarg;
586
587 optind = main_optind;
588 old_optind = main_optind;
589
590 // If we encounter an element that is not at zero and does not start
591 // with a "-", this is a non-option. We consume this element as a
592 // non-option.
593 if (main_optind > 0 && main_optind < argc &&
594 argv[main_optind][0] != '-') {
595 Debug("options") << "enqueueing " << argv[main_optind]
596 << " as a non-option." << std::endl;
597 nonoptions->push_back(argv[main_optind]);
598 ++main_optind;
599 continue;
600 }
601
602
603 Debug("options") << "[ before, main_optind == " << main_optind << " ]"
604 << std::endl;
605 Debug("options") << "[ before, optind == " << optind << " ]" << std::endl;
606 Debug("options") << "[ argc == " << argc << ", argv == " << argv << " ]"
607 << std::endl;
608 int c = getopt_long(argc, argv,
609 "+:${options_short}$",
610 cmdlineOptions, NULL);
611
612 main_optind = optind;
613
614 Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]"
615 << "[ next option will be at pos: " << optind << " ]"
616 << std::endl;
617
618 // The initial getopt_long call should always determine that argv[0]
619 // is not an option and returns -1. We always manually advance beyond
620 // this element.
621 if ( old_optind == 0 && c == -1 ) {
622 Assert(main_optind > 0);
623 continue;
624 }
625
626 if ( c == -1 ) {
627 if(Debug.isOn("options")) {
628 Debug("options") << "done with option parsing" << std::endl;
629 for(int index = optind; index < argc; ++index) {
630 Debug("options") << "remaining " << argv[index] << std::endl;
631 }
632 }
633 break;
634 }
635
636 option = argv[old_optind == 0 ? 1 : old_optind];
637 optionarg = (optarg == NULL) ? "" : optarg;
638
639 Debug("preemptGetopt") << "processing option " << c
640 << " (`" << char(c) << "'), " << option << std::endl;
641
642 switch(c) {
643 ${options_handler}$
644
645
646 case ':':
647 // This can be a long or short option, and the way to get at the
648 // name of it is different.
649 throw OptionException(std::string("option `") + option +
650 "' missing its required argument");
651
652 case '?':
653 default:
654 throw OptionException(std::string("can't understand option `") + option +
655 "'" + suggestCommandLineOptions(option));
656 }
657 }
658
659 Debug("options") << "got " << nonoptions->size()
660 << " non-option arguments." << std::endl;
661 }
662
663 std::string Options::suggestCommandLineOptions(const std::string& optionName)
664 {
665 DidYouMean didYouMean;
666
667 const char* opt;
668 for(size_t i = 0; (opt = cmdlineOptions[i].name) != NULL; ++i) {
669 didYouMean.addWord(std::string("--") + cmdlineOptions[i].name);
670 }
671
672 return didYouMean.getMatchAsString(optionName.substr(0, optionName.find('=')));
673 }
674
675 static const char* smtOptions[] = {
676 ${options_smt}$
677 NULL
678 };/* smtOptions[] */
679
680 std::vector<std::string> Options::suggestSmtOptions(
681 const std::string& optionName)
682 {
683 std::vector<std::string> suggestions;
684
685 const char* opt;
686 for(size_t i = 0; (opt = smtOptions[i]) != NULL; ++i) {
687 if(std::strstr(opt, optionName.c_str()) != NULL) {
688 suggestions.push_back(opt);
689 }
690 }
691
692 return suggestions;
693 }
694
695 std::vector<std::vector<std::string> > Options::getOptions() const
696 {
697 std::vector< std::vector<std::string> > opts;
698
699 ${options_getoptions}$
700
701
702 return opts;
703 }
704
705 void Options::setOption(const std::string& key, const std::string& optionarg)
706 {
707 options::OptionsHandler* handler = d_handler;
708 Options *options = Options::current();
709 Trace("options") << "SMT setOption(" << key << ", " << optionarg << ")"
710 << std::endl;
711
712 ${setoption_handlers}$
713
714
715 throw UnrecognizedOptionException(key);
716 }
717
718 std::string Options::getOption(const std::string& key) const
719 {
720 Trace("options") << "SMT getOption(" << key << ")" << std::endl;
721
722 ${getoption_handlers}$
723
724
725 throw UnrecognizedOptionException(key);
726 }
727
728 #undef USE_EARLY_TYPE_CHECKING_BY_DEFAULT
729 #undef DO_SEMANTIC_CHECKS_BY_DEFAULT
730
731 } // namespace CVC4