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 |
|
NONE, |
38 |
|
NO_MINIMAL, |
39 |
|
FULL |
40 |
|
}; |
41 |
|
|
42 |
|
static constexpr size_t UfssMode__numValues = 3; |
43 |
|
|
44 |
|
std::ostream& operator<<(std::ostream& os, UfssMode mode); |
45 |
|
UfssMode stringToUfssMode(const std::string& optarg); |
46 |
|
// clang-format on |
47 |
|
|
48 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
49 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
50 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
51 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
52 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
53 |
|
|
54 |
27397 |
struct HolderUF |
55 |
|
{ |
56 |
|
// clang-format off |
57 |
|
bool ufSymmetryBreaker = true; |
58 |
|
bool ufSymmetryBreakerWasSetByUser = false; |
59 |
|
bool ufHo = false; |
60 |
|
bool ufHoWasSetByUser = false; |
61 |
|
bool ufHoExt = true; |
62 |
|
bool ufHoExtWasSetByUser = false; |
63 |
|
int ufssAbortCardinality = -1; |
64 |
|
bool ufssAbortCardinalityWasSetByUser = false; |
65 |
|
bool ufssFairness = true; |
66 |
|
bool ufssFairnessWasSetByUser = false; |
67 |
|
bool ufssFairnessMonotone = false; |
68 |
|
bool ufssFairnessMonotoneWasSetByUser = false; |
69 |
|
int ufssTotalityLimited = -1; |
70 |
|
bool ufssTotalityLimitedWasSetByUser = false; |
71 |
|
bool ufssTotalitySymBreak = false; |
72 |
|
bool ufssTotalitySymBreakWasSetByUser = false; |
73 |
|
UfssMode ufssMode = UfssMode::FULL; |
74 |
|
bool ufssModeWasSetByUser = false; |
75 |
|
// clang-format on |
76 |
|
}; |
77 |
|
|
78 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
79 |
|
|
80 |
|
// clang-format off |
81 |
|
extern struct ufSymmetryBreaker__option_t |
82 |
|
{ |
83 |
|
typedef bool type; |
84 |
|
type operator()() const; |
85 |
|
} thread_local ufSymmetryBreaker; |
86 |
|
extern struct ufHo__option_t |
87 |
|
{ |
88 |
|
typedef bool type; |
89 |
|
type operator()() const; |
90 |
|
} thread_local ufHo; |
91 |
|
extern struct ufHoExt__option_t |
92 |
|
{ |
93 |
|
typedef bool type; |
94 |
|
type operator()() const; |
95 |
|
} thread_local ufHoExt; |
96 |
|
extern struct ufssAbortCardinality__option_t |
97 |
|
{ |
98 |
|
typedef int type; |
99 |
|
type operator()() const; |
100 |
|
} thread_local ufssAbortCardinality; |
101 |
|
extern struct ufssFairness__option_t |
102 |
|
{ |
103 |
|
typedef bool type; |
104 |
|
type operator()() const; |
105 |
|
} thread_local ufssFairness; |
106 |
|
extern struct ufssFairnessMonotone__option_t |
107 |
|
{ |
108 |
|
typedef bool type; |
109 |
|
type operator()() const; |
110 |
|
} thread_local ufssFairnessMonotone; |
111 |
|
extern struct ufssTotalityLimited__option_t |
112 |
|
{ |
113 |
|
typedef int type; |
114 |
|
type operator()() const; |
115 |
|
} thread_local ufssTotalityLimited; |
116 |
|
extern struct ufssTotalitySymBreak__option_t |
117 |
|
{ |
118 |
|
typedef bool type; |
119 |
|
type operator()() const; |
120 |
|
} thread_local ufssTotalitySymBreak; |
121 |
|
extern struct ufssMode__option_t |
122 |
|
{ |
123 |
|
typedef UfssMode type; |
124 |
|
type operator()() const; |
125 |
|
} thread_local ufssMode; |
126 |
|
// clang-format on |
127 |
|
|
128 |
|
namespace uf |
129 |
|
{ |
130 |
|
// clang-format off |
131 |
|
static constexpr const char* ufSymmetryBreaker__name = "symmetry-breaker"; |
132 |
|
static constexpr const char* ufHo__name = "uf-ho"; |
133 |
|
static constexpr const char* ufHoExt__name = "uf-ho-ext"; |
134 |
|
static constexpr const char* ufssAbortCardinality__name = "uf-ss-abort-card"; |
135 |
|
static constexpr const char* ufssFairness__name = "uf-ss-fair"; |
136 |
|
static constexpr const char* ufssFairnessMonotone__name = "uf-ss-fair-monotone"; |
137 |
|
static constexpr const char* ufssTotalityLimited__name = "uf-ss-totality-limited"; |
138 |
|
static constexpr const char* ufssTotalitySymBreak__name = "uf-ss-totality-sym-break"; |
139 |
|
static constexpr const char* ufssMode__name = "uf-ss"; |
140 |
|
// clang-format on |
141 |
|
} |
142 |
|
|
143 |
|
} // namespace options |
144 |
|
|
145 |
|
// clang-format off |
146 |
|
|
147 |
|
// clang-format on |
148 |
|
|
149 |
|
namespace options { |
150 |
|
// clang-format off |
151 |
120950 |
inline bool ufSymmetryBreaker__option_t::operator()() const |
152 |
120950 |
{ return Options::current().uf.ufSymmetryBreaker; } |
153 |
11104827 |
inline bool ufHo__option_t::operator()() const |
154 |
11104827 |
{ return Options::current().uf.ufHo; } |
155 |
34491 |
inline bool ufHoExt__option_t::operator()() const |
156 |
34491 |
{ return Options::current().uf.ufHoExt; } |
157 |
7377 |
inline int ufssAbortCardinality__option_t::operator()() const |
158 |
7377 |
{ return Options::current().uf.ufssAbortCardinality; } |
159 |
12900 |
inline bool ufssFairness__option_t::operator()() const |
160 |
12900 |
{ return Options::current().uf.ufssFairness; } |
161 |
99642 |
inline bool ufssFairnessMonotone__option_t::operator()() const |
162 |
99642 |
{ return Options::current().uf.ufssFairnessMonotone; } |
163 |
|
inline int ufssTotalityLimited__option_t::operator()() const |
164 |
|
{ return Options::current().uf.ufssTotalityLimited; } |
165 |
|
inline bool ufssTotalitySymBreak__option_t::operator()() const |
166 |
|
{ return Options::current().uf.ufssTotalitySymBreak; } |
167 |
941005 |
inline UfssMode ufssMode__option_t::operator()() const |
168 |
941005 |
{ return Options::current().uf.ufssMode; } |
169 |
|
// clang-format on |
170 |
|
|
171 |
|
namespace uf |
172 |
|
{ |
173 |
|
// clang-format off |
174 |
|
void setDefaultUfSymmetryBreaker(Options& opts, bool value); |
175 |
|
void setDefaultUfHo(Options& opts, bool value); |
176 |
|
void setDefaultUfHoExt(Options& opts, bool value); |
177 |
|
void setDefaultUfssAbortCardinality(Options& opts, int value); |
178 |
|
void setDefaultUfssFairness(Options& opts, bool value); |
179 |
|
void setDefaultUfssFairnessMonotone(Options& opts, bool value); |
180 |
|
void setDefaultUfssTotalityLimited(Options& opts, int value); |
181 |
|
void setDefaultUfssTotalitySymBreak(Options& opts, bool value); |
182 |
|
void setDefaultUfssMode(Options& opts, UfssMode value); |
183 |
|
// clang-format on |
184 |
|
} |
185 |
|
|
186 |
|
} // namespace options |
187 |
|
} // namespace cvc5 |
188 |
|
|
189 |
|
#endif /* CVC5__OPTIONS__UF_H */ |