GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/bv_options.h Lines: 14 17 82.4 %
Date: 2021-09-15 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::options {
31
32
// clang-format off
33
enum class BitblastMode
34
{
35
  EAGER, LAZY
36
};
37
static constexpr size_t BitblastMode__numValues = 2;
38
std::ostream& operator<<(std::ostream& os, BitblastMode mode);
39
BitblastMode stringToBitblastMode(const std::string& optarg);
40
41
enum class BoolToBVMode
42
{
43
  OFF, ITE, ALL
44
};
45
static constexpr size_t BoolToBVMode__numValues = 3;
46
std::ostream& operator<<(std::ostream& os, BoolToBVMode mode);
47
BoolToBVMode stringToBoolToBVMode(const std::string& optarg);
48
49
enum class SatSolverMode
50
{
51
  MINISAT, CRYPTOMINISAT, CADICAL, KISSAT
52
};
53
static constexpr size_t SatSolverMode__numValues = 4;
54
std::ostream& operator<<(std::ostream& os, SatSolverMode mode);
55
SatSolverMode stringToSatSolverMode(const std::string& optarg);
56
57
enum class BVSolver
58
{
59
  BITBLAST_INTERNAL, LAYERED, BITBLAST
60
};
61
static constexpr size_t BVSolver__numValues = 3;
62
std::ostream& operator<<(std::ostream& os, BVSolver mode);
63
BVSolver stringToBVSolver(const std::string& optarg);
64
65
// clang-format on
66
67
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
68
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
69
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
70
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
71
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
72
73
62772
struct HolderBV
74
{
75
// clang-format off
76
BitblastMode bitblastMode = BitblastMode::LAZY;
77
  bool bitblastModeWasSetByUser = false;
78
  bool bitvectorAig = false;
79
  bool bitvectorAigWasSetByUser = false;
80
  bool bitwiseEq = true;
81
  bool bitwiseEqWasSetByUser = false;
82
  BoolToBVMode boolToBitvector = BoolToBVMode::OFF;
83
  bool boolToBitvectorWasSetByUser = false;
84
  bool bvAbstraction = false;
85
  bool bvAbstractionWasSetByUser = false;
86
  std::string bitvectorAigSimplifications = "balance;drw";
87
  bool bitvectorAigSimplificationsWasSetByUser = false;
88
  bool bvAlgExtf = true;
89
  bool bvAlgExtfWasSetByUser = false;
90
  uint64_t bitvectorAlgebraicBudget = 1500;
91
  bool bitvectorAlgebraicBudgetWasSetByUser = false;
92
  bool bitvectorAlgebraicSolver = false;
93
  bool bitvectorAlgebraicSolverWasSetByUser = false;
94
  bool bvAssertInput = false;
95
  bool bvAssertInputWasSetByUser = false;
96
  bool bvEagerExplanations = false;
97
  bool bvEagerExplanationsWasSetByUser = false;
98
  bool bitvectorEqualitySolver = true;
99
  bool bitvectorEqualitySolverWasSetByUser = false;
100
  bool bvExtractArithRewrite = false;
101
  bool bvExtractArithRewriteWasSetByUser = false;
102
  bool bvGaussElim = false;
103
  bool bvGaussElimWasSetByUser = false;
104
  bool bitvectorInequalitySolver = true;
105
  bool bitvectorInequalitySolverWasSetByUser = false;
106
  bool bvIntroducePow2 = false;
107
  bool bvIntroducePow2WasSetByUser = false;
108
  uint64_t bvNumFunc = 1;
109
  bool bvNumFuncWasSetByUser = false;
110
  bool bvPrintConstsAsIndexedSymbols = false;
111
  bool bvPrintConstsAsIndexedSymbolsWasSetByUser = false;
112
  bool bitvectorPropagate = true;
113
  bool bitvectorPropagateWasSetByUser = false;
114
  bool bitvectorQuickXplain = false;
115
  bool bitvectorQuickXplainWasSetByUser = false;
116
  SatSolverMode bvSatSolver = SatSolverMode::MINISAT;
117
  bool bvSatSolverWasSetByUser = false;
118
  bool skolemizeArguments = false;
119
  bool skolemizeArgumentsWasSetByUser = false;
120
  BVSolver bvSolver = BVSolver::BITBLAST;
121
  bool bvSolverWasSetByUser = false;
122
  bool bitvectorToBool = false;
123
  bool bitvectorToBoolWasSetByUser = false;
124
// clang-format on
125
};
126
127
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
128
129
// clang-format off
130
13800
inline BitblastMode bitblastMode() { return Options::current().bv.bitblastMode; }
131
2
inline bool bitvectorAig() { return Options::current().bv.bitvectorAig; }
132
inline bool bitwiseEq() { return Options::current().bv.bitwiseEq; }
133
13799
inline BoolToBVMode boolToBitvector() { return Options::current().bv.boolToBitvector; }
134
13799
inline bool bvAbstraction() { return Options::current().bv.bvAbstraction; }
135
inline std::string bitvectorAigSimplifications() { return Options::current().bv.bitvectorAigSimplifications; }
136
inline bool bvAlgExtf() { return Options::current().bv.bvAlgExtf; }
137
inline uint64_t bitvectorAlgebraicBudget() { return Options::current().bv.bitvectorAlgebraicBudget; }
138
inline bool bitvectorAlgebraicSolver() { return Options::current().bv.bitvectorAlgebraicSolver; }
139
inline bool bvAssertInput() { return Options::current().bv.bvAssertInput; }
140
172
inline bool bvEagerExplanations() { return Options::current().bv.bvEagerExplanations; }
141
inline bool bitvectorEqualitySolver() { return Options::current().bv.bitvectorEqualitySolver; }
142
103275
inline bool bvExtractArithRewrite() { return Options::current().bv.bvExtractArithRewrite; }
143
13802
inline bool bvGaussElim() { return Options::current().bv.bvGaussElim; }
144
inline bool bitvectorInequalitySolver() { return Options::current().bv.bitvectorInequalitySolver; }
145
13799
inline bool bvIntroducePow2() { return Options::current().bv.bvIntroducePow2; }
146
inline uint64_t bvNumFunc() { return Options::current().bv.bvNumFunc; }
147
202
inline bool bvPrintConstsAsIndexedSymbols() { return Options::current().bv.bvPrintConstsAsIndexedSymbols; }
148
2
inline bool bitvectorPropagate() { return Options::current().bv.bitvectorPropagate; }
149
2
inline bool bitvectorQuickXplain() { return Options::current().bv.bitvectorQuickXplain; }
150
2
inline SatSolverMode bvSatSolver() { return Options::current().bv.bvSatSolver; }
151
inline bool skolemizeArguments() { return Options::current().bv.skolemizeArguments; }
152
inline BVSolver bvSolver() { return Options::current().bv.bvSolver; }
153
13799
inline bool bitvectorToBool() { return Options::current().bv.bitvectorToBool; }
154
// clang-format on
155
156
namespace bv
157
{
158
// clang-format off
159
static constexpr const char* bitblastMode__name = "bitblast";
160
static constexpr const char* bitvectorAig__name = "bitblast-aig";
161
static constexpr const char* bitwiseEq__name = "bitwise-eq";
162
static constexpr const char* boolToBitvector__name = "bool-to-bv";
163
static constexpr const char* bvAbstraction__name = "bv-abstraction";
164
static constexpr const char* bitvectorAigSimplifications__name = "bv-aig-simp";
165
static constexpr const char* bvAlgExtf__name = "bv-alg-extf";
166
static constexpr const char* bitvectorAlgebraicBudget__name = "bv-algebraic-budget";
167
static constexpr const char* bitvectorAlgebraicSolver__name = "bv-algebraic-solver";
168
static constexpr const char* bvAssertInput__name = "bv-assert-input";
169
static constexpr const char* bvEagerExplanations__name = "bv-eager-explanations";
170
static constexpr const char* bitvectorEqualitySolver__name = "bv-eq-solver";
171
static constexpr const char* bvExtractArithRewrite__name = "bv-extract-arith";
172
static constexpr const char* bvGaussElim__name = "bv-gauss-elim";
173
static constexpr const char* bitvectorInequalitySolver__name = "bv-inequality-solver";
174
static constexpr const char* bvIntroducePow2__name = "bv-intro-pow2";
175
static constexpr const char* bvNumFunc__name = "bv-num-func";
176
static constexpr const char* bvPrintConstsAsIndexedSymbols__name = "bv-print-consts-as-indexed-symbols";
177
static constexpr const char* bitvectorPropagate__name = "bv-propagate";
178
static constexpr const char* bitvectorQuickXplain__name = "bv-quick-xplain";
179
static constexpr const char* bvSatSolver__name = "bv-sat-solver";
180
static constexpr const char* skolemizeArguments__name = "bv-skolemize";
181
static constexpr const char* bvSolver__name = "bv-solver";
182
static constexpr const char* bitvectorToBool__name = "bv-to-bool";
183
184
void setDefaultBitblastMode(Options& opts, BitblastMode value);
185
void setDefaultBitvectorAig(Options& opts, bool value);
186
void setDefaultBitwiseEq(Options& opts, bool value);
187
void setDefaultBoolToBitvector(Options& opts, BoolToBVMode value);
188
void setDefaultBvAbstraction(Options& opts, bool value);
189
void setDefaultBitvectorAigSimplifications(Options& opts, std::string value);
190
void setDefaultBvAlgExtf(Options& opts, bool value);
191
void setDefaultBitvectorAlgebraicBudget(Options& opts, uint64_t value);
192
void setDefaultBitvectorAlgebraicSolver(Options& opts, bool value);
193
void setDefaultBvAssertInput(Options& opts, bool value);
194
void setDefaultBvEagerExplanations(Options& opts, bool value);
195
void setDefaultBitvectorEqualitySolver(Options& opts, bool value);
196
void setDefaultBvExtractArithRewrite(Options& opts, bool value);
197
void setDefaultBvGaussElim(Options& opts, bool value);
198
void setDefaultBitvectorInequalitySolver(Options& opts, bool value);
199
void setDefaultBvIntroducePow2(Options& opts, bool value);
200
void setDefaultBvNumFunc(Options& opts, uint64_t value);
201
void setDefaultBvPrintConstsAsIndexedSymbols(Options& opts, bool value);
202
void setDefaultBitvectorPropagate(Options& opts, bool value);
203
void setDefaultBitvectorQuickXplain(Options& opts, bool value);
204
void setDefaultBvSatSolver(Options& opts, SatSolverMode value);
205
void setDefaultSkolemizeArguments(Options& opts, bool value);
206
void setDefaultBvSolver(Options& opts, BVSolver value);
207
void setDefaultBitvectorToBool(Options& opts, bool value);
208
// clang-format on
209
}
210
211
}  // namespace cvc5::options
212
213
#endif /* CVC5__OPTIONS__BV_H */