53#pragma GCC visibility push(default)
86 lit = Internal::mkLit(signedVar - 1,
true);
88 lit = Internal::mkLit(-(signedVar + 1),
false);
101 for (
int i = 0; i < m_ps.
size(); i++) {
102 if (Internal::var(m_ps[i]) == x) {
103 m_ps[i] = Internal::mkLit(x, sign);
112 for (
int i = 0; i < m_ps.
size(); i++) {
113 if (Internal::var(m_ps[i]) == x) {
114 return Internal::sign(m_ps[i]);
117 std::cout <<
"Variable not in Clause" << std::endl;
126 for (
int i = 0; i < m_ps.
size(); i++) {
127 if (Internal::var(m_ps[i]) != x) {
135 if (sign(lit) == 0) {
143 for (
int i = 0; i < m_ps.
size() - 1; i++) {
144 std::cout << convertLitSign(m_ps[i]) << Internal::var(m_ps[i]) + 1 <<
" || ";
146 std::cout << convertLitSign(m_ps[m_ps.
size() - 1])
147 << Internal::var(m_ps[m_ps.
size() - 1]) + 1 << std::endl;
175 return m_vModel[var - 1] != 0;
182 m_vModel.reserve(S.
model.size());
183 for (
int i = 0; i < S.
model.size(); i++) {
184 m_vModel.push_back(Internal::toInt(S.
model[i]));
189 for (
int i = 0; i < (int)m_vModel.size(); i++) {
190 std::cout <<
"Var " << i <<
" = " << m_vModel[i] <<
" ";
192 std::cout << std::endl;
238 for (
unsigned int i = 0; i < Count; i++) {
256 template<
class Iteratable>
258 auto cl = newClause();
259 for (
auto literal : literals) {
307 removeClause(clausePos);
308 m_Clauses[clausePos]->add(signedVar);
309 Solver::addClause(m_Clauses[clausePos]->m_ps);
336#pragma GCC visibility pop
Basic declarations, included by all source files.
Represents a simple class for clause storage.
static char convertLitSign(Internal::Lit lit)
converts the sign of a lit into char
Internal::vec< Internal::Lit > m_ps
void addMultiple(int Amount,...)
add multiple literals to the clause
void setSign(Internal::Var x, bool sign)
sets the sign of a variable if its present within the clause
void removeLit(Internal::Var x)
bool getSign(Internal::Var x)
returns the sign of a variable if its present within the clause, if the variable is not representet f...
void add(Internal::Var signedVar)
adds a literal to the clause
Clause(const Clause &src)
void clear(bool dealloc=false)
void copyTo(vec< T > ©) const
Represents a simple class for model storage.
bool getValue(int var) const
returns the value of the assignemt of a variable in the model
Internal::Solver::SolverStatus solverStatus
void setModel(Internal::Solver &S)
sets the model to the model of minsat
std::string intToString(const int i)
std::vector< int > m_vModel
internal storage of a model by minisat
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.