mirror of
https://github.com/Z3Prover/z3
synced 2025-11-09 23:52:02 +00:00
Use parity helper functions
This commit is contained in:
parent
bf03886a87
commit
a0f5386bdd
5 changed files with 33 additions and 40 deletions
|
|
@ -872,10 +872,10 @@ namespace polysat {
|
|||
auto& m = p.manager();
|
||||
unsigned N = m.power_of_2();
|
||||
if (p.is_val())
|
||||
return p.val() == 0 ? N : p.val().trailing_zeros();
|
||||
return p.val().parity(N);
|
||||
|
||||
if (s.try_eval(p, val)) {
|
||||
unsigned k = val == 0 ? N : val.trailing_zeros();
|
||||
unsigned k = val.parity(N);
|
||||
if (k > 0)
|
||||
explain.push_back(s.parity_at_least(p, k));
|
||||
return k;
|
||||
|
|
@ -910,10 +910,10 @@ namespace polysat {
|
|||
unsigned N = m.power_of_2();
|
||||
rational val;
|
||||
if (p.is_val())
|
||||
return p.val() == 0 ? N : p.val().trailing_zeros();
|
||||
return p.val().parity(N);
|
||||
|
||||
if (s.try_eval(p, val)) {
|
||||
unsigned k = val == 0 ? N : val.trailing_zeros();
|
||||
unsigned k = val.parity(N);
|
||||
if (k != N)
|
||||
explain.push_back(s.parity_at_most(p, k));
|
||||
return k;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue