20 inline DdNode *DD::getNode()
const
61 std::string result_tmp_file=
"sKizzo.out";
75 "sKizzo -log "+
qbf_tmp_file+options+
" > "+result_tmp_file).c_str());
81 std::ifstream in(result_tmp_file.c_str());
83 bool result_found=
false;
88 std::getline(in, line);
90 if(!line.empty() && line[line.size() - 1] ==
'\r')
91 line.resize(line.size()-1);
93 if(line==
"The instance evaluates to TRUE.")
99 else if(line==
"The instance evaluates to FALSE.")
114 remove(result_tmp_file.c_str());
124 return P_SATISFIABLE;
129 return P_UNSATISFIABLE;
145 std::string result_tmp_file=
"ozziKs.out";
146 std::string options=
"-dump qbm=bdd";
150 "ozziKs "+options+
" "+log_file+
" > "+result_tmp_file).c_str());
155 std::ifstream in(result_tmp_file.c_str());
156 std::string key=
" [OK, VALID,";
162 std::getline(in, line);
164 if(!line.empty() && line[line.size() - 1] ==
'\r')
165 line.resize(line.size()-1);
167 if(line.compare(0, key.size(), key)==0)
181 remove(result_tmp_file.c_str());
182 remove(log_file.c_str());
187 std::vector<int> e_list;
194 std::string key=
"# existentials[";
197 std::getline(in, line);
200 line ==
"# QBM file, 1.3",
201 "QBM file has to start with this exact string: ",
206 std::getline(in, line);
208 if(!line.empty() && line[line.size() - 1] ==
'\r')
209 line.resize(line.size()-1);
211 if(line.compare(0, key.size(), key)==0)
218 size_t ob=line.find(
'[');
219 std::string n_es=line.substr(ob+1, line.find(
']')-ob-1);
221 INVARIANT(n_e != 0,
"there has to be at least one existential variable");
224 std::string e_lists=line.substr(line.find(
':')+2);
226 for(
int i=0; i<n_e; i++)
228 size_t space=e_lists.find(
' ');
231 INVARIANT(cur != 0,
"variable numbering starts with 1");
237 e_lists=e_lists.substr(space+1);
240 INVARIANT(result,
"existential mapping from sKizzo missing");
246 "sed -e \"s/^#.*$/# no comment/\" -i "+
qbf_tmp_file+
".qbm").c_str());
256 char filename[bdd_file.size()+1];
257 snprintf(filename, bdd_file.size()+1, bdd_file.c_str());
262 Dddmp_cuddBddArrayLoad(
264 DDDMP_ROOT_MATCHLIST,
277 "valid QBM certificate should have twice as much roots as the "
278 "existential variables");
282 for(
unsigned i=0; i<e_list.size(); i++)
285 DdNode *posNode=bdds[2*i];
286 DdNode *negNode=bdds[2*i+1];
288 if(Cudd_DagSize(posNode)<=Cudd_DagSize(negNode))
295 for(
int i=0; i<nroots; i++)
300 remove(bdd_file.c_str());
size_t no_clauses() const override
virtual size_t no_variables() const override
mstreamt & status() const
bool get_certificate(void)
resultt prop_solve() override
std::string solver_text() const override
bool is_in_core(literalt l) const override
modeltypet m_get(literalt a) const override
~qbf_skizzo_coret() override
virtual void write_qdimacs_cnf(std::ostream &out)
#define INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
Same as invariant, with one or more diagnostics attached Diagnostics can be of any type that has a sp...
int snprintf(char *str, size_t size, const char *fmt,...)
int unsafe_string2int(const std::string &str, int base)
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.