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/base_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 |
2 |
std::ostream& operator<<(std::ostream& os, OutputTag mode) |
29 |
|
{ |
30 |
2 |
switch(mode) |
31 |
|
{ |
32 |
|
case OutputTag::SYGUS_GRAMMAR: return os << "sygus-grammar"; |
33 |
|
case OutputTag::RAW_BENCHMARK: return os << "raw-benchmark"; |
34 |
|
case OutputTag::TRIGGER: return os << "trigger"; |
35 |
|
case OutputTag::SYGUS: return os << "sygus"; |
36 |
2 |
case OutputTag::NONE: return os << "none"; |
37 |
|
case OutputTag::INST: return os << "inst"; |
38 |
|
default: Unreachable(); |
39 |
|
} |
40 |
|
return os; |
41 |
|
} |
42 |
242475 |
OutputTag stringToOutputTag(const std::string& optarg) |
43 |
|
{ |
44 |
242475 |
if (optarg == "sygus-grammar") return OutputTag::SYGUS_GRAMMAR; |
45 |
242473 |
else if (optarg == "raw-benchmark") return OutputTag::RAW_BENCHMARK; |
46 |
18 |
else if (optarg == "trigger") return OutputTag::TRIGGER; |
47 |
18 |
else if (optarg == "sygus") return OutputTag::SYGUS; |
48 |
16 |
else if (optarg == "none") return OutputTag::NONE; |
49 |
16 |
else if (optarg == "inst") return OutputTag::INST; |
50 |
4 |
else if (optarg == "help") |
51 |
|
{ |
52 |
|
std::cerr << R"FOOBAR( |
53 |
|
Output tags. |
54 |
|
Available tags for --output are: |
55 |
|
+ sygus-grammar |
56 |
|
print grammars automatically generated by the sygus solver |
57 |
|
+ raw-benchmark |
58 |
|
print the benchmark back on the output verbatim as it is processed |
59 |
|
+ trigger |
60 |
|
print selected triggers for quantified formulas |
61 |
|
+ sygus |
62 |
|
print enumerated terms and candidates generated by the sygus solver |
63 |
|
+ inst |
64 |
|
print instantiations during solving |
65 |
|
)FOOBAR"; |
66 |
|
std::exit(1); |
67 |
|
} |
68 |
8 |
throw OptionException(std::string("unknown option for --output: `") + |
69 |
12 |
optarg + "'. Try --output=help."); |
70 |
|
} |
71 |
|
// clang-format on |
72 |
|
|
73 |
31137 |
} // namespace cvc5::options |