mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
succinct logging
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
74c61f49b4
commit
fb8532bf55
5 changed files with 81 additions and 18 deletions
|
@ -195,22 +195,31 @@ namespace euf {
|
|||
}
|
||||
|
||||
void solver::log_clause(unsigned n, literal const* lits, sat::status st) {
|
||||
if (get_config().m_lemmas2console) {
|
||||
std::function<symbol(int)> ppth = [&](int th) {
|
||||
return m.get_family_name(th);
|
||||
};
|
||||
if (st.is_redundant() || st.is_asserted()) {
|
||||
expr_ref_vector clause(m);
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
expr_ref e = literal2expr(lits[i]);
|
||||
if (!e)
|
||||
return;
|
||||
clause.push_back(e);
|
||||
}
|
||||
expr_ref cl = mk_or(clause);
|
||||
std::cout << sat::status_pp(st, ppth) << " " << cl << "\n";
|
||||
}
|
||||
if (!get_config().m_lemmas2console)
|
||||
return;
|
||||
if (!st.is_redundant() && !st.is_asserted())
|
||||
return;
|
||||
std::function<symbol(int)> ppth = [&](int th) {
|
||||
return m.get_family_name(th);
|
||||
};
|
||||
|
||||
expr_ref_vector clause(m);
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
expr_ref e = literal2expr(lits[i]);
|
||||
if (!e)
|
||||
return;
|
||||
clause.push_back(e);
|
||||
m_clause_visitor.collect(e);
|
||||
}
|
||||
m_clause_visitor.display_skolem_decls(std::cout);
|
||||
for (expr* e : clause)
|
||||
m_clause_visitor.define_expr(std::cout, e);
|
||||
if (!st.is_sat())
|
||||
std::cout << "; " << sat::status_pp(st, ppth) << "\n";
|
||||
std::cout << "(assert (or";
|
||||
for (expr* e : clause)
|
||||
std::cout << " $" << e->get_id();
|
||||
std::cout << "))\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue