GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/bv_options.h Lines: 29 45 64.4 %
Date: 2021-08-01 Branches: 1 2 50.0 %

Line Exec Source
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__BV_H
22
#define CVC5__OPTIONS__BV_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 BitblastMode
36
{
37
  EAGER,
38
  LAZY
39
};
40
41
static constexpr size_t BitblastMode__numValues = 2;
42
43
std::ostream& operator<<(std::ostream& os, BitblastMode mode);
44
BitblastMode stringToBitblastMode(const std::string& optarg);
45
enum class BoolToBVMode
46
{
47
  ITE,
48
  OFF,
49
  ALL
50
};
51
52
static constexpr size_t BoolToBVMode__numValues = 3;
53
54
std::ostream& operator<<(std::ostream& os, BoolToBVMode mode);
55
BoolToBVMode stringToBoolToBVMode(const std::string& optarg);
56
enum class SatSolverMode
57
{
58
  MINISAT,
59
  KISSAT,
60
  CADICAL,
61
  CRYPTOMINISAT
62
};
63
64
static constexpr size_t SatSolverMode__numValues = 4;
65
66
std::ostream& operator<<(std::ostream& os, SatSolverMode mode);
67
SatSolverMode stringToSatSolverMode(const std::string& optarg);
68
enum class BVSolver
69
{
70
  LAYERED,
71
  BITBLAST_INTERNAL,
72
  BITBLAST
73
};
74
75
static constexpr size_t BVSolver__numValues = 3;
76
77
std::ostream& operator<<(std::ostream& os, BVSolver mode);
78
BVSolver stringToBVSolver(const std::string& optarg);
79
// clang-format on
80
81
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
82
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
83
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
84
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
85
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
86
87
69165
struct HolderBV
88
{
89
// clang-format off
90
  bool bitvectorAig = false;
91
  bool bitvectorAigWasSetByUser = false;
92
  BitblastMode bitblastMode = BitblastMode::LAZY;
93
  bool bitblastModeWasSetByUser = false;
94
  bool bitwiseEq = true;
95
  bool bitwiseEqWasSetByUser = false;
96
  BoolToBVMode boolToBitvector = BoolToBVMode::OFF;
97
  bool boolToBitvectorWasSetByUser = false;
98
  bool bvAbstraction = false;
99
  bool bvAbstractionWasSetByUser = false;
100
  std::string bitvectorAigSimplifications = "balance;drw";
101
  bool bitvectorAigSimplificationsWasSetByUser = false;
102
  bool bvAlgExtf = true;
103
  bool bvAlgExtfWasSetByUser = false;
104
  unsigned bitvectorAlgebraicBudget = 1500;
105
  bool bitvectorAlgebraicBudgetWasSetByUser = false;
106
  bool bitvectorAlgebraicSolver = false;
107
  bool bitvectorAlgebraicSolverWasSetByUser = false;
108
  bool bvAssertInput = false;
109
  bool bvAssertInputWasSetByUser = false;
110
  bool bvEagerExplanations = false;
111
  bool bvEagerExplanationsWasSetByUser = false;
112
  bool bitvectorEqualitySolver = true;
113
  bool bitvectorEqualitySolverWasSetByUser = false;
114
  bool bvExtractArithRewrite = false;
115
  bool bvExtractArithRewriteWasSetByUser = false;
116
  bool bvGaussElim = false;
117
  bool bvGaussElimWasSetByUser = false;
118
  bool bitvectorInequalitySolver = true;
119
  bool bitvectorInequalitySolverWasSetByUser = false;
120
  bool bvIntroducePow2 = false;
121
  bool bvIntroducePow2WasSetByUser = false;
122
  unsigned bvNumFunc = 1;
123
  bool bvNumFuncWasSetByUser = false;
124
  bool bvPrintConstsAsIndexedSymbols = false;
125
  bool bvPrintConstsAsIndexedSymbolsWasSetByUser = false;
126
  bool bitvectorPropagate = true;
127
  bool bitvectorPropagateWasSetByUser = false;
128
  bool bitvectorQuickXplain = false;
129
  bool bitvectorQuickXplainWasSetByUser = false;
130
  SatSolverMode bvSatSolver = SatSolverMode::MINISAT;
131
  bool bvSatSolverWasSetByUser = false;
132
  bool skolemizeArguments = false;
133
  bool skolemizeArgumentsWasSetByUser = false;
134
  BVSolver bvSolver = BVSolver::BITBLAST;
135
  bool bvSolverWasSetByUser = false;
136
  bool bitvectorToBool = false;
137
  bool bitvectorToBoolWasSetByUser = false;
138
// clang-format on
139
};
140
141
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
142
143
// clang-format off
144
extern struct bitvectorAig__option_t
145
{
146
  typedef bool type;
147
  type operator()() const;
148
} thread_local bitvectorAig;
149
extern struct bitblastMode__option_t
150
{
151
  typedef BitblastMode type;
152
  type operator()() const;
153
} thread_local bitblastMode;
154
extern struct bitwiseEq__option_t
155
{
156
  typedef bool type;
157
  type operator()() const;
158
} thread_local bitwiseEq;
159
extern struct boolToBitvector__option_t
160
{
161
  typedef BoolToBVMode type;
162
  type operator()() const;
163
} thread_local boolToBitvector;
164
extern struct bvAbstraction__option_t
165
{
166
  typedef bool type;
167
  type operator()() const;
168
} thread_local bvAbstraction;
169
extern struct bitvectorAigSimplifications__option_t
170
{
171
  typedef std::string type;
172
  type operator()() const;
173
} thread_local bitvectorAigSimplifications;
174
extern struct bvAlgExtf__option_t
175
{
176
  typedef bool type;
177
  type operator()() const;
178
} thread_local bvAlgExtf;
179
extern struct bitvectorAlgebraicBudget__option_t
180
{
181
  typedef unsigned type;
182
  type operator()() const;
183
} thread_local bitvectorAlgebraicBudget;
184
extern struct bitvectorAlgebraicSolver__option_t
185
{
186
  typedef bool type;
187
  type operator()() const;
188
} thread_local bitvectorAlgebraicSolver;
189
extern struct bvAssertInput__option_t
190
{
191
  typedef bool type;
192
  type operator()() const;
193
} thread_local bvAssertInput;
194
extern struct bvEagerExplanations__option_t
195
{
196
  typedef bool type;
197
  type operator()() const;
198
} thread_local bvEagerExplanations;
199
extern struct bitvectorEqualitySolver__option_t
200
{
201
  typedef bool type;
202
  type operator()() const;
203
} thread_local bitvectorEqualitySolver;
204
extern struct bvExtractArithRewrite__option_t
205
{
206
  typedef bool type;
207
  type operator()() const;
208
} thread_local bvExtractArithRewrite;
209
extern struct bvGaussElim__option_t
210
{
211
  typedef bool type;
212
  type operator()() const;
213
} thread_local bvGaussElim;
214
extern struct bitvectorInequalitySolver__option_t
215
{
216
  typedef bool type;
217
  type operator()() const;
218
} thread_local bitvectorInequalitySolver;
219
extern struct bvIntroducePow2__option_t
220
{
221
  typedef bool type;
222
  type operator()() const;
223
} thread_local bvIntroducePow2;
224
extern struct bvNumFunc__option_t
225
{
226
  typedef unsigned type;
227
  type operator()() const;
228
} thread_local bvNumFunc;
229
extern struct bvPrintConstsAsIndexedSymbols__option_t
230
{
231
  typedef bool type;
232
  type operator()() const;
233
} thread_local bvPrintConstsAsIndexedSymbols;
234
extern struct bitvectorPropagate__option_t
235
{
236
  typedef bool type;
237
  type operator()() const;
238
} thread_local bitvectorPropagate;
239
extern struct bitvectorQuickXplain__option_t
240
{
241
  typedef bool type;
242
  type operator()() const;
243
} thread_local bitvectorQuickXplain;
244
extern struct bvSatSolver__option_t
245
{
246
  typedef SatSolverMode type;
247
  type operator()() const;
248
} thread_local bvSatSolver;
249
extern struct skolemizeArguments__option_t
250
{
251
  typedef bool type;
252
  type operator()() const;
253
} thread_local skolemizeArguments;
254
extern struct bvSolver__option_t
255
{
256
  typedef BVSolver type;
257
  type operator()() const;
258
} thread_local bvSolver;
259
extern struct bitvectorToBool__option_t
260
{
261
  typedef bool type;
262
  type operator()() const;
263
} thread_local bitvectorToBool;
264
// clang-format on
265
266
namespace bv
267
{
268
// clang-format off
269
static constexpr const char* bitvectorAig__name = "bitblast-aig";
270
static constexpr const char* bitblastMode__name = "bitblast";
271
static constexpr const char* bitwiseEq__name = "bitwise-eq";
272
static constexpr const char* boolToBitvector__name = "bool-to-bv";
273
static constexpr const char* bvAbstraction__name = "bv-abstraction";
274
static constexpr const char* bitvectorAigSimplifications__name = "bv-aig-simp";
275
static constexpr const char* bvAlgExtf__name = "bv-alg-extf";
276
static constexpr const char* bitvectorAlgebraicBudget__name = "bv-algebraic-budget";
277
static constexpr const char* bitvectorAlgebraicSolver__name = "bv-algebraic-solver";
278
static constexpr const char* bvAssertInput__name = "bv-assert-input";
279
static constexpr const char* bvEagerExplanations__name = "bv-eager-explanations";
280
static constexpr const char* bitvectorEqualitySolver__name = "bv-eq-solver";
281
static constexpr const char* bvExtractArithRewrite__name = "bv-extract-arith";
282
static constexpr const char* bvGaussElim__name = "bv-gauss-elim";
283
static constexpr const char* bitvectorInequalitySolver__name = "bv-inequality-solver";
284
static constexpr const char* bvIntroducePow2__name = "bv-intro-pow2";
285
static constexpr const char* bvNumFunc__name = "bv-num-func";
286
static constexpr const char* bvPrintConstsAsIndexedSymbols__name = "bv-print-consts-as-indexed-symbols";
287
static constexpr const char* bitvectorPropagate__name = "bv-propagate";
288
static constexpr const char* bitvectorQuickXplain__name = "bv-quick-xplain";
289
static constexpr const char* bvSatSolver__name = "bv-sat-solver";
290
static constexpr const char* skolemizeArguments__name = "bv-skolemize";
291
static constexpr const char* bvSolver__name = "bv-solver";
292
static constexpr const char* bitvectorToBool__name = "bv-to-bool";
293
// clang-format on
294
}
295
296
}  // namespace options
297
298
// clang-format off
299
300
// clang-format on
301
302
namespace options {
303
// clang-format off
304
2521
inline bool bitvectorAig__option_t::operator()() const
305
2521
{ return Options::current().bv.bitvectorAig; }
306
45787
inline BitblastMode bitblastMode__option_t::operator()() const
307
45787
{ return Options::current().bv.bitblastMode; }
308
inline bool bitwiseEq__option_t::operator()() const
309
{ return Options::current().bv.bitwiseEq; }
310
41586
inline BoolToBVMode boolToBitvector__option_t::operator()() const
311
41586
{ return Options::current().bv.boolToBitvector; }
312
23570
inline bool bvAbstraction__option_t::operator()() const
313
23570
{ return Options::current().bv.bvAbstraction; }
314
inline std::string bitvectorAigSimplifications__option_t::operator()() const
315
{ return Options::current().bv.bitvectorAigSimplifications; }
316
inline bool bvAlgExtf__option_t::operator()() const
317
{ return Options::current().bv.bvAlgExtf; }
318
inline unsigned bitvectorAlgebraicBudget__option_t::operator()() const
319
{ return Options::current().bv.bitvectorAlgebraicBudget; }
320
inline bool bitvectorAlgebraicSolver__option_t::operator()() const
321
{ return Options::current().bv.bitvectorAlgebraicSolver; }
322
1241168
inline bool bvAssertInput__option_t::operator()() const
323
1241168
{ return Options::current().bv.bvAssertInput; }
324
172
inline bool bvEagerExplanations__option_t::operator()() const
325
172
{ return Options::current().bv.bvEagerExplanations; }
326
inline bool bitvectorEqualitySolver__option_t::operator()() const
327
{ return Options::current().bv.bitvectorEqualitySolver; }
328
139927
inline bool bvExtractArithRewrite__option_t::operator()() const
329
139927
{ return Options::current().bv.bvExtractArithRewrite; }
330
13735
inline bool bvGaussElim__option_t::operator()() const
331
13735
{ return Options::current().bv.bvGaussElim; }
332
inline bool bitvectorInequalitySolver__option_t::operator()() const
333
{ return Options::current().bv.bitvectorInequalitySolver; }
334
16251
inline bool bvIntroducePow2__option_t::operator()() const
335
16251
{ return Options::current().bv.bvIntroducePow2; }
336
inline unsigned bvNumFunc__option_t::operator()() const
337
{ return Options::current().bv.bvNumFunc; }
338
202
inline bool bvPrintConstsAsIndexedSymbols__option_t::operator()() const
339
202
{ return Options::current().bv.bvPrintConstsAsIndexedSymbols; }
340
6094
inline bool bitvectorPropagate__option_t::operator()() const
341
6094
{ return Options::current().bv.bitvectorPropagate; }
342
inline bool bitvectorQuickXplain__option_t::operator()() const
343
{ return Options::current().bv.bitvectorQuickXplain; }
344
6098
inline SatSolverMode bvSatSolver__option_t::operator()() const
345
6098
{ return Options::current().bv.bvSatSolver; }
346
inline bool skolemizeArguments__option_t::operator()() const
347
{ return Options::current().bv.skolemizeArguments; }
348
31012
inline BVSolver bvSolver__option_t::operator()() const
349
31012
{ return Options::current().bv.bvSolver; }
350
16251
inline bool bitvectorToBool__option_t::operator()() const
351
16251
{ return Options::current().bv.bitvectorToBool; }
352
// clang-format on
353
354
namespace bv
355
{
356
// clang-format off
357
void setDefaultBitvectorAig(Options& opts, bool value);
358
void setDefaultBitblastMode(Options& opts, BitblastMode value);
359
void setDefaultBitwiseEq(Options& opts, bool value);
360
void setDefaultBoolToBitvector(Options& opts, BoolToBVMode value);
361
void setDefaultBvAbstraction(Options& opts, bool value);
362
void setDefaultBitvectorAigSimplifications(Options& opts, std::string value);
363
void setDefaultBvAlgExtf(Options& opts, bool value);
364
void setDefaultBitvectorAlgebraicBudget(Options& opts, unsigned value);
365
void setDefaultBitvectorAlgebraicSolver(Options& opts, bool value);
366
void setDefaultBvAssertInput(Options& opts, bool value);
367
void setDefaultBvEagerExplanations(Options& opts, bool value);
368
void setDefaultBitvectorEqualitySolver(Options& opts, bool value);
369
void setDefaultBvExtractArithRewrite(Options& opts, bool value);
370
void setDefaultBvGaussElim(Options& opts, bool value);
371
void setDefaultBitvectorInequalitySolver(Options& opts, bool value);
372
void setDefaultBvIntroducePow2(Options& opts, bool value);
373
void setDefaultBvNumFunc(Options& opts, unsigned value);
374
void setDefaultBvPrintConstsAsIndexedSymbols(Options& opts, bool value);
375
void setDefaultBitvectorPropagate(Options& opts, bool value);
376
void setDefaultBitvectorQuickXplain(Options& opts, bool value);
377
void setDefaultBvSatSolver(Options& opts, SatSolverMode value);
378
void setDefaultSkolemizeArguments(Options& opts, bool value);
379
void setDefaultBvSolver(Options& opts, BVSolver value);
380
void setDefaultBitvectorToBool(Options& opts, bool value);
381
// clang-format on
382
}
383
384
}  // namespace options
385
}  // namespace cvc5
386
387
#endif /* CVC5__OPTIONS__BV_H */