blob: 01434bd802aeed47a2ae557d8a0134f06aa1e1c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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 ®istry;
}
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;
}
}
|