summaryrefslogtreecommitdiff
path: root/src/options/options_handler.cpp
diff options
context:
space:
mode:
authorLiana Hadarean <lianahady@gmail.com>2016-05-24 22:30:41 -0700
committerLiana Hadarean <lianahady@gmail.com>2016-05-24 22:30:48 -0700
commit2591fc4f57030b31c2c49d5c2dae9e96d3ce3afa (patch)
tree0296cb4f8194aef27813ef5251e88f475c9a6ffb /src/options/options_handler.cpp
parentbeaf8b212dfadb47328942c23a7649ab44a014cb (diff)
Merged cryptominisat from experimental branch.
Diffstat (limited to 'src/options/options_handler.cpp')
-rw-r--r--src/options/options_handler.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/options/options_handler.cpp b/src/options/options_handler.cpp
index 867feef6e..6a5f6cd39 100644
--- a/src/options/options_handler.cpp
+++ b/src/options/options_handler.cpp
@@ -821,6 +821,72 @@ void OptionsHandler::abcEnabledBuild(std::string option, std::string value) thro
#endif /* CVC4_USE_ABC */
}
+void OptionsHandler::satSolverEnabledBuild(std::string option,
+ bool value) throw(OptionException) {
+#ifndef CVC4_USE_CRYPTOMINISAT
+ if(value) {
+ std::stringstream ss;
+ ss << "option `" << option << "' requires an cryptominisat-enabled build of CVC4; this binary was not built with cryptominisat support";
+ throw OptionException(ss.str());
+ }
+#endif /* CVC4_USE_CRYPTOMINISAT */
+}
+
+void OptionsHandler::satSolverEnabledBuild(std::string option,
+ std::string value) throw(OptionException) {
+#ifndef CVC4_USE_CRYPTOMINISAT
+ if(!value.empty()) {
+ std::stringstream ss;
+ ss << "option `" << option << "' requires an cryptominisat-enabled build of CVC4; this binary was not built with cryptominisat support";
+ throw OptionException(ss.str());
+ }
+#endif /* CVC4_USE_CRYPTOMINISAT */
+}
+
+const std::string OptionsHandler::s_bvSatSolverHelp = "\
+Sat solvers currently supported by the --bv-sat-solver option:\n\
+\n\
+minisat (default)\n\
+\n\
+cryptominisat\n\
+";
+
+theory::bv::SatSolverMode OptionsHandler::stringToSatSolver(std::string option,
+ std::string optarg) throw(OptionException) {
+ if(optarg == "minisat") {
+ return theory::bv::SAT_SOLVER_MINISAT;
+ } else if(optarg == "cryptominisat") {
+
+ if (options::incrementalSolving() &&
+ options::incrementalSolving.wasSetByUser()) {
+ throw OptionException(std::string("Cryptominsat does not support incremental mode. \n\
+ Try --bv-sat-solver=minisat"));
+ }
+
+ if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY &&
+ options::bitblastMode.wasSetByUser()) {
+ throw OptionException(std::string("Cryptominsat does not support lazy bit-blsating. \n\
+ Try --bv-sat-solver=minisat"));
+ }
+ if (!options::bitvectorToBool.wasSetByUser()) {
+ options::bitvectorToBool.set(true);
+ }
+
+ // if (!options::bvAbstraction.wasSetByUser() &&
+ // !options::skolemizeArguments.wasSetByUser()) {
+ // options::bvAbstraction.set(true);
+ // options::skolemizeArguments.set(true);
+ // }
+ return theory::bv::SAT_SOLVER_CRYPTOMINISAT;
+ } else if(optarg == "help") {
+ puts(s_bvSatSolverHelp.c_str());
+ exit(1);
+ } else {
+ throw OptionException(std::string("unknown option for --bv-sat-solver: `") +
+ optarg + "'. Try --bv-sat-solver=help.");
+ }
+}
+
const std::string OptionsHandler::s_bitblastingModeHelp = "\
Bit-blasting modes currently supported by the --bitblast option:\n\
\n\
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback