3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 21:37:02 +00:00

working on incremtal PB theory

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-01-13 10:12:45 -08:00
parent 1f7c994e43
commit 236b2d2ff3
12 changed files with 1419 additions and 912 deletions

View file

@ -155,8 +155,7 @@ public:
else if (m.is_eq(fml, x, y) &&
get_pb_sum(x, rational::one(), args, coeffs, coeff) &&
get_pb_sum(y, -rational::one(), args, coeffs, coeff)) {
result = m.mk_and(mk_le(coeffs.size(), coeffs.c_ptr(), args.c_ptr(), -coeff),
mk_ge(coeffs.size(), coeffs.c_ptr(), args.c_ptr(), -coeff));
result = mk_eq(coeffs.size(), coeffs.c_ptr(), args.c_ptr(), -coeff);
return true;
}
return false;
@ -174,6 +173,14 @@ public:
}
return m_pb.mk_le(sz, weights, args, w);
}
expr* mk_eq(unsigned sz, rational const* weights, expr* const* args, rational const& w) {
#if 1
return m.mk_and(mk_ge(sz, weights, args, w), mk_le(sz, weights, args, w));
#else
return m_pb.mk_eq(sz, weights, args, w);
#endif
}
expr* mk_ge(unsigned sz, rational const* weights, expr* const* args, rational const& w) {
if (sz == 0) {