mirror of
https://github.com/Z3Prover/z3
synced 2025-05-14 03:04:44 +00:00
smul no overflow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
89d6f1c191
commit
8c9835bca6
24 changed files with 376 additions and 63 deletions
|
@ -90,7 +90,7 @@ namespace polysat {
|
|||
return is_always_true(is_positive, s.subst(p()), s.subst(q()));
|
||||
}
|
||||
|
||||
void mul_ovfl_constraint::narrow(solver& s, bool is_positive) {
|
||||
void mul_ovfl_constraint::narrow(solver& s, bool is_positive, bool first) {
|
||||
auto p1 = s.subst(p());
|
||||
auto q1 = s.subst(q());
|
||||
|
||||
|
@ -100,10 +100,16 @@ namespace polysat {
|
|||
}
|
||||
if (is_always_true(is_positive, p1, q1))
|
||||
return;
|
||||
|
||||
if (try_viable(s, is_positive, p(), q(), p1, q1))
|
||||
return;
|
||||
|
||||
if (narrow_bound(s, is_positive, p(), q(), p1, q1))
|
||||
return;
|
||||
if (narrow_bound(s, is_positive, q(), p(), q1, p1))
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,6 +151,14 @@ namespace polysat {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool mul_ovfl_constraint::try_viable(
|
||||
solver& s, bool is_positive,
|
||||
pdd const& p0, pdd const& q0, pdd const& p, pdd const& q) {
|
||||
signed_constraint sc(this, is_positive);
|
||||
return s.m_viable.intersect(p0, q0, sc);
|
||||
}
|
||||
|
||||
|
||||
unsigned mul_ovfl_constraint::hash() const {
|
||||
return mk_mix(p().hash(), q().hash(), kind());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue