GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/bv_options.h Lines: 14 17 82.4 %
Date: 2021-09-29 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
  ALL, OFF, ITE
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
  KISSAT, CADICAL, MINISAT, CRYPTOMINISAT
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, BITBLAST_INTERNAL, LAYERED
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
44637
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
  uint64_t bitvectorAlgebraicBudget = 1500;
89
  bool bitvectorAlgebraicBudgetWasSetByUser = false;
90
  bool bitvectorAlgebraicSolver = false;
91
  bool bitvectorAlgebraicSolverWasSetByUser = false;
92
  bool bvAssertInput = false;
93
  bool bvAssertInputWasSetByUser = false;
94
  bool bvEagerExplanations = false;
95
  bool bvEagerExplanationsWasSetByUser = false;
96
  bool bitvectorEqualitySolver = true;
97
  bool bitvectorEqualitySolverWasSetByUser = false;
98
  bool bvExtractArithRewrite = false;
99
  bool bvExtractArithRewriteWasSetByUser = false;
100
  bool bvGaussElim = false;
101
  bool bvGaussElimWasSetByUser = false;
102
  bool bitvectorInequalitySolver = true;
103
  bool bitvectorInequalitySolverWasSetByUser = false;
104
  bool bvIntroducePow2 = false;
105
  bool bvIntroducePow2WasSetByUser = false;
106
  uint64_t bvNumFunc = 1;
107
  bool bvNumFuncWasSetByUser = false;
108
  bool bvPrintConstsAsIndexedSymbols = false;
109
  bool bvPrintConstsAsIndexedSymbolsWasSetByUser = false;
110
  bool bitvectorPropagate = true;
111
  bool bitvectorPropagateWasSetByUser = false;
112
  bool bitvectorQuickXplain = false;
113
  bool bitvectorQuickXplainWasSetByUser = false;
114
  SatSolverMode bvSatSolver = SatSolverMode::MINISAT;
115
  bool bvSatSolverWasSetByUser = false;
116
  bool skolemizeArguments = false;
117
  bool skolemizeArgumentsWasSetByUser = false;
118
  BVSolver bvSolver = BVSolver::BITBLAST;
119
  bool bvSolverWasSetByUser = false;
120
  bool bitvectorToBool = false;
121
  bool bitvectorToBoolWasSetByUser = false;
