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__DECISION_H |
22 |
|
#define CVC5__OPTIONS__DECISION_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
#include "options/decision_weight.h" |
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace options { |
32 |
|
|
33 |
|
// clang-format off |
34 |
|
|
35 |
|
enum class DecisionWeightInternal |
36 |
|
{ |
37 |
|
USR1, |
38 |
|
OFF, |
39 |
|
MAX, |
40 |
|
SUM |
41 |
|
}; |
42 |
|
std::ostream& operator<<(std::ostream& os, DecisionWeightInternal mode); |
43 |
|
DecisionWeightInternal stringToDecisionWeightInternal(const std::string& optarg); |
44 |
|
enum class DecisionMode |
45 |
|
{ |
46 |
|
RELEVANCY, |
47 |
|
INTERNAL, |
48 |
|
JUSTIFICATION |
49 |
|
}; |
50 |
|
std::ostream& operator<<(std::ostream& os, DecisionMode mode); |
51 |
|
DecisionMode stringToDecisionMode(const std::string& optarg); |
52 |
|
// clang-format on |
53 |
|
|
54 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
55 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
56 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
57 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
58 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
59 |
|
|
60 |
24449 |
struct HolderDECISION |
61 |
|
{ |
62 |
|
// clang-format off |
63 |
|
int decisionRandomWeight = 0;\ |
64 |
|
bool decisionRandomWeight__setByUser__ = false; |
65 |
|
decision::DecisionWeight decisionThreshold = 0;\ |
66 |
|
bool decisionThreshold__setByUser__ = false; |
67 |
|
bool decisionUseWeight = false;\ |
68 |
|
bool decisionUseWeight__setByUser__ = false; |
69 |
|
DecisionWeightInternal decisionWeightInternal = DecisionWeightInternal::OFF;\ |
70 |
|
bool decisionWeightInternal__setByUser__ = false; |
71 |
|
DecisionMode decisionMode = DecisionMode::INTERNAL;\ |
72 |
|
bool decisionMode__setByUser__ = false; |
73 |
|
bool decisionStopOnly;\ |
74 |
|
bool decisionStopOnly__setByUser__ = false; |
75 |
|
// clang-format on |
76 |
|
}; |
77 |
|
|
78 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
79 |
|
|
80 |
|
// clang-format off |
81 |
|
extern struct decisionRandomWeight__option_t |
82 |
|
{ |
83 |
|
typedef int type; |
84 |
|
type operator()() const; |
85 |
|
} thread_local decisionRandomWeight; |
86 |
|
extern struct decisionThreshold__option_t |
87 |
|
{ |
88 |
|
typedef decision::DecisionWeight type; |
89 |
|
type operator()() const; |
90 |
|
} thread_local decisionThreshold; |
91 |
|
extern struct decisionUseWeight__option_t |
92 |
|
{ |
93 |
|
typedef bool type; |
94 |
|
type operator()() const; |
95 |
|
} thread_local decisionUseWeight; |
96 |
|
extern struct decisionWeightInternal__option_t |
97 |
|
{ |
98 |
|
typedef DecisionWeightInternal type; |
99 |
|
type operator()() const; |
100 |
|
} thread_local decisionWeightInternal; |
101 |
|
extern struct decisionMode__option_t |
102 |
|
{ |
103 |
|
typedef DecisionMode type; |
104 |
|
type operator()() const; |
105 |
|
} thread_local decisionMode; |
106 |
|
extern struct decisionStopOnly__option_t |
107 |
|
{ |
108 |
|
typedef bool type; |
109 |
|
type operator()() const; |
110 |
|
} thread_local decisionStopOnly; |
111 |
|
// clang-format on |
112 |
|
|
113 |
|
namespace decision |
114 |
|
{ |
115 |
|
// clang-format off |
116 |
|
static constexpr const char* decisionRandomWeight__name = "decision-random-weight"; |
117 |
|
static constexpr const char* decisionThreshold__name = "decision-threshold"; |
118 |
|
static constexpr const char* decisionUseWeight__name = "decision-use-weight"; |
119 |
|
static constexpr const char* decisionWeightInternal__name = "decision-weight-internal"; |
120 |
|
static constexpr const char* decisionMode__name = "decision"; |
121 |
|
static constexpr const char* decisionStopOnly__name = ""; |
122 |
|
// clang-format on |
123 |
|
} |
124 |
|
|
125 |
|
} // namespace options |
126 |
|
|
127 |
|
// clang-format off |
128 |
|
template <> options::decisionRandomWeight__option_t::type& Options::ref( |
129 |
|
options::decisionRandomWeight__option_t); |
130 |
|
template <> const options::decisionRandomWeight__option_t::type& Options::operator[]( |
131 |
|
options::decisionRandomWeight__option_t) const; |
132 |
|
template <> bool Options::wasSetByUser(options::decisionRandomWeight__option_t) const; |
133 |
|
template <> options::decisionThreshold__option_t::type& Options::ref( |
134 |
|
options::decisionThreshold__option_t); |
135 |
|
template <> const options::decisionThreshold__option_t::type& Options::operator[]( |
136 |
|
options::decisionThreshold__option_t) const; |
137 |
|
template <> bool Options::wasSetByUser(options::decisionThreshold__option_t) const; |
138 |
|
template <> options::decisionUseWeight__option_t::type& Options::ref( |
139 |
|
options::decisionUseWeight__option_t); |
140 |
|
template <> const options::decisionUseWeight__option_t::type& Options::operator[]( |
141 |
|
options::decisionUseWeight__option_t) const; |
142 |
|
template <> bool Options::wasSetByUser(options::decisionUseWeight__option_t) const; |
143 |
|
template <> options::decisionWeightInternal__option_t::type& Options::ref( |
144 |
|
options::decisionWeightInternal__option_t); |
145 |
|
template <> const options::decisionWeightInternal__option_t::type& Options::operator[]( |
146 |
|
options::decisionWeightInternal__option_t) const; |
147 |
|
template <> bool Options::wasSetByUser(options::decisionWeightInternal__option_t) const; |
148 |
|
template <> options::decisionMode__option_t::type& Options::ref( |
149 |
|
options::decisionMode__option_t); |
150 |
|
template <> const options::decisionMode__option_t::type& Options::operator[]( |
151 |
|
options::decisionMode__option_t) const; |
152 |
|
template <> bool Options::wasSetByUser(options::decisionMode__option_t) const; |
153 |
|
template <> options::decisionStopOnly__option_t::type& Options::ref( |
154 |
|
options::decisionStopOnly__option_t); |
155 |
|
template <> const options::decisionStopOnly__option_t::type& Options::operator[]( |
156 |
|
options::decisionStopOnly__option_t) const; |
157 |
|
template <> bool Options::wasSetByUser(options::decisionStopOnly__option_t) const; |
158 |
|
// clang-format on |
159 |
|
|
160 |
|
namespace options { |
161 |
|
// clang-format off |
162 |
|
inline decisionRandomWeight__option_t::type decisionRandomWeight__option_t::operator()() const |
163 |
|
{ |
164 |
|
return Options::current()[*this]; |
165 |
|
} |
166 |
742041 |
inline decisionThreshold__option_t::type decisionThreshold__option_t::operator()() const |
167 |
|
{ |
168 |
742041 |
return Options::current()[*this]; |
169 |
|
} |
170 |
12219133 |
inline decisionUseWeight__option_t::type decisionUseWeight__option_t::operator()() const |
171 |
|
{ |
172 |
12219133 |
return Options::current()[*this]; |
173 |
|
} |
174 |
|
inline decisionWeightInternal__option_t::type decisionWeightInternal__option_t::operator()() const |
175 |
|
{ |
176 |
|
return Options::current()[*this]; |
177 |
|
} |
178 |
34310 |
inline decisionMode__option_t::type decisionMode__option_t::operator()() const |
179 |
|
{ |
180 |
34310 |
return Options::current()[*this]; |
181 |
|
} |
182 |
1950574 |
inline decisionStopOnly__option_t::type decisionStopOnly__option_t::operator()() const |
183 |
|
{ |
184 |
1950574 |
return Options::current()[*this]; |
185 |
|
} |
186 |
|
// clang-format on |
187 |
|
|
188 |
|
} // namespace options |
189 |
|
} // namespace cvc5 |
190 |
|
|
191 |
|
#endif /* CVC5__OPTIONS__DECISION_H */ |