3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-13 17:41:16 +00:00

Draft: Made division/remainder to op_constraints (not yet used - old code still called)

This commit is contained in:
Clemens Eisenhofer 2023-02-09 23:36:15 +01:00
parent e31eb9a6b1
commit 6b48b25beb
6 changed files with 219 additions and 6 deletions

View file

@ -38,7 +38,11 @@ namespace polysat {
/// r is the smallest multiplicative pseudo-inverse of p;
/// by definition we set r == 0 when p == 0.
/// Note that in general, there are 2^parity(p) many pseudo-inverses of p.
inv_op
inv_op,
// r is the quotient of dividing p by q
udiv_op,
// r is the remainder of dividing p by q
urem_op,
};
protected:
friend class constraint_manager;
@ -47,6 +51,8 @@ namespace polysat {
pdd m_p; // operand1
pdd m_q; // operand2
pdd m_r; // result
op_constraint* m_linked; // for linking remainder/quotient
op_constraint(code c, pdd const& p, pdd const& q, pdd const& r);
lbool eval(pdd const& p, pdd const& q, pdd const& r) const;
@ -66,12 +72,19 @@ namespace polysat {
clause_ref lemma_inv(solver& s, assignment const& a);
static lbool eval_inv(pdd const& p, pdd const& r);
clause_ref lemma_udiv(solver& s, assignment const& a);
static lbool eval_udiv(pdd const& p, pdd const& q, pdd const& r);
clause_ref lemma_urem(solver& s, assignment const& a);
static lbool eval_urem(pdd const& p, pdd const& q, pdd const& r);
std::ostream& display(std::ostream& out, char const* eq) const;
void activate(solver& s);
void activate_and(solver& s);
void activate_udiv(solver& s);
public:
~op_constraint() override {}