122
// clang-format on
123
};
124
125
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
126
127
// clang-format off
128
8539
inline BitblastMode bitblastMode() { return Options::current().bv.bitblastMode; }
129
2
inline bool bitvectorAig() { return Options::current().bv.bitvectorAig; }
130
inline bool bitwiseEq() { return Options::current().bv.bitwiseEq; }
131
8539
inline BoolToBVMode boolToBitvector() { return Options::current().bv.boolToBitvector; }
132
8539
inline bool bvAbstraction() { return Options::current().bv.bvAbstraction; }
133
inline std::string bitvectorAigSimplifications() { return Options::current().bv.bitvectorAigSimplifications; }
134
inline uint64_t bitvectorAlgebraicBudget() { return Options::current().bv.bitvectorAlgebraicBudget; }
135
inline bool bitvectorAlgebraicSolver() { return Options::current().bv.bitvectorAlgebraicSolver; }
136
inline bool bvAssertInput() { return Options::current().bv.bvAssertInput; }
137
172
inline bool bvEagerExplanations() { return Options::current().bv.bvEagerExplanations; }
138
inline bool bitvectorEqualitySolver() { return Options::current().bv.bitvectorEqualitySolver; }
139
79429
inline bool bvExtractArithRewrite() { return Options::current().bv.bvExtractArithRewrite; }
140
8542
inline bool bvGaussElim() { return Options::current().bv.bvGaussElim; }
141
inline bool bitvectorInequalitySolver() { return Options::current().bv.bitvectorInequalitySolver; }
142
8539
inline bool bvIntroducePow2() { return Options::current().bv.bvIntroducePow2; }
143
inline uint64_t bvNumFunc() { return Options::current().bv.bvNumFunc; }
144
202
inline bool bvPrintConstsAsIndexedSymbols() { return Options::current().bv.bvPrintConstsAsIndexedSymbols; }
145
1
inline bool bitvectorPropagate() { return Options::current().bv.bitvectorPropagate; }
146
1
inline bool bitvectorQuickXplain() { return Options::current().bv.bitvectorQuickXplain; }
147
2
inline SatSolverMode bvSatSolver() { return Options::current().bv.bvSatSolver; }
148
inline bool skolemizeArguments() { return Options::current().bv.skolemizeArguments; }
149
inline BVSolver bvSolver() { return Options::current().bv.bvSolver; }
150
8539
inline bool bitvectorToBool() { return Options::current().bv.bitvectorToBool; }
151
// clang-format on
152
153
namespace bv
154
{
155
// clang-format off
156
static constexpr const char* bitblastMode__name = "bitblast";
157
static constexpr const char* bitvectorAig__name = "bitblast-aig";
158
static constexpr const char* bitwiseEq__name = "bitwise-eq";
159
static constexpr const char* boolToBitvector__name = "bool-to-bv";
160
static constexpr const char* bvAbstraction__name = "bv-abstraction";
161
static constexpr const char* bitvectorAigSimplifications__name = "bv-aig-simp";
162
static constexpr const char* bitvectorAlgebraicBudget__name = "bv-algebraic-budget";
163
static constexpr const char* bitvectorAlgebraicSolver__name = "bv-algebraic-solver";
164
static constexpr const char* bvAssertInput__name = "bv-assert-input";
165
static constexpr const char* bvEagerExplanations__name = "bv-eager-explanations";
166
static constexpr const char* bitvectorEqualitySolver__name = "bv-eq-solver";
167
static constexpr const char* bvExtractArithRewrite__name = "bv-extract-arith";
168
static constexpr const char* bvGaussElim__name = "bv-gauss-elim";
169
static constexpr const char* bitvectorInequalitySolver__name = "bv-inequality-solver";
170
static constexpr const char* bvIntroducePow2__name = "bv-intro-pow2";
171
static constexpr const char* bvNumFunc__name = "bv-num-func";
172
static constexpr const char* bvPrintConstsAsIndexedSymbols__name = "bv-print-consts-as-indexed-symbols";
173
static constexpr const char* bitvectorPropagate__name = "bv-propagate";
174
static constexpr const char* bitvectorQuickXplain__name = "bv-quick-xplain";
175
static constexpr const char* bvSatSolver__name = "bv-sat-solver";
176
static constexpr const char* skolemizeArguments__name = "bv-skolemize";
177
static constexpr const char* bvSolver__name = "bv-solver";
178
static constexpr const char* bitvectorToBool__name = "bv-to-bool";
179
180
void setDefaultBitblastMode(Options& opts, BitblastMode value);
181
void setDefaultBitvectorAig(Options& opts, bool value);
182
void setDefaultBitwiseEq(Options& opts, bool value);
183
void setDefaultBoolToBitvector(Options& opts, BoolToBVMode value);
184
void setDefaultBvAbstraction(Options& opts, bool value);
185
void setDefaultBitvectorAigSimplifications(Options& opts, std::string value);
186
void setDefaultBitvectorAlgebraicBudget(Options& opts, uint64_t value);
187
void setDefaultBitvectorAlgebraicSolver(Options& opts, bool value);
188
void setDefaultBvAssertInput(Options& opts, bool value);
189
void setDefaultBvEagerExplanations(Options& opts, bool value);
190
void setDefaultBitvectorEqualitySolver(Options& opts, bool value);
191
void setDefaultBvExtractArithRewrite(Options& opts, bool value);
192
void setDefaultBvGaussElim(Options& opts, bool value);
193
void setDefaultBitvectorInequalitySolver(Options& opts, bool value);
194
void setDefaultBvIntroducePow2(Options& opts, bool value);
195
void setDefaultBvNumFunc(Options& opts, uint64_t value);
196
void setDefaultBvPrintConstsAsIndexedSymbols(Options& opts, bool value);
197
void setDefaultBitvectorPropagate(Options& opts, bool value);
198
void setDefaultBitvectorQuickXplain(Options& opts, bool value);
199
void setDefaultBvSatSolver(Options& opts, SatSolverMode value);
200
void setDefaultSkolemizeArguments(Options& opts, bool value);
201
void setDefaultBvSolver(Options& opts, BVSolver value);
202
void setDefaultBitvectorToBool(Options& opts, bool value);
203
// clang-format on
204
}
205
206
}  // namespace cvc5::options
207
208
#endif /* CVC5__OPTIONS__BV_H */