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 |
|
LAZY, EAGER, |
36 |
|
__MAX_VALUE = EAGER |
37 |
|
}; |
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 |
|
__MAX_VALUE = ALL |
45 |
|
}; |
46 |
|
std::ostream& operator<<(std::ostream& os, BoolToBVMode mode); |
47 |
|
BoolToBVMode stringToBoolToBVMode(const std::string& optarg); |
48 |
|
|
49 |
|
enum class SatSolverMode |
50 |
|
{ |
51 |
|
CADICAL, KISSAT, MINISAT, CRYPTOMINISAT, |
52 |
|
__MAX_VALUE = CRYPTOMINISAT |
53 |
|
}; |
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, BITBLAST, |
60 |
|
__MAX_VALUE = BITBLAST |
61 |
|
}; |
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 |
30741 |
struct HolderBV |
74 |
|
{ |
75 |
|
// clang-format off |
76 |
|
BitblastMode bitblastMode = BitblastMode::LAZY; |
77 |
|
bool bitblastModeWasSetByUser = false; |
78 |
|
bool bitwiseEq = true; |
79 |
|
bool bitwiseEqWasSetByUser = false; |
80 |
|
BoolToBVMode boolToBitvector = BoolToBVMode::OFF; |
81 |
|
bool boolToBitvectorWasSetByUser = false; |
82 |
|
bool bvAssertInput = false; |
83 |
|
bool bvAssertInputWasSetByUser = false; |
84 |
|
bool bvExtractArithRewrite = false; |
85 |
|
bool bvExtractArithRewriteWasSetByUser = false; |
86 |
|
bool bvGaussElim = false; |
87 |
|
bool bvGaussElimWasSetByUser = false; |
88 |
|
bool bvIntroducePow2 = false; |
89 |
|
bool bvIntroducePow2WasSetByUser = false; |
90 |
|
bool bvPrintConstsAsIndexedSymbols = false; |
91 |
|
bool bvPrintConstsAsIndexedSymbolsWasSetByUser = false; |
92 |
|
bool bitvectorPropagate = true; |
93 |
|
bool bitvectorPropagateWasSetByUser = false; |
94 |
|
bool rwExtendEq = false; |
95 |
|
bool rwExtendEqWasSetByUser = false; |
96 |
|
SatSolverMode bvSatSolver = SatSolverMode::CADICAL; |
97 |
|
bool bvSatSolverWasSetByUser = false; |
98 |
|
BVSolver bvSolver = BVSolver::BITBLAST; |
99 |
|
bool bvSolverWasSetByUser = false; |
100 |
|
bool bitvectorToBool = false; |
101 |
|
bool bitvectorToBoolWasSetByUser = false; |
102 |
|
// clang-format on |
103 |
|
}; |
104 |
|
|
105 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
106 |
|
|
107 |
|
// clang-format off |
108 |
|
inline BitblastMode bitblastMode() { return Options::current().bv.bitblastMode; } |
109 |
|
inline bool bitwiseEq() { return Options::current().bv.bitwiseEq; } |
110 |
|
inline BoolToBVMode boolToBitvector() { return Options::current().bv.boolToBitvector; } |
111 |
|
inline bool bvAssertInput() { return Options::current().bv.bvAssertInput; } |
112 |
129711 |
inline bool bvExtractArithRewrite() { return Options::current().bv.bvExtractArithRewrite; } |
113 |
|
inline bool bvGaussElim() { return Options::current().bv.bvGaussElim; } |
114 |
|
inline bool bvIntroducePow2() { return Options::current().bv.bvIntroducePow2; } |
115 |
29244 |
inline bool bvPrintConstsAsIndexedSymbols() { return Options::current().bv.bvPrintConstsAsIndexedSymbols; } |
116 |
|
inline bool bitvectorPropagate() { return Options::current().bv.bitvectorPropagate; } |
117 |
|
inline bool rwExtendEq() { return Options::current().bv.rwExtendEq; } |
118 |
|
inline SatSolverMode bvSatSolver() { return Options::current().bv.bvSatSolver; } |
119 |
|
inline BVSolver bvSolver() { return Options::current().bv.bvSolver; } |
120 |
|
inline bool bitvectorToBool() { return Options::current().bv.bitvectorToBool; } |
121 |
|
// clang-format on |
122 |
|
|
123 |
|
} // namespace cvc5::options |
124 |
|
|
125 |
|
#endif /* CVC5__OPTIONS__BV_H */ |