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/printer_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, PrintInstMode mode) |
29 |
|
{ |
30 |
|
switch(mode) |
31 |
|
{ |
32 |
|
case PrintInstMode::LIST: return os << "list"; |
33 |
|
case PrintInstMode::NUM: return os << "num"; |
34 |
|
default: Unreachable(); |
35 |
|
} |
36 |
|
return os; |
37 |
|
} |
38 |
3 |
PrintInstMode stringToPrintInstMode(const std::string& optarg) |
39 |
|
{ |
40 |
3 |
if (optarg == "list") return PrintInstMode::LIST; |
41 |
3 |
else if (optarg == "num") return PrintInstMode::NUM; |
42 |
|
else if (optarg == "help") |
43 |
|
{ |
44 |
|
std::cerr << R"FOOBAR( |
45 |
|
Print format for printing instantiations. |
46 |
|
Available modes for --print-inst are: |
47 |
|
+ list (default) |
48 |
|
Print the list of instantiations per quantified formula, when non-empty. |
49 |
|
+ num |
50 |
|
Print the total number of instantiations per quantified formula, when |
51 |
|
non-zero. |
52 |
|
)FOOBAR"; |
53 |
|
std::exit(1); |
54 |
|
} |
55 |
|
throw OptionException(std::string("unknown option for --print-inst: `") + |
56 |
|
optarg + "'. Try --print-inst=help."); |
57 |
|
} |
58 |
|
// clang-format on |
59 |
|
|
60 |
31137 |
} // namespace cvc5::options |