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 |
|
* Contains code for handling command-line options. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.h file. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__OPTIONS__BASE_H |
22 |
|
#define CVC5__OPTIONS__BASE_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
#include "options/language.h" |
28 |
|
#include "options/managed_streams.h" |
29 |
|
#include <bitset> |
30 |
|
#include <iostream> |
31 |
|
// clang-format on |
32 |
|
|
33 |
|
namespace cvc5::options { |
34 |
|
|
35 |
|
// clang-format off |
36 |
|
enum class OutputTag |
37 |
|
{ |
38 |
|
SYGUS_GRAMMAR, RAW_BENCHMARK, TRIGGER, SYGUS, NONE, INST, |
39 |
|
__MAX_VALUE = INST |
40 |
|
}; |
41 |
|
std::ostream& operator<<(std::ostream& os, OutputTag mode); |
42 |
|
OutputTag stringToOutputTag(const std::string& optarg); |
43 |
|
|
44 |
|
// clang-format on |
45 |
|
|
46 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
47 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
48 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
49 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
50 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
51 |
|
|
52 |
82284 |
struct HolderBASE |
53 |
|
{ |
54 |
|
// clang-format off |
55 |
|
ManagedErr err; |
56 |
|
bool errWasSetByUser = false; |
57 |
|
ManagedIn in; |
58 |
|
bool inWasSetByUser = false; |
59 |
|
bool incrementalSolving = true; |
60 |
|
bool incrementalSolvingWasSetByUser = false; |
61 |
|
Language inputLanguage = Language::LANG_AUTO; |
62 |
|
bool inputLanguageWasSetByUser = false; |
63 |
|
ManagedOut out; |
64 |
|
bool outWasSetByUser = false; |
65 |
|
OutputTag outputTag = OutputTag::NONE; |
66 |
|
bool outputTagWasSetByUser = false; |
67 |
|
Language outputLanguage = Language::LANG_AUTO; |
68 |
|
bool outputLanguageWasSetByUser = false; |
69 |
|
bool parseOnly; |
70 |
|
bool parseOnlyWasSetByUser = false; |
71 |
|
bool preprocessOnly; |
72 |
|
bool preprocessOnlyWasSetByUser = false; |
73 |
|
bool printSuccess; |
74 |
|
bool printSuccessWasSetByUser = false; |
75 |
|
uint64_t cumulativeResourceLimit; |
76 |
|
bool cumulativeResourceLimitWasSetByUser = false; |
77 |
|
uint64_t perCallResourceLimit; |
78 |
|
bool perCallResourceLimitWasSetByUser = false; |
79 |
|
bool statistics; |
80 |
|
bool statisticsWasSetByUser = false; |
81 |
|
bool statisticsAll; |
82 |
|
bool statisticsAllWasSetByUser = false; |
83 |
|
bool statisticsEveryQuery = false; |
84 |
|
bool statisticsEveryQueryWasSetByUser = false; |
85 |
|
bool statisticsExpert; |
86 |
|
bool statisticsExpertWasSetByUser = false; |
87 |
|
uint64_t cumulativeMillisecondLimit; |
88 |
|
bool cumulativeMillisecondLimitWasSetByUser = false; |
89 |
|
uint64_t perCallMillisecondLimit; |
90 |
|
bool perCallMillisecondLimitWasSetByUser = false; |
91 |
|
int64_t verbosity = 0; |
92 |
|
bool verbosityWasSetByUser = false; |
93 |
|
std::bitset<static_cast<size_t>(OutputTag::__MAX_VALUE)+1> outputTagHolder; |
94 |
|
bool outputTagHolderWasSetByUser = false; |
95 |
|
std::vector<std::string> resourceWeightHolder; |
96 |
|
bool resourceWeightHolderWasSetByUser = false; |
97 |
|
// clang-format on |
98 |
|
}; |
99 |
|
|
100 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
101 |
|
|
102 |
|
// clang-format off |
103 |
|
inline ManagedErr err() { return Options::current().base.err; } |
104 |
|
inline ManagedIn in() { return Options::current().base.in; } |
105 |
7475592 |
inline bool incrementalSolving() { return Options::current().base.incrementalSolving; } |
106 |
16 |
inline Language inputLanguage() { return Options::current().base.inputLanguage; } |
107 |
|
inline ManagedOut out() { return Options::current().base.out; } |
108 |
|
inline OutputTag outputTag() { return Options::current().base.outputTag; } |
109 |
76553 |
inline Language outputLanguage() { return Options::current().base.outputLanguage; } |
110 |
|
inline bool parseOnly() { return Options::current().base.parseOnly; } |
111 |
20562 |
inline bool preprocessOnly() { return Options::current().base.preprocessOnly; } |
112 |
|
inline bool printSuccess() { return Options::current().base.printSuccess; } |
113 |
|
inline uint64_t cumulativeResourceLimit() { return Options::current().base.cumulativeResourceLimit; } |
114 |
|
inline uint64_t perCallResourceLimit() { return Options::current().base.perCallResourceLimit; } |
115 |
|
inline bool statistics() { return Options::current().base.statistics; } |
116 |
|
inline bool statisticsAll() { return Options::current().base.statisticsAll; } |
117 |
|
inline bool statisticsEveryQuery() { return Options::current().base.statisticsEveryQuery; } |
118 |
|
inline bool statisticsExpert() { return Options::current().base.statisticsExpert; } |
119 |
|
inline uint64_t cumulativeMillisecondLimit() { return Options::current().base.cumulativeMillisecondLimit; } |
120 |
|
inline uint64_t perCallMillisecondLimit() { return Options::current().base.perCallMillisecondLimit; } |
121 |
|
inline int64_t verbosity() { return Options::current().base.verbosity; } |
122 |
|
inline std::bitset<static_cast<size_t>(OutputTag::__MAX_VALUE)+1> outputTagHolder() { return Options::current().base.outputTagHolder; } |
123 |
|
inline std::vector<std::string> resourceWeightHolder() { return Options::current().base.resourceWeightHolder; } |
124 |
|
// clang-format on |
125 |
|
|
126 |
|
} // namespace cvc5::options |
127 |
|
|
128 |
|
#endif /* CVC5__OPTIONS__BASE_H */ |