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__UF_H |
22 |
|
#define CVC5__OPTIONS__UF_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
|
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace options { |
32 |
|
|
33 |
|
// clang-format off |
34 |
|
|
35 |
|
enum class UfssMode |
36 |
|
{ |
37 |
|
FULL, |
38 |
|
NO_MINIMAL, |
39 |
|
NONE |
40 |
|
}; |
41 |
|
std::ostream& operator<<(std::ostream& os, UfssMode mode); |
42 |
|
UfssMode stringToUfssMode(const std::string& optarg); |
43 |
|
// clang-format on |
44 |
|
|
45 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
46 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
47 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
48 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
49 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
50 |
|
|
51 |
25265 |
struct HolderUF |
52 |
|
{ |
53 |
|
// clang-format off |
54 |
|
bool ufSymmetryBreaker = true;\ |
55 |
|
bool ufSymmetryBreaker__setByUser__ = false; |
56 |
|
bool ufHo = false;\ |
57 |
|
bool ufHo__setByUser__ = false; |
58 |
|
bool ufHoExt = true;\ |
59 |
|
bool ufHoExt__setByUser__ = false; |
60 |
|
int ufssAbortCardinality = -1;\ |
61 |
|
bool ufssAbortCardinality__setByUser__ = false; |
62 |
|
bool ufssFairness = true;\ |
63 |
|
bool ufssFairness__setByUser__ = false; |
64 |
|
bool ufssFairnessMonotone = false;\ |
65 |
|
bool ufssFairnessMonotone__setByUser__ = false; |
66 |
|
int ufssTotalityLimited = -1;\ |
67 |
|
bool ufssTotalityLimited__setByUser__ = false; |
68 |
|
bool ufssTotalitySymBreak = false;\ |
69 |
|
bool ufssTotalitySymBreak__setByUser__ = false; |
70 |
|
UfssMode ufssMode = UfssMode::FULL;\ |
71 |
|
bool ufssMode__setByUser__ = false; |
72 |
|
// clang-format on |
73 |
|
}; |
74 |
|
|
75 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
76 |
|
|
77 |
|
// clang-format off |
78 |
|
extern struct ufSymmetryBreaker__option_t |
79 |
|
{ |
80 |
|
typedef bool type; |
81 |
|
type operator()() const; |
82 |
|
} thread_local ufSymmetryBreaker; |
83 |
|
extern struct ufHo__option_t |
84 |
|
{ |
85 |
|
typedef bool type; |
86 |
|
type operator()() const; |
87 |
|
} thread_local ufHo; |
88 |
|
extern struct ufHoExt__option_t |
89 |
|
{ |
90 |
|
typedef bool type; |
91 |
|
type operator()() const; |
92 |
|
} thread_local ufHoExt; |
93 |
|
extern struct ufssAbortCardinality__option_t |
94 |
|
{ |
95 |
|
typedef int type; |
96 |
|
type operator()() const; |
97 |
|
} thread_local ufssAbortCardinality; |
98 |
|
extern struct ufssFairness__option_t |
99 |
|
{ |
100 |
|
typedef bool type; |
101 |
|
type operator()() const; |
102 |
|
} thread_local ufssFairness; |
103 |
|
extern struct ufssFairnessMonotone__option_t |
104 |
|
{ |
105 |
|
typedef bool type; |
106 |
|
type operator()() const; |
107 |
|
} thread_local ufssFairnessMonotone; |
108 |
|
extern struct ufssTotalityLimited__option_t |
109 |
|
{ |
110 |
|
typedef int type; |
111 |
|
type operator()() const; |
112 |
|
} thread_local ufssTotalityLimited; |
113 |
|
extern struct ufssTotalitySymBreak__option_t |
114 |
|
{ |
115 |
|
typedef bool type; |
116 |
|
type operator()() const; |
117 |
|
} thread_local ufssTotalitySymBreak; |
118 |
|
extern struct ufssMode__option_t |
119 |
|
{ |
120 |
|
typedef UfssMode type; |
121 |
|
type operator()() const; |
122 |
|
} thread_local ufssMode; |
123 |
|
// clang-format on |
124 |
|
|
125 |
|
namespace uf |
126 |
|
{ |
127 |
|
// clang-format off |
128 |
|
static constexpr const char* ufSymmetryBreaker__name = "symmetry-breaker"; |
129 |
|
static constexpr const char* ufHo__name = "uf-ho"; |
130 |
|
static constexpr const char* ufHoExt__name = "uf-ho-ext"; |
131 |
|
static constexpr const char* ufssAbortCardinality__name = "uf-ss-abort-card"; |
132 |
|
static constexpr const char* ufssFairness__name = "uf-ss-fair"; |
133 |
|
static constexpr const char* ufssFairnessMonotone__name = "uf-ss-fair-monotone"; |
134 |
|
static constexpr const char* ufssTotalityLimited__name = "uf-ss-totality-limited"; |
135 |
|
static constexpr const char* ufssTotalitySymBreak__name = "uf-ss-totality-sym-break"; |
136 |
|
static constexpr const char* ufssMode__name = "uf-ss"; |
137 |
|
// clang-format on |
138 |
|
} |
139 |
|
|
140 |
|
} // namespace options |
141 |
|
|
142 |
|
// clang-format off |
143 |
|
template <> options::ufSymmetryBreaker__option_t::type& Options::ref( |
144 |
|
options::ufSymmetryBreaker__option_t); |
145 |
|
template <> const options::ufSymmetryBreaker__option_t::type& Options::operator[]( |
146 |
|
options::ufSymmetryBreaker__option_t) const; |
147 |
|
template <> bool Options::wasSetByUser(options::ufSymmetryBreaker__option_t) const; |
148 |
|
template <> options::ufHo__option_t::type& Options::ref( |
149 |
|
options::ufHo__option_t); |
150 |
|
template <> const options::ufHo__option_t::type& Options::operator[]( |
151 |
|
options::ufHo__option_t) const; |
152 |
|
template <> bool Options::wasSetByUser(options::ufHo__option_t) const; |
153 |
|
template <> options::ufHoExt__option_t::type& Options::ref( |
154 |
|
options::ufHoExt__option_t); |
155 |
|
template <> const options::ufHoExt__option_t::type& Options::operator[]( |
156 |
|
options::ufHoExt__option_t) const; |
157 |
|
template <> bool Options::wasSetByUser(options::ufHoExt__option_t) const; |
158 |
|
template <> options::ufssAbortCardinality__option_t::type& Options::ref( |
159 |
|
options::ufssAbortCardinality__option_t); |
160 |
|
template <> const options::ufssAbortCardinality__option_t::type& Options::operator[]( |
161 |
|
options::ufssAbortCardinality__option_t) const; |
162 |
|
template <> bool Options::wasSetByUser(options::ufssAbortCardinality__option_t) const; |
163 |
|
template <> options::ufssFairness__option_t::type& Options::ref( |
164 |
|
options::ufssFairness__option_t); |
165 |
|
template <> const options::ufssFairness__option_t::type& Options::operator[]( |
166 |
|
options::ufssFairness__option_t) const; |
167 |
|
template <> bool Options::wasSetByUser(options::ufssFairness__option_t) const; |
168 |
|
template <> options::ufssFairnessMonotone__option_t::type& Options::ref( |
169 |
|
options::ufssFairnessMonotone__option_t); |
170 |
|
template <> const options::ufssFairnessMonotone__option_t::type& Options::operator[]( |
171 |
|
options::ufssFairnessMonotone__option_t) const; |
172 |
|
template <> bool Options::wasSetByUser(options::ufssFairnessMonotone__option_t) const; |
173 |
|
template <> options::ufssTotalityLimited__option_t::type& Options::ref( |
174 |
|
options::ufssTotalityLimited__option_t); |
175 |
|
template <> const options::ufssTotalityLimited__option_t::type& Options::operator[]( |
176 |
|
options::ufssTotalityLimited__option_t) const; |
177 |
|
template <> bool Options::wasSetByUser(options::ufssTotalityLimited__option_t) const; |
178 |
|
template <> options::ufssTotalitySymBreak__option_t::type& Options::ref( |
179 |
|
options::ufssTotalitySymBreak__option_t); |
180 |
|
template <> const options::ufssTotalitySymBreak__option_t::type& Options::operator[]( |
181 |
|
options::ufssTotalitySymBreak__option_t) const; |
182 |
|
template <> bool Options::wasSetByUser(options::ufssTotalitySymBreak__option_t) const; |
183 |
|
template <> options::ufssMode__option_t::type& Options::ref( |
184 |
|
options::ufssMode__option_t); |
185 |
|
template <> const options::ufssMode__option_t::type& Options::operator[]( |
186 |
|
options::ufssMode__option_t) const; |
187 |
|
template <> bool Options::wasSetByUser(options::ufssMode__option_t) const; |
188 |
|
// clang-format on |
189 |
|
|
190 |
|
namespace options { |
191 |
|
// clang-format off |
192 |
118382 |
inline ufSymmetryBreaker__option_t::type ufSymmetryBreaker__option_t::operator()() const |
193 |
|
{ |
194 |
118382 |
return Options::current()[*this]; |
195 |
|
} |
196 |
12032405 |
inline ufHo__option_t::type ufHo__option_t::operator()() const |
197 |
|
{ |
198 |
12032405 |
return Options::current()[*this]; |
199 |
|
} |
200 |
72827 |
inline ufHoExt__option_t::type ufHoExt__option_t::operator()() const |
201 |
|
{ |
202 |
72827 |
return Options::current()[*this]; |
203 |
|
} |
204 |
7661 |
inline ufssAbortCardinality__option_t::type ufssAbortCardinality__option_t::operator()() const |
205 |
|
{ |
206 |
7661 |
return Options::current()[*this]; |
207 |
|
} |
208 |
13174 |
inline ufssFairness__option_t::type ufssFairness__option_t::operator()() const |
209 |
|
{ |
210 |
13174 |
return Options::current()[*this]; |
211 |
|
} |
212 |
104008 |
inline ufssFairnessMonotone__option_t::type ufssFairnessMonotone__option_t::operator()() const |
213 |
|
{ |
214 |
104008 |
return Options::current()[*this]; |
215 |
|
} |
216 |
|
inline ufssTotalityLimited__option_t::type ufssTotalityLimited__option_t::operator()() const |
217 |
|
{ |
218 |
|
return Options::current()[*this]; |
219 |
|
} |
220 |
|
inline ufssTotalitySymBreak__option_t::type ufssTotalitySymBreak__option_t::operator()() const |
221 |
|
{ |
222 |
|
return Options::current()[*this]; |
223 |
|
} |
224 |
1280958 |
inline ufssMode__option_t::type ufssMode__option_t::operator()() const |
225 |
|
{ |
226 |
1280958 |
return Options::current()[*this]; |
227 |
|
} |
228 |
|
// clang-format on |
229 |
|
|
230 |
|
} // namespace options |
231 |
|
} // namespace cvc5 |
232 |
|
|
233 |
|
#endif /* CVC5__OPTIONS__UF_H */ |