mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +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";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ namespace euf {
|
|||
m_lookahead(nullptr),
|
||||
m_to_m(&m),
|
||||
m_to_si(&si),
|
||||
m_values(m)
|
||||
m_values(m),
|
||||
m_clause_visitor(m)
|
||||
{
|
||||
updt_params(p);
|
||||
m_relevancy.set_enabled(get_config().m_relevancy_lvl > 2);
|
||||
|
|
|
@ -182,6 +182,7 @@ namespace euf {
|
|||
obj_hashtable<ast> m_drat_asts;
|
||||
bool m_drat_initialized{ false };
|
||||
void init_drat();
|
||||
ast_pp_util m_clause_visitor;
|
||||
void log_clause(unsigned n, literal const* lits, sat::status st);
|
||||
|
||||
// relevancy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue