3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-02-03 17:15:38 +01:00
parent 9fde9fe3a2
commit 0acc042bf7
3 changed files with 51 additions and 55 deletions

View file

@ -561,7 +561,9 @@ namespace algebraic_numbers {
};
void sort_roots(numeral_vector & r) {
std::sort(r.begin(), r.end(), lt_proc(m_wrapper));
if (m_limit.inc()) {
std::sort(r.begin(), r.end(), lt_proc(m_wrapper));
}
}
void isolate_roots(scoped_upoly const & up, numeral_vector & roots) {
@ -1750,8 +1752,7 @@ namespace algebraic_numbers {
// then they MUST BE DIFFERENT.
// Thus, if we keep refining the interval of a and b,
// eventually they will not overlap
while (true) {
checkpoint();
while (m_limit.inc()) {
refine(a);
refine(b);
m_compare_refine++;
@ -1764,6 +1765,9 @@ namespace algebraic_numbers {
}
}
if (!m_limit.inc())
return 0;
// make sure that intervals of a and b have the same magnitude
int a_m = magnitude(a_lower, a_upper);
int b_m = magnitude(b_lower, b_upper);
@ -1810,6 +1814,7 @@ namespace algebraic_numbers {
// V == 0 --> a = b
// if (V < 0) == (p_b(b_lower) < 0) then b > a else b < a
//
m_compare_sturm++;
upolynomial::scoped_upolynomial_sequence seq(upm());
upm().sturm_tarski_seq(cell_a->m_p_sz, cell_a->m_p, cell_b->m_p_sz, cell_b->m_p, seq);

View file

@ -2517,7 +2517,7 @@ namespace upolynomial {
// Keep expanding the Sturm sequence starting at seq
void manager::sturm_seq_core(upolynomial_sequence & seq) {
scoped_numeral_vector r(m());
while (true) {
while (m_limit.inc()) {
unsigned sz = seq.size();
srem(seq.size(sz-2), seq.coeffs(sz-2), seq.size(sz-1), seq.coeffs(sz-1), r);
if (is_zero(r))