Skip to content

Commit

Permalink
use interface for creating unary equalities
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 21, 2022
1 parent 17fc438 commit 4092302
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/smt/theory_arith_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,16 @@ namespace smt {
m_arith_eq_adapter.mk_axioms(ensure_enode(qr), ensure_enode(dividend));

// non-linear divisors/mod have to be flattened for the non-linear solver to understand the terms.
// to ensure this use the rewriter.
// to ensure this use the rewriter. This is a hack required to fix a latent bug that affects the
// legacy arithmetic solver broadly. It is not something that the newer arithmetic solver suffers from.
qr1 = qr;
s(qr1);
if (qr != qr1) {
mk_axiom(m.mk_eq(qr, qr1), false);
expr_ref eq(m.mk_eq(qr, qr1), m);
ctx.internalize(eq, false);
literal qeq = ctx.get_literal(eq);
ctx.mark_as_relevant(qeq);
ctx.mk_th_axiom(get_id(), 1, &qeq);
m_arith_eq_adapter.mk_axioms(ensure_enode(qr), ensure_enode(qr1));
}

Expand Down

0 comments on commit 4092302

Please sign in to comment.