mirror of
https://github.com/Z3Prover/z3
synced 2025-06-29 17:38:45 +00:00
try_umul_blast
This commit is contained in:
parent
8a16631fd1
commit
7da7e99ca2
1 changed files with 17 additions and 15 deletions
|
@ -144,7 +144,7 @@ namespace polysat {
|
||||||
* [y] z' < y /\ yx < zx ==> Ω*(x,y) \/ (z' + 1)x < zx (TODO?)
|
* [y] z' < y /\ yx < zx ==> Ω*(x,y) \/ (z' + 1)x < zx (TODO?)
|
||||||
*/
|
*/
|
||||||
void saturation::try_ugt_y(pvar v, inequality const& i) {
|
void saturation::try_ugt_y(pvar v, inequality const& i) {
|
||||||
auto y = c.var(v);
|
pdd const y = c.var(v);
|
||||||
pdd x = y;
|
pdd x = y;
|
||||||
pdd z = y;
|
pdd z = y;
|
||||||
if (!i.is_Xy_l_XZ(v, x, z))
|
if (!i.is_Xy_l_XZ(v, x, z))
|
||||||
|
@ -216,10 +216,12 @@ namespace polysat {
|
||||||
/**
|
/**
|
||||||
* Expand the following axioms:
|
* Expand the following axioms:
|
||||||
* Ovfl(x, y) & x <= y => y >= 2^{(N + 1) div 2}
|
* Ovfl(x, y) & x <= y => y >= 2^{(N + 1) div 2}
|
||||||
|
* [ as approximation of Ovfl(x, y) & x <= y => y >= ceil(sqrt(2^N)) ]
|
||||||
* Ovfl(x, y) & msb(x) <= k => msb(y) >= N - k + 1
|
* Ovfl(x, y) & msb(x) <= k => msb(y) >= N - k + 1
|
||||||
* Ovfl(x, y) & msb(x) <= k & msb(y) <= N - k + 1 => 0x * 0y >= 2^N
|
* Ovfl(x, y) & msb(x) <= k & msb(y) <= N - k + 1 => 0x * 0y >= 2^N
|
||||||
*
|
*
|
||||||
* ~Ovfl(x, y) & x <= y => x < 2^{(N + 1) div 2}
|
* ~Ovfl(x, y) & x <= y => x < 2^{(N + 1) div 2}
|
||||||
|
* [ as approximation of ~Ovfl(x, y) & x <= y => x < ceil(sqrt(2^N)) ]
|
||||||
* ~Ovfl(x,y) & msb(x) >= k => msb(y) <= N - k + 1
|
* ~Ovfl(x,y) & msb(x) >= k => msb(y) <= N - k + 1
|
||||||
* ~Ovfl(x,y) & msb(x) >= k & msb(y) >= N - k + 1 => 0x * 0y < 2^N
|
* ~Ovfl(x,y) & msb(x) >= k & msb(y) >= N - k + 1 => 0x * 0y < 2^N
|
||||||
*/
|
*/
|
||||||
|
@ -231,7 +233,7 @@ namespace polysat {
|
||||||
return;
|
return;
|
||||||
if (!c.try_eval(y, vy))
|
if (!c.try_eval(y, vy))
|
||||||
return;
|
return;
|
||||||
auto N = x.manager().power_of_2();
|
unsigned N = x.manager().power_of_2();
|
||||||
auto d = c.get_dependency(sc.id());
|
auto d = c.get_dependency(sc.id());
|
||||||
|
|
||||||
auto bx = vx.get_num_bits();
|
auto bx = vx.get_num_bits();
|
||||||
|
@ -271,9 +273,9 @@ namespace polysat {
|
||||||
if (bx <= 1) {
|
if (bx <= 1) {
|
||||||
add_clause("Ovfl(x, y) => x > 1", { d, C.ugt(x, 1) }, true);
|
add_clause("Ovfl(x, y) => x > 1", { d, C.ugt(x, 1) }, true);
|
||||||
}
|
}
|
||||||
else if (bx < (N + 1) / 2) {
|
else if (by < N / 2) {
|
||||||
add_clause("Ovfl(x, y) & x <= y => y >= 2^{(N + 1) div 2}",
|
add_clause("Ovfl(x, y) & x <= y => y >= 2^{N div 2}",
|
||||||
{ d, ~C.ule(x, y), C.uge(x, rational::power_of_two((N + 1) / 2)) }, true);
|
{ d, ~C.ule(x, y), C.uge(y, rational::power_of_two(N / 2)) }, true);
|
||||||
}
|
}
|
||||||
else if (bx + by < N + 1) {
|
else if (bx + by < N + 1) {
|
||||||
SASSERT(bx <= by);
|
SASSERT(bx <= by);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue