Skip to content

Commit

Permalink
fix #6176
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Jul 21, 2022
1 parent 1b83a45 commit 3261472
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/cmd_context/extra_cmds/dbg_cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ class mbp_cmd : public cmd {
};

class get_interpolant_cmd : public cmd {
expr* m_a;
expr* m_b;
scoped_ptr<expr_ref> m_a;
scoped_ptr<expr_ref> m_b;
public:
get_interpolant_cmd():cmd("get-interpolant") {}
char const * get_usage() const override { return "<expr> <expr>"; }
Expand All @@ -388,17 +388,24 @@ class get_interpolant_cmd : public cmd {
return CPK_EXPR;
}
void set_next_arg(cmd_context& ctx, expr * arg) override {
if (m_a == nullptr)
m_a = arg;
ast_manager& m = ctx.m();
if (!m.is_bool(arg))
throw default_exception("argument to interpolation is not Boolean");
if (!m_a)
m_a = alloc(expr_ref, arg, m);
else
m_b = arg;
m_b = alloc(expr_ref, arg, m);
}
void prepare(cmd_context & ctx) override { m_a = nullptr; m_b = nullptr; }
void execute(cmd_context & ctx) override {
ast_manager& m = ctx.m();
qe::interpolator mbi(m);
if (!m_a || !m_b)
throw default_exception("interpolation requires two arguments");
if (!m.is_bool(*m_a) || !m.is_bool(*m_b))
throw default_exception("interpolation requires two Boolean arguments");
expr_ref itp(m);
mbi.pogo(ctx.get_solver_factory(), m_a, m_b, itp);
mbi.pogo(ctx.get_solver_factory(), *m_a, *m_b, itp);
ctx.regular_stream() << itp << "\n";
}
};
Expand Down
1 change: 1 addition & 0 deletions src/qe/qe_mbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ namespace qe {
th_rewriter rewrite(m);
rewrite(a);
rewrite(b);
TRACE("interpolator", tout << a << " " << b << "\n");
solver_ref sA = sf(m, p, false /* no proofs */, true, true, symbol::null);
solver_ref sB = sf(m, p, false /* no proofs */, true, true, symbol::null);
solver_ref sNotA = sf(m, p, false /* no proofs */, true, true, symbol::null);
Expand Down
1 change: 1 addition & 0 deletions src/solver/assertions/asserted_formulas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void asserted_formulas::assert_expr(expr * e, proof * _in_pr) {
force_push();
proof_ref in_pr(_in_pr, m), pr(_in_pr, m);
expr_ref r(e, m);
SASSERT(m.is_bool(e));

if (inconsistent())
return;
Expand Down

0 comments on commit 3261472

Please sign in to comment.