mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
simplify some verbose trace-stream
This commit is contained in:
parent
bc2e6ce037
commit
5fac396c2f
|
@ -195,6 +195,18 @@ namespace smt {
|
||||||
log_axiom_instantiation(mk_or(fmls));
|
log_axiom_instantiation(mk_or(fmls));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void theory::log_axiom_instantiation(literal_buffer const& ls) {
|
||||||
|
ast_manager& m = get_manager();
|
||||||
|
expr_ref_vector fmls(m);
|
||||||
|
expr_ref tmp(m);
|
||||||
|
for (literal l : ls) {
|
||||||
|
ctx.literal2expr(l, tmp);
|
||||||
|
fmls.push_back(tmp);
|
||||||
|
}
|
||||||
|
log_axiom_instantiation(mk_or(fmls));
|
||||||
|
}
|
||||||
|
|
||||||
void theory::log_axiom_instantiation(app * r, unsigned axiom_id, unsigned num_bindings, app * const * bindings, unsigned pattern_id, const vector<std::tuple<enode *, enode *>> & used_enodes) {
|
void theory::log_axiom_instantiation(app * r, unsigned axiom_id, unsigned num_bindings, app * const * bindings, unsigned pattern_id, const vector<std::tuple<enode *, enode *>> & used_enodes) {
|
||||||
ast_manager & m = get_manager();
|
ast_manager & m = get_manager();
|
||||||
app_ref _r(r, m);
|
app_ref _r(r, m);
|
||||||
|
|
|
@ -124,6 +124,12 @@ namespace smt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoped_trace_stream(theory& th, literal_buffer const& lits) : m(th.get_manager()) {
|
||||||
|
if (m.has_trace_stream()) {
|
||||||
|
th.log_axiom_instantiation(lits);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
scoped_trace_stream(theory& th, literal lit): m(th.get_manager()) {
|
scoped_trace_stream(theory& th, literal lit): m(th.get_manager()) {
|
||||||
if (m.has_trace_stream()) {
|
if (m.has_trace_stream()) {
|
||||||
literal_vector lits;
|
literal_vector lits;
|
||||||
|
@ -464,6 +470,8 @@ namespace smt {
|
||||||
|
|
||||||
void log_axiom_instantiation(literal_vector const& ls);
|
void log_axiom_instantiation(literal_vector const& ls);
|
||||||
|
|
||||||
|
void log_axiom_instantiation(literal_buffer const& ls);
|
||||||
|
|
||||||
void log_axiom_instantiation(app * r, unsigned num_blamed_enodes, enode ** blamed_enodes) {
|
void log_axiom_instantiation(app * r, unsigned num_blamed_enodes, enode ** blamed_enodes) {
|
||||||
vector<std::tuple<enode *, enode *>> used_enodes;
|
vector<std::tuple<enode *, enode *>> used_enodes;
|
||||||
for (unsigned i = 0; i < num_blamed_enodes; ++i) {
|
for (unsigned i = 0; i < num_blamed_enodes; ++i) {
|
||||||
|
|
|
@ -1321,13 +1321,8 @@ public:
|
||||||
exprs.push_back(c.bool_var2expr(mod_j.var()));
|
exprs.push_back(c.bool_var2expr(mod_j.var()));
|
||||||
ctx().mark_as_relevant(mod_j);
|
ctx().mark_as_relevant(mod_j);
|
||||||
}
|
}
|
||||||
if (m.has_trace_stream()) {
|
scoped_trace_stream _st(th, lits);
|
||||||
app_ref body(m);
|
|
||||||
body = m.mk_or(exprs.size(), exprs.data());
|
|
||||||
th.log_axiom_instantiation(body);
|
|
||||||
}
|
|
||||||
ctx().mk_th_axiom(get_id(), lits.size(), lits.begin());
|
ctx().mk_th_axiom(get_id(), lits.size(), lits.begin());
|
||||||
if (m.has_trace_stream()) m.trace_stream() << "[end-of-instance]\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1750,20 +1745,14 @@ public:
|
||||||
literal p_ge_r1 = mk_literal(a.mk_ge(p, a.mk_numeral(lo, true)));
|
literal p_ge_r1 = mk_literal(a.mk_ge(p, a.mk_numeral(lo, true)));
|
||||||
literal n_le_div = mk_literal(a.mk_le(n, a.mk_numeral(div_r, true)));
|
literal n_le_div = mk_literal(a.mk_le(n, a.mk_numeral(div_r, true)));
|
||||||
literal n_ge_div = mk_literal(a.mk_ge(n, a.mk_numeral(div_r, true)));
|
literal n_ge_div = mk_literal(a.mk_ge(n, a.mk_numeral(div_r, true)));
|
||||||
if (m.has_trace_stream()) {
|
{
|
||||||
app_ref body(m);
|
scoped_trace_stream _sts(th, ~p_le_r1, n_le_div);
|
||||||
body = m.mk_implies(ctx().bool_var2expr(p_le_r1.var()), ctx().bool_var2expr(n_le_div.var()));
|
mk_axiom(~p_le_r1, n_le_div);
|
||||||
th.log_axiom_instantiation(body);
|
|
||||||
}
|
}
|
||||||
mk_axiom(~p_le_r1, n_le_div);
|
{
|
||||||
if (m.has_trace_stream()) m.trace_stream() << "[end-of-instance]\n";
|
scoped_trace_stream _sts(th, ~p_ge_r1, n_ge_div);
|
||||||
if (m.has_trace_stream()) {
|
mk_axiom(~p_ge_r1, n_ge_div);
|
||||||
app_ref body(m);
|
|
||||||
body = m.mk_implies(ctx().bool_var2expr(p_ge_r1.var()), ctx().bool_var2expr(n_ge_div.var()));
|
|
||||||
th.log_axiom_instantiation(body);
|
|
||||||
}
|
}
|
||||||
mk_axiom(~p_ge_r1, n_ge_div);
|
|
||||||
if (m.has_trace_stream()) m.trace_stream() << "[end-of-instance]\n";
|
|
||||||
|
|
||||||
all_divs_valid = false;
|
all_divs_valid = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue