3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-25 20:46:01 +00:00

add logging of propagations to smt core

log theory propagations with annotation "smt".
It allows tracking theory propagations (when used in conflicts) in the clause logs similar to the new core.
This commit is contained in:
Nikolaj Bjorner 2022-11-23 08:01:15 +07:00
parent 5374142e3e
commit 6188c536ef
7 changed files with 95 additions and 17 deletions

View file

@ -26,8 +26,10 @@ Revision History:
--*/
#pragma once
#include "ast/ast_pp_util.h"
#include "smt/smt_theory.h"
#include "smt/smt_clause.h"
#include "smt/smt_justification.h"
#include "tactic/user_propagator_base.h"
namespace smt {
@ -55,13 +57,20 @@ namespace smt {
ast_manager& m;
expr_ref_vector m_lits;
vector<info> m_trail;
bool m_on_clause_active = false;
bool m_enabled = false;
user_propagator::on_clause_eh_t m_on_clause_eh;
void* m_on_clause_ctx = nullptr;
ast_pp_util m_pp;
scoped_ptr<std::ofstream> m_pp_out;
void update(status st, expr_ref_vector& v, proof* p);
void update(clause& c, status st, proof* p);
status kind2st(clause_kind k);
proof* justification2proof(status st, justification* j);
void log(status st, proof* p);
void declare(std::ostream& out, expr* e);
std::ostream& display_literals(std::ostream& out, expr_ref_vector const& v);
std::ostream& display_hint(std::ostream& out, proof* p);
public:
clause_proof(context& ctx);
void shrink(clause& c, unsigned new_size);
@ -69,13 +78,14 @@ namespace smt {
void add(literal lit1, literal lit2, clause_kind k, justification* j);
void add(clause& c);
void add(unsigned n, literal const* lits, clause_kind k, justification* j);
void propagate(literal lit, justification const& j, literal_vector const& ante);
void del(clause& c);
proof_ref get_proof(bool inconsistent);
bool on_clause_active() const { return m_on_clause_active; }
bool is_enabled() const { return m_enabled; }
void register_on_clause(void* ctx, user_propagator::on_clause_eh_t& on_clause) {
m_on_clause_eh = on_clause;
m_on_clause_ctx = ctx;
m_on_clause_active = !!m_on_clause_eh;
m_enabled |= !!m_on_clause_eh;
}
};