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/uf_options.h" |
19 |
|
|
20 |
|
#include <iostream> |
21 |
|
|
22 |
|
#include "base/check.h" |
23 |
|
#include "options/option_exception.h" |
24 |
|
|
25 |
|
// clang-format off |
26 |
|
namespace cvc5 { |
27 |
|
|
28 |
9460 |
template <> options::ufSymmetryBreaker__option_t::type& Options::ref( |
29 |
|
options::ufSymmetryBreaker__option_t) |
30 |
|
{ |
31 |
9460 |
return uf().ufSymmetryBreaker; |
32 |
|
} |
33 |
118396 |
template <> const options::ufSymmetryBreaker__option_t::type& Options::operator[]( |
34 |
|
options::ufSymmetryBreaker__option_t) const |
35 |
|
{ |
36 |
118396 |
return uf().ufSymmetryBreaker; |
37 |
|
} |
38 |
9460 |
template <> bool Options::wasSetByUser(options::ufSymmetryBreaker__option_t) const |
39 |
|
{ |
40 |
9460 |
return uf().ufSymmetryBreaker__setByUser__; |
41 |
|
} |
42 |
|
template <> options::ufHo__option_t::type& Options::ref( |
43 |
|
options::ufHo__option_t) |
44 |
|
{ |
45 |
|
return uf().ufHo; |
46 |
|
} |
47 |
14998276 |
template <> const options::ufHo__option_t::type& Options::operator[]( |
48 |
|
options::ufHo__option_t) const |
49 |
|
{ |
50 |
14998276 |
return uf().ufHo; |
51 |
|
} |
52 |
|
template <> bool Options::wasSetByUser(options::ufHo__option_t) const |
53 |
|
{ |
54 |
|
return uf().ufHo__setByUser__; |
55 |
|
} |
56 |
|
template <> options::ufHoExt__option_t::type& Options::ref( |
57 |
|
options::ufHoExt__option_t) |
58 |
|
{ |
59 |
|
return uf().ufHoExt; |
60 |
|
} |
61 |
72827 |
template <> const options::ufHoExt__option_t::type& Options::operator[]( |
62 |
|
options::ufHoExt__option_t) const |
63 |
|
{ |
64 |
72827 |
return uf().ufHoExt; |
65 |
|
} |
66 |
|
template <> bool Options::wasSetByUser(options::ufHoExt__option_t) const |
67 |
|
{ |
68 |
|
return uf().ufHoExt__setByUser__; |
69 |
|
} |
70 |
|
template <> options::ufssAbortCardinality__option_t::type& Options::ref( |
71 |
|
options::ufssAbortCardinality__option_t) |
72 |
|
{ |
73 |
|
return uf().ufssAbortCardinality; |
74 |
|
} |
75 |
7661 |
template <> const options::ufssAbortCardinality__option_t::type& Options::operator[]( |
76 |
|
options::ufssAbortCardinality__option_t) const |
77 |
|
{ |
78 |
7661 |
return uf().ufssAbortCardinality; |
79 |
|
} |
80 |
|
template <> bool Options::wasSetByUser(options::ufssAbortCardinality__option_t) const |
81 |
|
{ |
82 |
|
return uf().ufssAbortCardinality__setByUser__; |
83 |
|
} |
84 |
|
template <> options::ufssFairness__option_t::type& Options::ref( |
85 |
|
options::ufssFairness__option_t) |
86 |
|
{ |
87 |
|
return uf().ufssFairness; |
88 |
|
} |
89 |
13174 |
template <> const options::ufssFairness__option_t::type& Options::operator[]( |
90 |
|
options::ufssFairness__option_t) const |
91 |
|
{ |
92 |
13174 |
return uf().ufssFairness; |
93 |
|
} |
94 |
|
template <> bool Options::wasSetByUser(options::ufssFairness__option_t) const |
95 |
|
{ |
96 |
|
return uf().ufssFairness__setByUser__; |
97 |
|
} |
98 |
2049 |
template <> options::ufssFairnessMonotone__option_t::type& Options::ref( |
99 |
|
options::ufssFairnessMonotone__option_t) |
100 |
|
{ |
101 |
2049 |
return uf().ufssFairnessMonotone; |
102 |
|
} |
103 |
104012 |
template <> const options::ufssFairnessMonotone__option_t::type& Options::operator[]( |
104 |
|
options::ufssFairnessMonotone__option_t) const |
105 |
|
{ |
106 |
104012 |
return uf().ufssFairnessMonotone; |
107 |
|
} |
108 |
|
template <> bool Options::wasSetByUser(options::ufssFairnessMonotone__option_t) const |
109 |
|
{ |
110 |
|
return uf().ufssFairnessMonotone__setByUser__; |
111 |
|
} |
112 |
|
template <> options::ufssTotalityLimited__option_t::type& Options::ref( |
113 |
|
options::ufssTotalityLimited__option_t) |
114 |
|
{ |
115 |
|
return uf().ufssTotalityLimited; |
116 |
|
} |
117 |
|
template <> const options::ufssTotalityLimited__option_t::type& Options::operator[]( |
118 |
|
options::ufssTotalityLimited__option_t) const |
119 |
|
{ |
120 |
|
return uf().ufssTotalityLimited; |
121 |
|
} |
122 |
|
template <> bool Options::wasSetByUser(options::ufssTotalityLimited__option_t) const |
123 |
|
{ |
124 |
|
return uf().ufssTotalityLimited__setByUser__; |
125 |
|
} |
126 |
|
template <> options::ufssTotalitySymBreak__option_t::type& Options::ref( |
127 |
|
options::ufssTotalitySymBreak__option_t) |
128 |
|
{ |
129 |
|
return uf().ufssTotalitySymBreak; |
130 |
|
} |
131 |
|
template <> const options::ufssTotalitySymBreak__option_t::type& Options::operator[]( |
132 |
|
options::ufssTotalitySymBreak__option_t) const |
133 |
|
{ |
134 |
|
return uf().ufssTotalitySymBreak; |
135 |
|
} |
136 |
|
template <> bool Options::wasSetByUser(options::ufssTotalitySymBreak__option_t) const |
137 |
|
{ |
138 |
|
return uf().ufssTotalitySymBreak__setByUser__; |
139 |
|
} |
140 |
|
template <> options::ufssMode__option_t::type& Options::ref( |
141 |
|
options::ufssMode__option_t) |
142 |
|
{ |
143 |
|
return uf().ufssMode; |
144 |
|
} |
145 |
1280958 |
template <> const options::ufssMode__option_t::type& Options::operator[]( |
146 |
|
options::ufssMode__option_t) const |
147 |
|
{ |
148 |
1280958 |
return uf().ufssMode; |
149 |
|
} |
150 |
|
template <> bool Options::wasSetByUser(options::ufssMode__option_t) const |
151 |
|
{ |
152 |
|
return uf().ufssMode__setByUser__; |
153 |
|
} |
154 |
|
|
155 |
|
namespace options { |
156 |
|
|
157 |
|
thread_local struct ufSymmetryBreaker__option_t ufSymmetryBreaker; |
158 |
|
thread_local struct ufHo__option_t ufHo; |
159 |
|
thread_local struct ufHoExt__option_t ufHoExt; |
160 |
|
thread_local struct ufssAbortCardinality__option_t ufssAbortCardinality; |
161 |
|
thread_local struct ufssFairness__option_t ufssFairness; |
162 |
|
thread_local struct ufssFairnessMonotone__option_t ufssFairnessMonotone; |
163 |
|
thread_local struct ufssTotalityLimited__option_t ufssTotalityLimited; |
164 |
|
thread_local struct ufssTotalitySymBreak__option_t ufssTotalitySymBreak; |
165 |
|
thread_local struct ufssMode__option_t ufssMode; |
166 |
|
|
167 |
|
|
168 |
|
std::ostream& operator<<(std::ostream& os, UfssMode mode) |
169 |
|
{ |
170 |
|
switch(mode) { |
171 |
|
case UfssMode::NONE: |
172 |
|
return os << "UfssMode::NONE"; |
173 |
|
case UfssMode::FULL: |
174 |
|
return os << "UfssMode::FULL"; |
175 |
|
case UfssMode::NO_MINIMAL: |
176 |
|
return os << "UfssMode::NO_MINIMAL"; |
177 |
|
default: |
178 |
|
Unreachable(); |
179 |
|
} |
180 |
|
return os; |
181 |
|
} |
182 |
|
|
183 |
7 |
UfssMode stringToUfssMode(const std::string& optarg) |
184 |
|
{ |
185 |
7 |
if (optarg == "none") |
186 |
|
{ |
187 |
|
return UfssMode::NONE; |
188 |
|
} |
189 |
7 |
else if (optarg == "full") |
190 |
|
{ |
191 |
|
return UfssMode::FULL; |
192 |
|
} |
193 |
7 |
else if (optarg == "no-minimal") |
194 |
|
{ |
195 |
7 |
return UfssMode::NO_MINIMAL; |
196 |
|
} |
197 |
|
else if (optarg == "help") |
198 |
|
{ |
199 |
|
std::cerr << "UF with cardinality options currently supported by the --uf-ss option when\n" |
200 |
|
"combined with finite model finding.\n" |
201 |
|
"Available modes for --uf-ss are:\n" |
202 |
|
"+ none\n" |
203 |
|
" Do not use UF with cardinality to shrink model sizes.\n" |
204 |
|
"+ full (default)\n" |
205 |
|
" Default, use UF with cardinality to find minimal models for uninterpreted\n" |
206 |
|
" sorts.\n" |
207 |
|
"+ no-minimal\n" |
208 |
|
" Use UF with cardinality to shrink models, but do no enforce minimality.\n"; |
209 |
|
std::exit(1); |
210 |
|
} |
211 |
|
throw OptionException(std::string("unknown option for --uf-ss: `") + |
212 |
|
optarg + "'. Try --uf-ss=help."); |
213 |
|
} |
214 |
|
|
215 |
|
|
216 |
|
} // namespace options |
217 |
28194 |
} // namespace cvc5 |
218 |
|
// clang-format on |