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