mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 18:05:21 +00:00
move drat functionality into euf
This commit is contained in:
parent
1ffbe23ee3
commit
458f417f44
|
@ -255,31 +255,6 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
|
||||
void drat::bool_def(bool_var v, unsigned n) {
|
||||
if (m_out)
|
||||
(*m_out) << "b " << v << " " << n << " 0\n";
|
||||
}
|
||||
|
||||
void drat::def_begin(char id, unsigned n, std::string const& name) {
|
||||
if (m_out)
|
||||
(*m_out) << id << " " << n << " " << name;
|
||||
}
|
||||
|
||||
void drat::def_add_arg(unsigned arg) {
|
||||
if (m_out)
|
||||
(*m_out) << " " << arg;
|
||||
}
|
||||
|
||||
void drat::def_end() {
|
||||
if (m_out)
|
||||
(*m_out) << " 0\n";
|
||||
}
|
||||
|
||||
void drat::log_adhoc(std::function<void(std::ostream&)>& fn) {
|
||||
if (m_out)
|
||||
fn(*m_out);
|
||||
}
|
||||
|
||||
void drat::append(clause& c, status st) {
|
||||
TRACE("sat_drat", pp(tout, st) << " " << c << "\n";);
|
||||
for (literal lit : c) declare(lit);
|
||||
|
|
|
@ -153,13 +153,8 @@ namespace sat {
|
|||
// associate AST node id with Boolean variable v
|
||||
|
||||
// declare AST node n with 'name' and arguments arg
|
||||
void def_begin(char id, unsigned n, std::string const& name);
|
||||
void def_add_arg(unsigned arg);
|
||||
void def_end();
|
||||
void bool_def(bool_var v, unsigned n);
|
||||
std::ostream* out() { return m_out; }
|
||||
|
||||
// ad-hoc logging until a format is developed
|
||||
void log_adhoc(std::function<void(std::ostream&)>& fn);
|
||||
|
||||
bool is_cleaned(clause& c) const;
|
||||
void del(literal l);
|
||||
|
|
|
@ -30,19 +30,27 @@ namespace euf {
|
|||
}
|
||||
|
||||
void solver::def_add_arg(unsigned arg) {
|
||||
get_drat().def_add_arg(arg);
|
||||
auto* out = get_drat().out();
|
||||
if (out)
|
||||
(*out) << " " << arg;
|
||||
}
|
||||
|
||||
void solver::def_end() {
|
||||
get_drat().def_end();
|
||||
auto* out = get_drat().out();
|
||||
if (out)
|
||||
(*out) << " 0\n";
|
||||
}
|
||||
|
||||
void solver::def_begin(char id, unsigned n, std::string const& name) {
|
||||
get_drat().def_begin(id, n, name);
|
||||
auto* out = get_drat().out();
|
||||
if (out)
|
||||
(*out) << id << " " << n << " " << name;
|
||||
}
|
||||
|
||||
void solver::bool_def(bool_var v, unsigned n) {
|
||||
get_drat().bool_def(v, n);
|
||||
auto* out = get_drat().out();
|
||||
if (out)
|
||||
(*out) << "b " << v << " " << n << " 0\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1430,10 +1430,9 @@ namespace pb {
|
|||
IF_VERBOSE(0, verbose_stream() << *c << "\n");
|
||||
VERIFY(c->well_formed());
|
||||
if (m_solver && m_solver->get_config().m_drat) {
|
||||
std::function<void(std::ostream& out)> fn = [&](std::ostream& out) {
|
||||
out << "c ba constraint " << *c << " 0\n";
|
||||
};
|
||||
m_solver->get_drat().log_adhoc(fn);
|
||||
auto * out = s().get_drat().out();
|
||||
if (out)
|
||||
*out << "c ba constraint " << *c << " 0\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue