summaryrefslogtreecommitdiff
path: root/src/prop/sat_solver_registry.cpp
diff options
context:
space:
mode:
authorDejan Jovanović <dejan.jovanovic@gmail.com>2012-03-26 19:42:25 +0000
committerDejan Jovanović <dejan.jovanovic@gmail.com>2012-03-26 19:42:25 +0000
commit6fdc62f34bb1d04b84dfd628ec16335b8f02385e (patch)
tree44755057990ad99f6f47904a0201d33c9be18c9c /src/prop/sat_solver_registry.cpp
parent1ed3b1803bd0a25c56a62d290cd5dcb64c5085ce (diff)
Global registry of SAT solvers, where they are registered at compile time. The available SAT solvers can be seen with the --show-sat-solvers option.
Diffstat (limited to 'src/prop/sat_solver_registry.cpp')
-rw-r--r--src/prop/sat_solver_registry.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/prop/sat_solver_registry.cpp b/src/prop/sat_solver_registry.cpp
new file mode 100644
index 000000000..01434bd80
--- /dev/null
+++ b/src/prop/sat_solver_registry.cpp
@@ -0,0 +1,61 @@
+/********************* */
+/*! \file sat_solver_registry.h
+ ** \verbatim
+ ** Original author: taking
+ ** Major contributors: mdeters, dejan
+ ** Minor contributors (to current version): barrett, cconway
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
+ ** Courant Institute of Mathematical Sciences
+ ** New York University
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief This class transforms a sequence of formulas into clauses.
+ **
+ ** This class takes a sequence of formulas.
+ ** It outputs a stream of clauses that is propositionally
+ ** equi-satisfiable with the conjunction of the formulas.
+ ** This stream is maintained in an online fashion.
+ **
+ ** Compile time registration of SAT solvers with the SAT solver factory
+ **/
+
+#include "prop/sat_solver_registry.h"
+#include "sstream"
+
+using namespace std;
+using namespace CVC4;
+using namespace prop;
+
+SatSolverConstructorInterface* SatSolverRegistry::getConstructor(string id) {
+ SatSolverRegistry* registry = getInstance();
+ registry_type::const_iterator find = registry->d_solvers.find(id);
+ if (find == registry->d_solvers.end()) {
+ return NULL;
+ } else {
+ return find->second;
+ }
+}
+
+void SatSolverRegistry::getSolverIds(std::vector<std::string>& solvers) {
+ SatSolverRegistry* registry = getInstance();
+ registry_type::const_iterator it = registry->d_solvers.begin();
+ registry_type::const_iterator it_end = registry->d_solvers.end();
+ for (; it != it_end; ++ it) {
+ solvers.push_back(it->first);
+ }
+}
+
+SatSolverRegistry* SatSolverRegistry::getInstance() {
+ static SatSolverRegistry registry;
+ return &registry;
+}
+
+SatSolverRegistry::~SatSolverRegistry() {
+ registry_type::const_iterator it = d_solvers.begin();
+ registry_type::const_iterator it_end = d_solvers.begin();
+ for (; it != it_end; ++ it) {
+ delete it->second;
+ }
+}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback