mirror of
https://github.com/Z3Prover/z3
synced 2025-04-30 04:15:51 +00:00
preparing to split framework
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
c4711ac472
commit
ffaf88798d
8 changed files with 42 additions and 137 deletions
|
@ -81,25 +81,17 @@ void report_tactic_progress(char const * id, unsigned val) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class skip_tactic : public tactic {
|
||||
public:
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
result.reset();
|
||||
result.push_back(in.get());
|
||||
mc = 0;
|
||||
pc = 0;
|
||||
core = 0;
|
||||
}
|
||||
|
||||
virtual void cleanup() {}
|
||||
|
||||
virtual tactic * translate(ast_manager & m) { return this; }
|
||||
};
|
||||
void skip_tactic::operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
result.reset();
|
||||
result.push_back(in.get());
|
||||
mc = 0;
|
||||
pc = 0;
|
||||
core = 0;
|
||||
}
|
||||
|
||||
tactic * mk_skip_tactic() {
|
||||
return alloc(skip_tactic);
|
||||
|
@ -163,69 +155,6 @@ tactic * mk_trace_tactic(char const * tag) {
|
|||
return alloc(trace_tactic, tag);
|
||||
}
|
||||
|
||||
class echo_tactic : public skip_tactic {
|
||||
cmd_context & m_ctx;
|
||||
char const * m_msg;
|
||||
bool m_newline;
|
||||
public:
|
||||
echo_tactic(cmd_context & ctx, char const * msg, bool newline):m_ctx(ctx), m_msg(msg), m_newline(newline) {}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
#pragma omp critical (echo_tactic)
|
||||
{
|
||||
m_ctx.diagnostic_stream() << m_msg;
|
||||
if (m_newline)
|
||||
m_ctx.diagnostic_stream() << std::endl;
|
||||
}
|
||||
skip_tactic::operator()(in, result, mc, pc, core);
|
||||
}
|
||||
};
|
||||
|
||||
tactic * mk_echo_tactic(cmd_context & ctx, char const * msg, bool newline) {
|
||||
return alloc(echo_tactic, ctx, msg, newline);
|
||||
}
|
||||
|
||||
class probe_value_tactic : public skip_tactic {
|
||||
cmd_context & m_ctx;
|
||||
char const * m_msg;
|
||||
probe * m_p;
|
||||
bool m_newline;
|
||||
public:
|
||||
probe_value_tactic(cmd_context & ctx, char const * msg, probe * p, bool newline):m_ctx(ctx), m_msg(msg), m_p(p), m_newline(newline) {
|
||||
SASSERT(m_p);
|
||||
m_p->inc_ref();
|
||||
}
|
||||
|
||||
~probe_value_tactic() {
|
||||
m_p->dec_ref();
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
double val = (*m_p)(*(in.get())).get_value();
|
||||
#pragma omp critical (probe_value_tactic)
|
||||
{
|
||||
if (m_msg)
|
||||
m_ctx.diagnostic_stream() << m_msg << " ";
|
||||
m_ctx.diagnostic_stream() << val;
|
||||
if (m_newline)
|
||||
m_ctx.diagnostic_stream() << std::endl;
|
||||
}
|
||||
skip_tactic::operator()(in, result, mc, pc, core);
|
||||
}
|
||||
};
|
||||
|
||||
tactic * mk_probe_value_tactic(cmd_context & ctx, char const * msg, probe * p, bool newline) {
|
||||
return alloc(probe_value_tactic, ctx, msg, p, newline);
|
||||
}
|
||||
|
||||
class fail_if_undecided_tactic : public skip_tactic {
|
||||
public:
|
||||
fail_if_undecided_tactic() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue